in reply to A DWIM too far?
The misunderstanding involves setting individual file permissions to "read-only", and thinking that this protects the file from being deleted. It doesn't. The file is protected from having its contents altered by being opened for write access, and that's it.
Now, if the directory containing the file is also set for "read-only" access, then the file is safe, but so long as there is write access on the directory, the file can be deleted (or another file can be renamed to displace/obliterate it).
The default behavior of unix "rm" involves always asking for interactive confirmation before deleting a file that is set for read-only access, but "rm -f" is always available to bypass that safeguard (e.g. when running in a script or makefile), and this is what Perl's "unlink()" does.
I'm not saying it's good or bad for it to be this way. Just like a chainsaw is not intrinsically good or bad... It simply requires care and respect.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A DWIM too far?
by BrowserUk (Patriarch) on Jun 18, 2004 at 02:57 UTC | |
by tye (Sage) on Jun 18, 2004 at 19:02 UTC | |
by BrowserUk (Patriarch) on Jun 18, 2004 at 19:25 UTC |