Is it possible to create an umask , which will result in newly created files and directorties to have the same access rights ? e.g both of them to have for example


Directories starts with 777 - umask , and files with 666 - umask , but is it possible to create such an umask?

  • Any reason you want a non executable directory?
    – StrongBad
    Commented Apr 21, 2016 at 19:46
  • it is just an example , to demonstrate that both files and directories should have same rights
    – trolkura
    Commented Apr 21, 2016 at 19:48
  • possible duplicate: unix.stackexchange.com/questions/66910/…
    – StrongBad
    Commented Apr 21, 2016 at 19:55
  • On Linux, you can kind of get this by using filesystems that don't have any concept of permissions (such as vfat) and using the umask= option when mounting them to give them simulated permissions. Of course, this is filesystem-wide and will apply to all users who can access the filesystem, regardless of their own umasks and any use of the chmod command. Commented Apr 21, 2016 at 21:51

1 Answer 1


No - that would be doable only if the applications requested the same permissions for both directories and files. But fopen uses 0666 for files, and direct open calls commonly use the same permissions, while directories require execute privilege to be useful, so they are usually requested with 0777 (or 0755, depending on the application).

You must log in to answer this question.

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