in reply to Reading from a deleted file is futile
When I want to know if a file has been deleted or not (in a unix-like system,) I run ls, to list the directory's contents. If the entry has been removed, the file should be missing.. so this is one option (somewhat simplified):
This code has not been tested, but looks ok to me. It's really about the idea behind it anyway.$filename = "openfile.yaml"; $directory = "/over/here/somewhere/i/think/"; $fileIsDeleted = (`ls $directory` !~ /$filename/gs); print "Your file has ".($fileIsDeleted ? "" : "not ")."been deleted.";
|
|---|