Unable to delete directory in Cygwin
Thu Jun 15 10:15:00 GMT 2006
I have implemented some changes in the linker code for some intermediate
For that I need to create a temporary directory, generate some
files in it, process those files by calling a function. After processing
intermediate files, I delete the intermediate files and the temporary
While this logic works fine in the linux, the temporary directory does
deleted in cygwin.
/* ldmain.c */
delete tmp_directory;//I have to delete the tmp_directory only here
/* myfile.c */
create tmp directory tmp_directory;
create intermediate files in the above directory; .
my_process_function(intermediate files);//processes the intermediate
process the intermediate files;
delete the intermediate files;// I cannot delete the tmp_directory here
After debugging using gdb, I found that in cygwin, the intermediate
had some handlers open for it inspite of reaching till the end of the
function in linker. Due to this, the temporary files get deleted only
exiting from the main. Hence as the temporary drectory is not empty till
it cannot get deleted.
This behaviour is not seen in linux. Care has been taken in the code for
opening and closing of the intermediate files.
Is this a known behavior in cygwin? Any inputs will be appreciated.
KPIT Cummins InfoSystems Ltd.
Free download of GNU based tool-chains for Renesas' SH, H8, R8C, M16C
and M32C Series.
The following site also offers free technical support to its users.
Visit http://www.kpitgnutools.com for details.
Latest versions of KPIT GNU tools were released on June 1, 2006.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin