Re: File Permissions
joe_at_invalid.address
Date: 10/03/03
- Next message: Karthik D: "TAB instead of 8 spaces??"
- Previous message: Jens.Toerring_at_physik.fu-berlin.de: "Re: File Permissions"
- In reply to: Stu: "File Permissions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 03 Oct 2003 13:44:08 GMT
beefstu350@hotmail.com (Stu) writes:
> 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?.
The mode argument to open(2) or creat(2) determine the bits that the
file starts with. If the file is being created by ksh, I assume that's
the mode it uses by default. You don't say what system or version of
ksh you're using, but I ran a test on Solaris ksh:
truss ksh -c 'echo xxx > testfile'
Which shows it opening testfile with a mode of 0666:
open64("testfile", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
> Is there a way to have the file created with permissions other than
> 666 without setting a value to umask ? If so, how ?
You'd have to control whatever program is calling open(2) or
create(2). Depending on what system you're using, there may be a
default setting in a file someplace, but I'm not aware of one, I think
it's more or less traditional.
Joe
- Next message: Karthik D: "TAB instead of 8 spaces??"
- Previous message: Jens.Toerring_at_physik.fu-berlin.de: "Re: File Permissions"
- In reply to: Stu: "File Permissions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|