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

Home » Public Forums » archive » Re: open and read a file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: open and read a file [message #45861] Mon, 10 October 2005 16:09 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ChiChiRuiz@gmail.com writes:

> Hi there, I know this is a very easy task to do, but for some reason I
> can't get it to work. I have a .img file into the IDL code folder
> (where I save all the source code), then I run the following lines:
>
> openr, 1, filepath('filename.img')
> image = fltarr(xsize, ysize, zsize)
> readu, 1, image
> close, 1
>
> but I keep getting error message that the system cannot find the file
> specified.
> I thought as long as the .img file is located in the source code
> folder, i don't need to list the full address. What did I do wrong?

You forgot to use PROGRAMROOTDIR. :-)

OpenR, lun, Filepath(Root_Dir=ProgramRootDir(), 'filename.img'), /Get

You can find it here:

http://www.dfanning.com/programs/programrootdir.pro

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: How to display live Video in IDL
Next Topic: Asynchronous reading

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

Current Time: Sat Oct 11 01:30:18 PDT 2025

Total time taken to generate the page: 2.64143 seconds