3 ms·
Should have been more clear. Yes, (at least in Linux) you can mknod a special file anywhere, but the directory hierarchy is taken in context when you open the
by anonymousiam 5y ago
Should have been more clear. Yes, (at least in Linux) you can mknod a special file anywhere, but the directory hierarchy is taken in context when you open the file. On MSDOS, you can open AUX or CON in any directory, even though no such named file exists anywhere in the filesystem. THAT is a poor implementation, and would probably be considered a bug by most developers if it were offered as a solution today.
- rbanffy 5y agoYou know… it was called QDOS for a reason.
- hnlmorg 5y agoThere wasn't directories in the first release of DOS. So I can forgive those special devices being location agnostic. However removing the device suffix (the colon) is really what causes this to be a bug. You either have persistent files with special attributes that identify it as a device, or you namespace your devices with characters that cannot be used in a file name. But you don't allow your devices to be valid file names and have them invisible on the file system.
- mbreese 5y ago> However removing the device suffix (the colon) is really what causes this to be a bug. I never thought about it, but when you consider ‘:’ as the device suffix, this makes directory structures make more sense to me on Windows. C:\foo\bar makes more sense to me if it is the ‘C:’ device. Calling it a ‘C drive’ with a separate namespace never made sense to me. Somehow thinking of it the ‘C:’ device in an anonymous global hierarchy makes more sense to me.
- dredmorbius 5y agoDevice files require that the mount point allow device files. That's a mount-time option, and "nodev" will prevent this. You'll still be able to create named pipes (mkfifo), but mknod will fail. This is handy for filesystems with a poorly developed sense of user ownership and permissions, say, msdos or vfat. I tend to mount my /tmp space nodev and nosuid, as occasionally you'll find poorly-written, or nefariously-intended programs attempting to do such things there.