purgeWrite - folders not removed
Status: Pre-Alpha
Brought to you by:
apostol
Specifying a value > 0 in the "purgeWrite" directive within the controlDict file removes result iteration folders older than the number of iterations specified in purgeWrite. The Windows version of OpenFOAM successfully recognises "purgeWrite" and deletes the contents of all the relevant folders, but fails to remove the folder itself.
A warning is displayed during the simulation that the folder could not be removed.
Could you give me some information about the context in which the problem
occurred: which application caused the problem and what was exactly the
message issued (use copy and paste). Please also attach the controlDict if
possible.
sample controlDict file
Sorry for not being more clear in filing the bug-report.... never done it before.... so, here is more information regarding the context of occurrence the bug:
1. OpenFOAM solver used: simpleFoam (I am sure it is not dependent on the solver used)
2. Setting required in order to produce the error - a valid value greater than 0 for the "purgeWrite" setting in the controlDict of a case
3. Frequency of occurrence: 100%
4. Error is not fatal, and the solver continues with the execution
5. Sample of the error message produced:
########
--> FOAM Warning :
From function rmdir(const fileName&)
in file C:\tmp\OpenFOAM-1.5\src\OSspecific\MSWindows\Unix.C at line 979
failed to remove directory "D:\CFD\philippose-1.5\run\002_simpleFoam_pitzDaily\50\uniform"
--> FOAM Warning :
From function rmdir(const fileName&)
in file C:\tmp\OpenFOAM-1.5\src\OSspecific\MSWindows\Unix.C at line 949
failed to remove directory "uniform" while removing directory "D:\CFD\philippose-1.5\run\002_simpleFoam_pitzDaily\50"
ExecutionTime = 55.52 s ClockTime = 56 s
########
6. Sample of a controlDict file which causes this error to appear - see attachments
Hope this helps ......
Have a nice day :-)!
The problem was that the rmDir(const fileName&) function (which is incorrecly called rmdir(const fileName&) in the error message) invokes the remove(const char*) standard C function to remove a directory, which apparently does not work identically in unix and windows. In unix it removes both files and directories while in windows it only removes files (in the strict sence). This seems to be due to the different interpretation of the word "file", which in a sense can be a file in the strict sence but it can also be a directory or even a device. We replaced the call to remove by a call to rmdir, when a file is actually a directory. Since this is not a high priority issue, the fix will be available in the next update (around October 2009).
The problem was that the rmDir(const fileName&) function (which is incorrecly called rmdir(const fileName&) in the error message) invokes the remove(const char*) standard C function to remove a directory, which apparently does not work identically in unix and windows. In unix it removes both files and directories while in windows it only removes files (in the strict sence). This seems to be due to the different interpretation of the word "file", which in a sense can be a file in the strict sence but it can also be a directory or even a device. We replaced the call to remove by a call to rmdir, when a file is actually a directory.
Since this is not a high priority issue, the fix will be available in the next update of OpenFOAM (windows version), around October 2009.