Hiya
the actual file delete isn't necessarily the problem as the script will delete the files (under the correct conditions)
the issue I'm having is that during a test execution as the main test suite iterates through the rows of data sometimes the test suite that is invoked which tries to delete the files before recreating them cant delete them because they're still in use for some reason,
the file locking isn't predictable and doesn't occur at the same time each pass through, if I run the tests through row by row all is fine (unless a validation fails which seems to see the files locked on the next pass) but when running through on a range of rows of data (even with validations being aok) at some point I end up with a file that hasn't been deleted and the file that is then referenced is an amalgam of data which will then fail the validation that references that file as the data comparison is fails