Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retaining Permissions During File Save

Status
Not open for further replies.

jmarkus

Technical User
Oct 15, 2002
124
CA
Hello,

My default permissions are 664. This allows other people in my group to work on and save files which I work on. I have one file, however, that needs to be soley under my control. That is, I want the permissions to be 644. Unfortunately, when I save that file, the permissions revert back to my default permission.

Is there any way I can set the permissions of this file so that even after saving it from an application, the desired permissions stay intact?

Thanks,
Jeff
 
My default permissions are 664
??? was ist das (german version of: what is this)
if you are speaking about umask, do it !!
Unfortunately, when I save that file
how do you do it ??

:) guggach
 
664 is -rw-rw-r--

Yes, I am talking about umask (when referring to default permissions), but I don't want to change for all files, I only want to protect 1 file.

Jeff
 
umask is not the problem in this case
Code:
User Commands                                            umask(1)

NAME
     umask - get or set the file mode [b]creation[/b] mask

what editor do you use to edit this file? does it just write and close? You can debug this by using truss

eg. truss -o /tmp/mytrussfile.out editor filename

next just close the file and look at the /tmp/mytrussfile.out...

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
I'm not suggesting umask is the problem. I am simply looking for a way to protect a file so that it doesn't revert to the default permissions after saving.

This is not a text file. It is a data file from an Engineering Design application (CAD).

Thanks,
Jeff
 
I think it's an application fault; if you open a file eg. in vi it does not change access rights.
You can write a workaround: chmod filename with cron ;-)

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top