Statalist The Stata Listserver


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

st: RE: RE: RE: Quick Saving


From   "Alex Ogan" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: Quick Saving
Date   Mon, 15 May 2006 17:24:44 -0400

Do you want the working directory, or the directory you opened the file
from?  These are not the same thing.

The pwd command (and the c(pwd) macro) do give you the current working
directory:

. clear

. cd c:\
c:\

. display "`c(pwd)'"
c:

. pwd
c:\

. cd d:
D:\

. display "`c(pwd)'"
D:

. pwd
D:\


But maybe what you want is the path from `c(filename)'?

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nuno Soares
Sent: Monday, May 15, 2006 5:20 PM
To: [email protected]
Subject: st: RE: RE: Quick Saving

Hi Alex,

I believe pwd only gives the default working directory, not the actual
working directory. For instance, if you open a file from
"c:\data\tempdata"
pwd gives you "c:\data" (if this is your default directory. What I need
is a
command that retrieves the "c:\data\tempdata".
Thanks,

Nuno

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Alex Ogan
Sent: 15 May 2006 22:13
To: [email protected]
Subject: st: RE: Quick Saving

Is `c(pwd)' what you want?

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nuno Soares
Sent: Monday, May 15, 2006 5:03 PM
To: [email protected]
Subject: st: Quick Saving
Importance: High

Hi Statalisters,

I was wondering if anyone  knows of a procedure that allows the user to
save
the current dataset in the current working directory without typing the
all
path, just the filename.
If we don't specify the path, the -save- command saves the file in the
default data directory. If we want to save in the current working
directory
(different from the default directory) I believe we have to write the
complete path (which is extremely boring if we want to quick save
several
versions of the file after ).
I've been trying to write a ado file that enables to do just that, but I
don't know if Stata has a command that retrieves the current directory.
The objective is to write a command like this: qksave filename.
Can anyone help?

Best,

Nuno

*
*   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/


This message is intended solely for the designated recipient(s). It may
contain confidential or proprietary information and may be subject to
confidentiality protections. If you are not a designated recipient, you
may
not review, copy, or distribute this message. If you receive this in
error,
please notify the sender by reply e-mail and delete this message. 

Arrowstreet Capital, L.P. is an Equal Opportunity Employer. 



*
*   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/

*
*   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/


This message is intended solely for the designated recipient(s). It may contain confidential or proprietary information and may be subject to confidentiality protections. If you are not a designated recipient, you may not review, copy, or distribute this message. If you receive this in error, please notify the sender by reply e-mail and delete this message. 

Arrowstreet Capital, L.P. is an Equal Opportunity Employer. 



*
*   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