Re: How to set the default working directory? [message #66030 is a reply to message #66028] |
Tue, 14 April 2009 05:43   |
David Gell
Messages: 29 Registered: January 2009
|
Junior Member |
|
|
On Apr 14, 12:08 am, rainingpe...@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.
>
> Sincerely,
> Li, Tongmu
The !path and path preference are only used in finding the files
containing IDL functions and procedures. It doesn't have any effect on
searches for other types of files. You can use the CD procedure to set
the current working directory. A more general solution, that limits
typing, is to use the DIALOG_PICKFILE function to display a file
chooser. You can use this function to select a file, then save the
directory path for the default in future calls.
|
|
|