Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So anyway, for want of anything better to do I have been messing around with file permissions and sooner or later ended up with a file that had the following permissions:
--w--w--w-
I'll bet no one's seen that before. :-)
Is this just the dumbest thing ever, or is there a legitimate reason to have a file that can be written to by everyone but read by no one? Just curious....
A write-only file does actually have a use. It could be an output device file, which could be mapped to a kernel device driver for a piece of hardware that was only an output and provided no feedback.
In practice, all output devices in common use have some kind of feedback, and so most device files are read/write, but that isn't necessarily the case.
Of course, such a file would normally be b-w--w--w- or c-w--w--w- , but since the advent of procfs, it would be perfectly possible to create such a file under a virtual filesystem like /proc or /sys. On my system, for example, I have a file named /proc/sysrq-trigger with permissions of --w-------- (but none writeable by all users).
I just did a $ sudo ls -Rl /proc 2>/dev/null | grep \\\-w and saw a lot of links to pipes and some other files (like clear_refs) with only write access, although only the proc file owner could (as one would expect) write to the "file."
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.