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 #45863 is a reply to message #45861] Mon, 10 October 2005 14:35 Go to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
The file needs to be relative to your working directory in order for
this to work. Even if you have your file in the same directory as the
the source code, paths are resolved according to your working directory.

You can see your current working directory with
IDL> cd, CURRENT=current
IDL> print, current

It is this directory that's being added to the front of the filename.
For example, if the current directory were "/my/current/directory", the
file that you're attempting to open is actually
"/my/current/directory/filename.img" and probably not what you want.

HTH,

-Mike


ChiChiRuiz@gmail.com wrote:
> 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?
>
[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: Sun Oct 12 04:51:20 PDT 2025

Total time taken to generate the page: 0.08547 seconds