Re: File Permissions
Jens.Toerring_at_physik.fu-berlin.de
Date: 10/03/03
- Next message: joe_at_invalid.address: "Re: File Permissions"
- Previous message: Andreas Kahari: "Re: File Permissions"
- In reply to: Stu: "File Permissions"
- Next in thread: joe_at_invalid.address: "Re: File Permissions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 Oct 2003 13:41:35 GMT
Stu <beefstu350@hotmail.com> wrote:
> I am running in the ksh and have a umask 000 and my file gets created
> with the permissions of 666.
> -rw-rw-rw- 1 stu developer 0 Oct 3 09:17 x
> Why does it get created as 666. Is this the default behavior of the
> UNIX?, KSH?.
Yes, 666 is some kind of default - you wouldn't like all files to
be created with the execution bit set and you can change the
behavior for the other bits via umask. But perhaps you're misunder-
standing what umask is. Contrary to a quite common believe umask
does not *set* the permissions for a newly created file, it says
which permission bits are *not* to be set. That's wky it's called
'umask' and not just 'mask'. So, by having umask set to 000 you
actually allow all bits to be set for a new file. If you want to
keep the rw bits from getting set for the new file you have to set
umask to 666:
jens@crowley:~ > umask 000
jens@crowley:~ > touch testfile
jens@crowley:~ > ls -l testfile
-rw-rw-rw- 1 jens users 0 Oct 3 15:32 testfile
jens@crowley:~ > rm testfile
jens@crowley:~ > umask 666
jens@crowley:~ > touch testfile
jens@crowley:~ > ls -l testfile
---------- 1 jens users 0 Oct 3 15:33 testfile
jens@crowley:~ >
Regards, Jens
--
_ _____ _____
| ||_ _||_ _| Jens.Toerring@physik.fu-berlin.de
_ | | | | | |
| |_| | | | | | http://www.physik.fu-berlin.de/~toerring
\___/ens|_|homs|_|oerring
- Next message: joe_at_invalid.address: "Re: File Permissions"
- Previous message: Andreas Kahari: "Re: File Permissions"
- In reply to: Stu: "File Permissions"
- Next in thread: joe_at_invalid.address: "Re: File Permissions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|