How to set the default working directory? [message #66038] |
Mon, 13 April 2009 22:08  |
rainingpeace
Messages: 1 Registered: April 2009
|
Junior Member |
|
|
Hi all,
I am trying to use IDL to read and write CDF files. Now I am suffering
a problem. I am trying to set my default working directory to "D:
\IDLWorkspace\". And I set "Reference->IDL->Path" and add the "D:
\IDLWorkspace" to the list and move it to the top. But it does not
work.
The reason why I want to set this directory is that otherwise every
time I am trying to read a file, I have to write the full path. By
setting a default working directory, I can just use
id=cdf_open('ge_edb3sec_mgf_20000125_v01.cdf')
instead of
id=cdf_open('C:\ge_edb3sec_mgf_20000125_v01.cdf'). I believe such a
small aim is achievable in such a powerful software like IDL. It is
just that I do not know how to do that.
This is just a simple example. My directory is much longer.
So as mentioned, I failed at setting the working directory. I hope
some one could help me.
Thanks in advance.
Sincerely,
Li, Tongmu
|
|
|
Re: How to set the default working directory? [message #66160 is a reply to message #66038] |
Wed, 15 April 2009 09:38  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
<rainingpeace@gmail.com> wrote:
> Hi all,
>
> I am trying to use IDL to read and write CDF files. Now I am suffering
> a problem. I am trying to set my default working directory to "D:
> \IDLWorkspace\". And I set "Reference->IDL->Path" and add the "D:
> \IDLWorkspace" to the list and move it to the top. But it does not
> work.
> The reason why I want to set this directory is that otherwise every
> time I am trying to read a file, I have to write the full path. By
> setting a default working directory, I can just use
> id=cdf_open('ge_edb3sec_mgf_20000125_v01.cdf')
> instead of
> id=cdf_open('C:\ge_edb3sec_mgf_20000125_v01.cdf'). I believe such a
> small aim is achievable in such a powerful software like IDL. It is
> just that I do not know how to do that.
> This is just a simple example. My directory is much longer.
> So as mentioned, I failed at setting the working directory. I hope
> some one could help me.
> Thanks in advance.
Check out FILE_WHICH. By default, it will check for files in !path.
Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
|
|
|