Dear statalisters!
I have a question on how to organise my Stata files in such a way that I
can change the directory structure, or copy everything to a new place,
while double-clicking a do-file to run it still works. I am under
Windows XP, Stata 8.2.
Suppose a do-file in directory project dir\analysis\analysis1 contains
the lines
capture log close
log using "D:\project dir\analysis\analysis1\analysis1X.log", replace
use "D:\project dir\data\data3\somedata.dta"
Now I want to be as flexible as possible and avoid absolute path names
at all. Since I have so many do-files (around 70), I am looking for a
solution where the path info is stored only in one place, and I use
references to this in my do-files, so that the above becomes
log using "<analysis path>\analysis1\analysis1X.log", replace
use "<data path>\data3\somedata.dta"
Do you really want to have absolute paths at all? If you are able to use
only relative pathnames, there is no problem anymore. That means, if you're
only using the directories 'project dir' and below, you can copy the whole
directory tree without having to chance anything in your do-file.