in reply to Deleting a File

Could another process have it open?
If phimtau123 is on a *nixy system he could dig in `lsof`s output with (e)grep to see whether by any chance, as Grandfather tried to clarify above, the file is being held open by another process.

Replies are listed 'Best First'.
Re^2: Deleting a File
by tirwhan (Abbot) on Jun 20, 2007 at 08:13 UTC
    If phimtau123 is on a *nixy system he could dig in `lsof`s output with (e)grep

    Well, if he were on a UNIX system he wouldn't need to do that at all, because POSIX-compliant systems allow you to unlink files while they are being held open by another process, the process can continue reading/writing to the unlinked file but the file ceases to exist once the filehandle is closed. Also, greping lsof output for a filename is insanely wasteful, because it makes lsof pipe all the filenames of open files on the entire system to grep, which then throws most of them away. Instead, just do

    lsof <filename>

    All dogma is stupid.