5 ms·
The point seems to be that this isn't expected behavior in most people's minds, and that if someone truly wants to allow users to write to a directory, but not
by etskinner 9y ago
The point seems to be that this isn't expected behavior in most people's minds, and that if someone truly wants to allow users to write to a directory, but not allow them to delete a file, that file must be flagged immutable. Just a quirky edge cases that people might not know about.
- jstanley 9y agoIt is expected behaviour if your mental model is accurate enough. My mental model is that a directory is just a special file that links to other files. Adding or deleting a file to a directory is just a case of writing to the "special file" to add or remove links to other files.
- yberreby 9y agoBut if the file you are removing is the only reference (i.e. hard link) to that inode, you're not just modifying the directory's contents; you're also removing data from the filesystem as a whole.
- glandium 9y agoNote that something else also happens to the inode when it's not the only reference: removing a file changes the "nlink" counter on the inode.
- paulddraper 9y agoRight. You are only affecting that directory listing. Any other hardlinks in any other directories are completely unaffected.
- cortesoft 9y agoThe statement 'it is the expected behavior if your mental model is accurate enough' is a tautology.
- ouid 9y agosaying that tautologies are tautologies is tautological.
- zaptheimpaler 9y agoit only tautological to say "X is a tautology" to those who had recognized X as being a tautology.
- PhasmaFelis 9y agoThe correct answer to "many people find this confusing" is never "I don't, so it's fine."
- Spivak 9y agoBut there's a difference between confusion that arises because something is complex or inconsistent and confusion that arises because people have the wrong mental model. "I assume that SQL tables are basically just fancy CSV files. Therefore strong invariants are obviously confusing."
- PhasmaFelis 9y agoIf most serious users have the wrong mental model about something, then either there's a serious documentation/training failure, or the correct model is non-obvious and counterintuitive (or both). Blaming the users for their ignorance is not productive in either case.
- joelthelion 9y agoHow do you fit immutable files into that mental model?
- libeclipse 9y agoThat comment comes across as very arrogant. Of course if you're familiar enough with the system then you'll have no need to read this, and you can go off and seek gratification installing Gentoo and telling everyone about it. But some people don't know, and benefit from learning it. So chill.
- reacweb 9y agoI did not know about immutable, but I have noticed that c9.io uses another way to avoid modification of a file present in a directory that I own. It makes it a read only mount point: /dev/mapper/volg1-lvdata on /home/ubuntu/.ssh/authorized_keys type ext4 (ro,relatime,data=ordered)