4 ms·
How could this be in the core of an OPERATING SYSTEM? At one of the largest software manufacturers in the world? I legitimately do not understand.
by stevebmark 9y ago
How could this be in the core of an OPERATING SYSTEM? At one of the largest software manufacturers in the world? I legitimately do not understand.
- jonchang 9y agoNot to be too snarky, but tons of other operating systems have these kinds of "features". The most prominent example is in macOS and Linux with file names starting with a dot being hidden by default.
- ams6110 9y agoYes, but the reason for that convention is just to avoid clutter in the output of ls. It's not to prevent users from deleting files that they shouldn't -- file system permissions, and not logging in as "root" all the time, are the correct way to handle that.
- stevebmark 9y agoHiding files starting with a dot is just a cosmetic, view level implementation. This article shows that Windows had coupled this behavior directly to system level file flags.
- badosu 9y ago> Hiding files starting with a dot is just a cosmetic, view level implementation. Is it? [0] [0]: https://plus.google.com/u/0/+RobPikeTheHuman/posts/R58WgWwN9jp https://plus.google.com/u/0/+RobPikeTheHuman/posts/R58WgWwN9...
- sratner 9y agoThis is also just a cosmetic, view level implementation in Explorer (complete with a bug, also in Explorer). In fact, the fix was to use kernel fs functions directly.
- paulddraper 9y ago> cosmetic, view level implementation Sort of. The kernel doesn't treat it special but the OS does. Any POSIX compliant shell won't include dot files for a single wildcard. E.g. rm -fr * doesn't empty the current directory.
- gerdesj 9y agoThe Unix (Linux and Mac inherit this) idea of a leading dot = hidden is almost certainly from the days before file attributes were even invented (err available on Unix). Don't quote me on that and I can't be arsed to do the research but it certainly sounds possible! In Linux it is a bit of an arse. My home directory looks absolutely rubbish when I view it on a Windows box, which I do with monotonous regularity when fixing the bloody things (Windows boxes that is.)
- ams6110 9y agoI suppose that could be, I don't know either. I think it's more likely from the early days where users were interacting over slow teletypes or terminals, and having a convention that hid rarely-interesting files by default was more efficient.
- loeg 9y agoIt was a bug in ls. The intent was to hide only "." and "..". https://unix.stackexchange.com/questions/88875/why-are-filenames-that-start-with-a-dot-hidden-can-i-hide-files-without-using-a https://unix.stackexchange.com/questions/88875/why-are-filen...
- mintplant 9y agoIt started out as unintended behavior of some code in "ls" which was put in to skip "." and ".." when printing directory listings. https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp The concept of a "hidden file" was an accidental invention.
- rossy 9y agoTo be fair, it's not in the core, it's in the shell. The shell treats files that have FILE_ATTRIBUTE_HIDDEN and start with a ~ as if they also had FILE_ATTRIBUTE_SYSTEM, but this only affects the shell. It doesn't leak to other programs that use the filesystem APIs directly. The shell has always had a different, more user-oriented view on the filesystem. It also does other user-oriented things, like replacing some filesystem names with display names (eg. C:\ -> Local Disk (C:),) letting you browse things that aren't filesystem objects, like remote FTP shares and files inside .zip archives, and synthesizing folders that don't really exist like This PC/My Computer, the Desktop, Recycle Bin and Libraries.