Re: file directory [message #26462 is a reply to message #26456] |
Thu, 23 August 2001 13:18   |
Steve Hartmann
Messages: 21 Registered: March 2000
|
Junior Member |
|
|
> Harry Kao (yen@dolphin.upenn.edu) writes:
>>
>> I used widget programming to open files for processing and then save the
>> processed files. The problem is IDL puts me in a default directoy every
>> time I want to open or save files. How do I set up IDL so that I can
>> automatically return to the directory from where I performed last I/O?
>
> Ditch the Mac. :-)
>
> If you *have* ditched the Mac, and you are working
> on a PC, someone is having fun with you. (I'd suspect
> your office mate.) Find the General tab on the
> File->Preferences menu and de-select the Change
> Directory on Open checkbox.
>
> If you are running on Unix, something is very, very
> weird.
>
> Best Regards,
>
> David
>
> P.S. Let's just say you could always learn the nuances
> of the CD command and its keywords, if worst comes to worst.
Why not just force Dialog_PickFile to do what you want?
Something like this:
------------------------------------------------------------ --------------
;initial directory (optional)
CurrentPath = 'D:\myfiles'
;open a file
filename = Dialog_Pickfile(Path=CurrentPath , $
Get_Path=CurrentPath , /Read)
;process the file here
;save the file
filename = Dialog_Pickfile(Path=CurrentPath , $
Get_Path=CurrentPath , /Write)
------------------------------------------------------------ ----------------
Now every time you open or save a new file, the directory chosen from
the last I/O will be used. This should be platform independent as
well. At least it has been for me on both Unix and Windows.
-Steve
|
|
|