Re: File permission confusion [Debian 9.1 with MATE]
-----BEGIN PGP SIGNED MESSAGE-----
> On Mon, Jan 01, 2018 at 06:11:59PM -0000, Dan Purgert wrote:
>> Note that "write" permissions on a file only really comes into play when
>> you're messing with a file in an editor (e.g. vim, emacs, nano,
>> whatever). It does not necessarily prevent one from doing something
>> -rw-r----- [...] somefile.txt
>> $ mv anotherfile.txt somefile.txt
>> Because you're not modifying "the file", but rather its parent
>> directory. It's a very, very fine distinction, to be sure.
> And that's the point... a program "messing" with the file might
> well choose to copy the file to some other name, modify that copy,
> and then, at the end, remove the original and rename the new
> version to the original name: this is actually a common pattern
> to achieve some form of "atomicity": when you want either all
> the changes "committed to disk" or none (in case of failure).
Exactly. Though reading it again, it was a poor turn of phrase to have
said "messing" with the file.
> As long as the basic difference between a file and its "name"
> (i.e. the directory entry "pointing" to the file) is not understood,
> this fine difference between writing to the file and modifying
> (e.g. deleting) the directory entry will seem mysterious.
> Otherwise... nice tutorial.
Thanks. chmod and chattr actually have really nice manpages :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
-----END PGP SIGNATURE-----
|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281