in reply to Re^2: How does rename() work on read-only files?
in thread How does rename() work on read-only files?
I expect that the new inode numbers for alpha/foo* in the linked doc are in error. The textual description in the doc is correct:
So what happens? Consider this
perl -i.bak -pe 1 alpha/foo
Perl wants to do this
rename alpha/foo to alpha/foo.bak
create a new alpha/foo
Now, alpha/foo is permission 0644, which means you can write it, *BUT
THIS IS IRRELEVANT*. You are not altering the file. You moved it out
of the way and created a new one. Moving and creating are governed by
the directory's permissions. Since alpha is mode 0755, this is allowed ...
The fact that tchrist's file-dir-perms doc is now relegated to a tarball in the olddoc tree does suggest that it is only kept for historical interest, despite the link from perlfaq5.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How does rename() work on read-only files?
by j41r (Beadle) on Dec 12, 2018 at 00:28 UTC | |
by hippo (Archbishop) on Dec 12, 2018 at 09:26 UTC | |
by j41r (Beadle) on Dec 12, 2018 at 09:51 UTC |