Umask on linux file

13 views
Skip to first unread message

Cedric Fontaine

unread,
Dec 10, 2009, 3:50:18 PM12/10/09
to OpenQM
Hello,

Is there a way to create file with a CHMOD of 0777 with a Write on QM
on a linux dir. Of course, I can create my file and then execute a
chmod but I'd like a way to do it with a single write.

Thanks.

Ashley Chapman

unread,
Dec 10, 2009, 4:06:26 PM12/10/09
to ope...@googlegroups.com
Cedric,

I do just that. Include :-
execute 'SH umask 000' capturing umask

before the file create in your program.

Substitute 000 with whatever is appropriate for you.

2009/12/10 Cedric Fontaine <cfon...@spidmail.net>:
--
Ashley Chapman

eppick77

unread,
Dec 10, 2009, 4:16:15 PM12/10/09
to OpenQM
Cedric,

We have every user have a bash_profile. In that profile we put in
umask 007. What you are going to need is some variation of that umask
number. The 007 creates read and write privileges for the group and
owner but not the "other".

You might play with that to see what umask you will need to create the
equivalent of 777.

Eugene

Martin Phillips

unread,
Dec 10, 2009, 4:24:45 PM12/10/09
to ope...@googlegroups.com
Hi Cedric,
 
Is there a way to create  file with a CHMOD of 0777 with a Write on QM on a linux dir. Of course, I can create my file and then execute a chmod but I'd like a way to do it with a single write.
 
QM has a UMASK command to set the modes for files created from within QM.
 
 
Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
+44-(0)1604-709200
 

eppick77

unread,
Dec 11, 2009, 9:31:16 AM12/11/09
to OpenQM
It sounds like Cedric needs to do a umask of 000 on the qm side to
give him the same as chmod 777.

We set ours up to put umask of 007 in each user bash profile. I was
not aware of the umask command on the qm side. Interestingly, I typed
umask at tcl and it returned 007.

Eugene

On Dec 10, 4:24 pm, "Martin Phillips" <martinphill...@ladybridge.com>
wrote:

Cedric Fontaine

unread,
Dec 11, 2009, 10:40:59 AM12/11/09
to ope...@googlegroups.com
Martin Phillips wrote:
> Hi Cedric,
>
> Is there a way to create file with a CHMOD of 0777 with a Write on QM
> on a linux dir. Of course, I can create my file and then execute a chmod
> but I'd like a way to do it with a single write.
>
> QM has a UMASK command to set the modes for files created from within QM.

Does this apply to all the files created ? Including create.file ?

--
Cedric Fontaine
http://www.terroirsquebec.com

Martin Phillips

unread,
Dec 11, 2009, 11:35:52 AM12/11/09
to ope...@googlegroups.com
Hi Cedric,

The UMASK command simply sets the underlying operating system umask value so
it should affect all files created from the QM session including use of
CREATE.FILE though this has another way to do this by use of its MODES
option.


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
+44-(0)1604-709200

> --
>
> You received this message because you are subscribed to the Google Groups
> "OpenQM" group.
> To post to this group, send an email to ope...@googlegroups.com.
> To unsubscribe from this group, send email to
> openqm+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/openqm?hl=en-GB.
>
>

Kevin Powick

unread,
Dec 11, 2009, 1:12:51 PM12/11/09
to OpenQM
It's hard to tell from the responses here, but it should be clarified
that umask cannot actually grant permissions. It can only remove
(mask) permissions granted by the process setting permissions. IOW,
umask is not equivalent to chmod, which actually does CHange a file's
MODe.

A decent explanation, along with how to calculate umasks, can be found
at the following link

http://en.wikipedia.org/wiki/Umask

--
Kevin Powick
Reply all
Reply to author
Forward
0 new messages