I'm an Ubuntu user and I'd like to change default permissions for downloaded files. Currentely all downloaded files are automatically saved with "-rw-r--r--" permissions (umask 0022). I'd like to add "+x". How to do that?
Asked
Active
Viewed 288 times
0
-
7This is a very bad idea. Why do you want to do this? – Chris Down Sep 24 '11 at 13:56
-
Related: facl ignoring the “x” permission but only on files. – Scott - Слава Україні Jul 07 '15 at 14:06
2 Answers
3
You would have to edit the source code of the programs performing the downloading as files are created by default as 0666 modified by the current umask. From the fopen(3)
man page:
Any created files will have mode S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH (0666), as modified by the process’s umask value (see umask(2)).

Ignacio Vazquez-Abrams
- 45,725
0
which program do you use to download? If the program doesn't have hard permission for new files compiled in, you can simply set the environments umask before starting the program (in the same env / shell).
With bash there is a "umask" command, try 'help umask' in bash.
e.g. umask 0000; wget htpp://

Andreas John
- 106