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

Home » Public Forums » archive » Re: fstat, file_info and file_test
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: fstat, file_info and file_test [message #35086 is a reply to message #35084] Wed, 14 May 2003 09:56 Go to previous messageGo to previous message
Bruce Bowler is currently offline  Bruce Bowler
Messages: 128
Registered: September 1998
Senior Member
> I see that in the now distant past, my question has been asked here
> before, but the answers were pre-IDL 5.4 when FILE_xxxxx routines appeared.
>
> I would like to have a test that reports if the file is open - by simply
> providing the filename. FSTAT almost does it, but I have to associate
> the file with a LUN first. FILE_INFO and FILE_TEST each take the
> filename as an argument (instead of the lun that FSTAT requires), but
> neither test for 'openess'.
>
> What I would like to have is a function similar to:
>
> result = FILE_ISOPEN(filename)
>
> that returns a 1 (for open) or a 0 (for closed). Or, perhaps better in
> the long run, I'd like to see an /ISOPEN keyword added to FILE_TEST.

Ask the OS. On *nix and OS/X (but not windows, hence not xplatform)
there's a utility called lsof (list open files) which can tell you not
only if a file is open, but who's got it open, in case it's opened by
someone other than yourself...

--
+-------------------+--------------------------------------- ------------+
Bruce Bowler | Normally that's the way we do it, except when we
1.207.633.9600 | don't. - Jo Ellen Eros
bbowler@bigelow.org |
+-------------------+--------------------------------------- ------------+
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: replace array's elemets
Next Topic: new object from a save/restore doesn't execute init function

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

Current Time: Fri Oct 10 03:45:06 PDT 2025

Total time taken to generate the page: 0.47871 seconds