Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Querying Stata on what kind of machine it is running

From   Ulrich Kohler <>
Subject   Re: st: Querying Stata on what kind of machine it is running
Date   Mon, 28 Aug 2006 13:40:28 +0200

For example:

. di "$S_OS"

You might also restrict yourself on relative path names and use forward 
slashes as separator for directory names. Forward slashes works under all 

In addition, -fastcd- from SSC might be helpful.


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
> *
> *   For searches and help try:
> *
> *
> *

+49 (030) 25491-361

*   For searches and help try:

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