umask chmod??
my umask shows the following:
> umask 0022 my question is when I create a file > touch file; ls -al the file permision is 644?? I thought the file should be permission 777-022 = 755 ?? |
The execute permissions are only given to execute-capable files. It makes no sense to try and run a file you've only touch'ed. It's the same thing with text editors like vi, emacs, nano, etc. You're creating a text file, and it makes no sense to execute a text file. The exception would be scripts, but there's no way the text editor can know if you're writing plain text or a script. So, I suspect the decision to set file attributes is embedded in the program somewhere. If you want to see an example of what you were expecting, do this:
in file hello.c: Code:
#include <stdio.h> Code:
gcc -o hello hello.c |
now this is a good question (lke you care what i think ;) )
traditionally standard utils like touch when they create files create them 0666 here is some code from an ancient unix V7 version of touch Code:
if( (fd = creat(name, 0666)) < 0) Code:
if (! no_create) S_IWUSER = 00200 and you can extrapolate the rest so it's still the same 00666 as it's always been |
default permissions are 666 for files and 777 for directories. umask is subtracted from those.
|
All times are GMT -5. The time now is 12:31 PM. |