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

Home » Public Forums » archive » Re: How to get file UNIT from file NAME?
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: How to get file UNIT from file NAME? [message #58884 is a reply to message #58883] Tue, 26 February 2008 10:52 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Tue, 26 Feb 2008, Paul van Delst wrote:

> 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
>

You can use HELP, /FILES, OUTPUT=OUT and parse OUT.

regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Images with coordinate axes, log scale etc.
Next Topic: Code for selecting a study from a dicomdir

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

Current Time: Sun Oct 12 06:04:49 PDT 2025

Total time taken to generate the page: 1.36469 seconds