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

Re: Re: st: how to avoid absolute path names in do-files?


From   Ernest Berkhout <[email protected]>
To   [email protected]
Subject   Re: Re: st: how to avoid absolute path names in do-files?
Date   Tue, 22 Mar 2005 14:20:40 +0100

At 14:12 22/03/2005, you wrote:

Thanks for this. It would indeed be the solution if I could be sure that
the directory structure would stay the same. But I cannot overlook what
data I am going to have in 3 months from now. It might be that what is
in "D:\projectdir\dir1" is moved to "D:\projectdir\anotherdir\dir1", for
example. In such a case I don't want to change all instances of ../dir1/
in all my do-files.
OK, so you are not the one who decides on the directory structure? Then i can only suggest you take Benoit's advice and work with local macro on top of your do-files. Even then you can use relative paths, like:

local basedir "../projectdir"
local onedir "../projectdir/onedir"
etc.

Remember to use the forwardslash in directorynames, because the backslash can cause problems as in Stata programming it has another meaning as well!



Ernest Berkhout
SEO Amsterdam Economics
University of Amsterdam
******************************************************
Room 3.08
Roetersstraat 29
1018 WB Amsterdam
The Netherlands

tel.:+ 31 20 525 1657
fax:+ 31 20 525 1686
http://www.seo.nl
===========================
A statistician: someone who insists
on being certain about uncertainty
===========================
*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index