Operating System - HP-UX
1833155 Members
3045 Online
110051 Solutions
New Discussion

getting execute permission at file creation time

 
Sharon Prothero
Frequent Advisor

getting execute permission at file creation time

I know how to get the umask value I want and I know that this interacts with the default creation permissions for an ordinary file so that a umask of 000 gives file permissions of 666. Does any one know how to get a file created with execute permission? like a directory would be. I'm looking for an end result of 755 as the file permissions.

The background is that I'm installing Oracle software and it says to set the umask of the installing user to 022 before you start "... to ensure group and other have read and execute permissions, but not write permission, on the files the Installer creates. ..." Of course this doen't work and part way through, the installation fails because a script it's just created doesn't have execute permission.
7 REPLIES 7
Thierry Poels_1
Honored Contributor

Re: getting execute permission at file creation time

hi,
there is no way in creating executable files at once.
Umask 000 will create rw-rw-rw files and rwxrwxrwx directories. Execute permission always has to be given explicitely, the system can't know you're creating an executable file; most files on a system are datafiles.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Vincent Farrugia
Honored Contributor

Re: getting execute permission at file creation time

hi,

It seems he's right. There was no way I could make an executable file from creation. I tried all the numbers but to no avail.
Tape Drives RULE!!!
Paula J Frazer-Campbell
Honored Contributor

Re: getting execute permission at file creation time

Hi Sharon

After a failed install try making this script that fails r-xr-xr-x (555) and then re run the install.

It might error out on creating this script but it may not and therefore the script will already have execute permission.

If this works you may have to do the same on proceeding scripts but the install should then work.

Just an idea.

Paula
If you can spell SysAdmin then you is one - anon
James R. Ferguson
Acclaimed Contributor

Re: getting execute permission at file creation time

Hi Sharon:

Unfortunately, this isn't possible.

Have a look at Bill Hassell's comments (from a historical perspective) in this thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x25f9a12d6d27d5118fef0090279cd0f9,00.html

...JRF...
linuxfan
Honored Contributor

Re: getting execute permission at file creation time

Hi Sharon,

The only way this is possible is by creating/touching the file and then changing the permissions using chmod.

-Ramesh
They think they know but don't. At least I know I don't know - Socrates

Re: getting execute permission at file creation time

Hi Sharon,
If I you simaultaneously to create the file and give the 755 permission then use as
$ vi file1 && chmod 755 file1

With this you can input the file and once you save the file will get 755 permisssion.

Thanks
Zafar
Win/Win
Sharon Prothero
Frequent Advisor

Re: getting execute permission at file creation time

Thank you all for taking the time & trouble to reply. I guess you've all confirmed what I already knew - HP-UX just won't do what I want !! ( And some one needs to tell the Oracle Corporation how it all works too ;-) )