Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What if a user got only write access to a file? Is he able to read the file or only to "write"? However, if you can write, you can also read, so this doesn't make sense?

The question is for Unix-like system also for windows system, I'm sure there is a difference right? Thank you

share|improve this question

*nix:

For *nix systems you can simply set "write-only" which works as expected. There is no matter why it should not. I don't understand your assumtion of automatically get read access... it's wrong. You can e.g. append to the file with no problem.


Windows:

It is possible to modify the permissions to only have "write"-access but my tests show that even it should work from what the properties show, it doesn't and always gives "Access denied". I think it is by design not meant to set only write on NTFS.

share|improve this answer

Linux

You could append text to the file even if you can't read it. Check this example:

Create a file with one line

nine@nine-laptop:~$ echo "Some text" >/tmp/testfile.txt

Show that file

nine@nine-laptop:~$ cat /tmp/testfile.txt
Some text

Make it write only

nine@nine-laptop:~$ chmod 200 /tmp/testfile.txt

Show file with permissions

nine@nine-laptop:~$ ls -l /tmp/testfile.txt  
--w------- 1 nine nine 10 nov 14 10:54 /tmp/testfile.txt 

Try to read it (which won't work)

nine@nine-laptop:~$ cat /tmp/testfile.txt  
cat: /tmp/testfile.txt: Access denied

Append text to end of file

nine@nine-laptop:~$ echo "Appended text" >>/tmp/testfile.txt 

Set permissions to read and write

nine@nine-laptop:~$ chmod 600 /tmp/testfile.txt  

Show the file (which now has one more line)

nine@nine-laptop:~$ cat /tmp/testfile.txt
Some text
Appended text

BSD

Works precisely the same as on Linux.

Windows

Adding weeks comment: It works the same in Windows. Exept there are several rights in write permission, like "Write data", "Append data", "Write Attributes", "Write Extended Attributes"..

share|improve this answer
1  
Yes, it works the same in Windows. Exept there are several rights in write permission, like "Write data", "Append data", "Write Attributes", "Write Extended Attributes".. – week Nov 14 '12 at 10:06
    
Oh! That sounds nice :) – Niclas Nilsson Nov 14 '12 at 10:09
    
+1 for giving a good answer, complete with explanations. – Hennes Sep 2 '13 at 13:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .