Statalist The Stata Listserver

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

Re: st: using pwd in an if statement

From   "Christopher W. Ryan" <>
Subject   Re: st: using pwd in an if statement
Date   Tue, 16 May 2006 16:38:04 -0400

Thank you, Nick and Nick, for the advice.

I installed the -fastcd- package, and it works nicely.

So if I want to keep everything related to one project (command log, output log, data) in that project's directory, then my choices seem to be:

1. always use full path names
2. always -cd- to the proper directory at the beginning of a Stata session (or the beginning of a do-file), using full path name or the -fastce- package, and then can use relative (short) file names.

Do I have that right?

Christopher W. Ryan, MD
SUNY Upstate Medical University Clinical Campus at Binghamton
and Wilson Family Practice Residency, Johnson City, NY
GnuPG and PGP public keys available at

"If you want to build a ship, don't drum up the men to gather wood, divide the work and give orders. Instead, teach them to yearn for the vast and endless sea." [Antoine de St. Exupery]

Nick Winter wrote:

The package -fastcd- on SSC has a utility called -c- designed for just this sort of issue. It allows you to set up a set of associations between directory and mnemonics-- such as "hannah" for "C:\data\scholar\Hannah", and so on. Then you can type "c hannah" and you will be switched to that directory.

The package name is fastcd; once you install the package, note that you have to type

. help fastcd

for help. The command, howver, is "c". This is a side effect of me naming the command a single letter--something Stata advises against. Stata has subsequently taken back "help c" to point to help on the c() macros.

--Nick Winter
*   For searches and help try:

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