|
Re: writing to a specific directory [message #41296 is a reply to message #41101] |
Fri, 01 October 2004 22:34  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
IDLmastertobe writes:
> My question is how can I write a file to a directory chosen by a user?
file = Dialog_Pickfile(/Write, File='suggestedFilename.txt')
IF file EQ "" THEN RETURN
OpenW, lun, file, /Get_Lun
... etc.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
|
|
|
Re: writing to a specific directory [message #41297 is a reply to message #41101] |
Fri, 01 October 2004 17:03  |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
IDLmastertobe wrote:
> Yes, but I think this only applies openr and not openw. I'm just not sure
> as to how to write to a directory with respect to using openw.
>
dialog_pickfile does nothing else than returning a string which contains
a filename, including the path. That string can then be passed as an
argument to openr, openw and any other function / procedure which does
something with a file.
Anyway, you don't write to a directory, you write to a file. And to
specify the file in IDL, you use a text string. The text string can
include an absolute path, or a path relative to the current working
directory (which you can find out by doing
IDL> cd, current=current_dir & print, current_dir
).
Benjamin
|
|
|