Bug fix on files generation

## Context
The datagen generation fails on some workstations.
## Description
There seems to be some delay before a file is actually deleted during generation, which creates a lock. As a workaround, we create a new file before creating a ```FileWriter```.