comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » writing to a specific directory
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
writing to a specific directory [message #41101] Fri, 01 October 2004 15:05 Go to next message
IDLmastertobe is currently offline  IDLmastertobe
Messages: 54
Registered: June 2004
Member
My question is how can I write a file to a directory chosen by a user?
Re: writing to a specific directory [message #41296 is a reply to message #41101] Fri, 01 October 2004 22:34 Go to previous message
David Fanning is currently offline  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 Go to previous message
Benjamin Hornberger is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: writing to a specific directory
Next Topic: Re: Starting the virtual machine

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:54:43 PDT 2025

Total time taken to generate the page: 0.00631 seconds