Hacker News new | past | comments | ask | show | jobs | submit login

It 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.




The statement 'it is the expected behavior if your mental model is accurate enough' is a tautology.


saying that tautologies are tautologies is tautological.


it only tautological to say "X is a tautology" to those who had recognized X as being a tautology.


The correct answer to "many people find this confusing" is never "I don't, so it's fine."


But 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."


If 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.


But 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.


Note 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.


Right. You are only affecting that directory listing.

Any other hardlinks in any other directories are completely unaffected.


That 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.


How do you fit immutable files into that mental model?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: