Matthew Clifford <[email protected]>:
Why not just use relative paths, and have folks run the do-file in the
relevant starting directory? You can see the current directory like
so:
di c(pwd)
Also, you might use / as your dirsep--see -help creturn-:
c(dirsep) returns a string containing "/".
Note that, for Windows operating systems, a forward slash (/) is
returned rather than a backslash (\). Stata for Windows understands
both, but in programs, using a forward slash is recommended because a
backslash can interfere with Stata's interpretation of macro-expansion
characters. Do not be concerned if the result of your code is a mix
of backslash and forward-slash characters, such as \a\b/myfile.dta;
Stata will understand it just as it would understand /a/b/myfile.dta
or \a\b\myfile.dta.
On 9/6/07, Matthew Clifford <[email protected]> wrote:
> I am trying to find a way to have Stata automatically recognize the path
> from which a .do file is run.
*
* 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/