[GRASS5] $ETC/cleanup fails on directories in .tmp/

Markus Neteler neteler at itc.it
Mon Apr 3 15:46:19 EDT 2006


Hi,

a couple of GRASS modules generate subdirectories within the .tmp/
directory of mapsets. I have discovered that etc/clean_temp fails
on cleaning those as it is written to remove files only:

strace /home/neteler/soft/61grass_cvsexp/dist.i686-pc-linux-gnu/etc/clean_temp
...
unlink("31611.0")                       = -1 EISDIR (Is a directory)
stat64("31944.0", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
kill(31944, SIG_0)                      = -1 ESRCH (No such process)
unlink("31944.0")                       = -1 EISDIR (Is a directory)
stat64("32038.0", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
kill(32038, SIG_0)                      = -1 ESRCH (No such process)
unlink("32038.0")                       = -1 EISDIR (Is a directory)
...

The C file is lib/init/clean_temp.c

I would appreciate if someone could add dir removal to this command
to avoid that tons of files are left over. I am asking since this is
probably sensible code which may carry some risk if badly implemented
and which needs to be portable.

Thanks,

 Markus




More information about the grass-dev mailing list