For example:
. di "$S_OS"
Unix
You might also restrict yourself on relative path names and use forward
slashes as separator for directory names. Forward slashes works under all
OSs.
In addition, -fastcd- from SSC might be helpful.
regards
ULi
Marco Petracco Giudici wrote:
> Hello everybody,
>
> I have been searching the manual and the net for a while, but could not
> find an answer to what should be an "easy" question. I have a Mac laptop
> and a Windows desktop, both of them with stata installed. I am writing
> .do files and would like to make them send their output to a certain
> directory/folder using the "cd" "use" and "save" commands.
> However the syntax of the "cd" and other commands is different in Stata
> for Mac and Stata for Windows (the way of specifying the path is
> different under the two OSs)
> The question then is: is there a way of querying on what machine stata
> is running in order to execute the command with the appropriate syntax?
> In other words, I would like to write a bit of code to do something like
>
> " Discover on which machine stata is running "
> " if running on a Mac execute cd command with mac syntax "
> " else if running on a winxp machine execute cd command with winxp syntax "
>
> grateful for any help,
>
> best regards,
>
> Marco
> --
> Marco Petracco Giudici
> PhD program in Economics and Organization
> University of Venice
>
>
> ___________________________________________________________
> Try the all-new Yahoo! Mail. "The New Version is radically easier to use" �
> The Wall Street Journal http://uk.docs.yahoo.com/nowyoucan.html
> *
> * 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/
--
[email protected]
+49 (030) 25491-361
*
* 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/