Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Unix file mode


From   "Neil Shephard" <mdeasnds@fs1.ser.man.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Unix file mode
Date   Tue, 03 May 2005 11:31:54 +0100

> I am using Stata8 on a Unix machine. 
> 
> I wonder if it is possible, when a do-file saves some data, to set the
> file mode, i.e. the permissions whether the file is for instance read
> only?
> 
> Is there any trick within Stata or do I have to do this manually
> within my Unix. 
> 
> Thanks for all suggestions  in advance. 

You can make a call to the shell from within the do-file to do whatever you want.

Assuming you are saving a file called test.dta, then after its been saved you can change 
permissions to it by....

save test, replace
!chmod 0644 test.dta

* Or change ownership...

!chown users:users

* Or if you wanted to save space...

!bzip2 test.dta

HTH's,

Neil

Neil Shephard
Genetics Statistician
ARC Epidemiology Unit, University of Manchester
neil.shephard@man.ac.uk
nshephard@gmail.com

"If your result needs a statistician then you should design a better experiment" - 
Ernest Rutherford

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index