Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any use if a file has only write and execute permission and not read permission?

share|improve this question

2 Answers 2

There are uses for most objects you will find in a filesystem:

Directories: -wx would let you be in the the directory, create & modify files in it, but not list its contents. --x is sometimes used for directories as a security-through-obscurity measure, for instance on /home so people can't see what other users exist via their footprint in /home (though note well: obscurity on its own is no security - in the case of hiding the contents of /home a user can usually read the same information from /etc/passwd anyway)

Named Pipes: The execute bit has no meaning for a pipe so this is the same as -w- meaning you can write to the pipe but not read from it (so you can't see what other writers are putting into the pipe or disrupt the reader).

Device Nodes (as usually found under /dev): Similar to named pipes - you could write to the device but not read from it.

Normal Files: -w- would allow a user to append to a file, but not read existing data. Execute permission would not be very useful here, but you could have some very weird executable that used the back end of itself for configuration and allow the user to modify that config without reading the rest of the binary. I can't imaging this would be useful or at all safe though.

share|improve this answer

Permissions like this can be used for drop box like functions on a folder, though you typically wouldn't use the write permission in that case. Other than that I haven't seen a lot of use for only write and execute. Thinking...

share|improve this answer
    
Write+execute+sticky would result in an usable drop-box. –  grawity Jan 11 '11 at 14:34
    
If a file has to be executed, it needs to be read first right? –  Sathya Jan 11 '11 at 15:17
    
In the context of a file: If it's a binary executable it doesn't have to be readable to be executed, if it needs to exec an interpreter that then reads the program (#! stuff) then it needs to be readable. –  Kjetil Jørgensen Jan 11 '11 at 15:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.