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

Home » Public Forums » archive » How to get file UNIT from file NAME?
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
How to get file UNIT from file NAME? [message #58885] Tue, 26 February 2008 10:27 Go to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

Is it possible to get a file UNIT from a file NAME? For example, in Fortran95 you can do,

INQUIRE( FILE=Filename, NUMBER=FileID )

i.e. supplying a Filename yields its associated unit number, FileID (which is -1 if no
unit is connected to the file)

Is there an equivalent IDL command? FSTAT requires one to supply a UNIT argument, which is
opposite of what I need, i.e. similar to the f95

INQUIRE( UNIT=FileID, NAME=Filename )

Basically I want to be able to derive all the necessary info about the file, in particular
answering the "Is it open? If so, what unit number?" questions just from the filename.

Any info appreciated.

cheers,

paulv
Re: How to get file UNIT from file NAME? [message #58940 is a reply to message #58885] Wed, 27 February 2008 13:14 Go to previous message
Mark[1] is currently offline  Mark[1]
Messages: 66
Registered: February 2008
Member
Be aware that it's possible for a file to be associated with more than
one unit number (though why one would do that I have no idea).
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: itools vertical colorbar bug
Next Topic: Inverse Map Projection Help

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

Current Time: Wed Oct 08 19:58:20 PDT 2025

Total time taken to generate the page: 0.00490 seconds