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

Home » Public Forums » archive » file in use by another program
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
file in use by another program [message #88097] Wed, 19 March 2014 19:11 Go to next message
wallabadah is currently offline  wallabadah
Messages: 28
Registered: November 2005
Junior Member
Hi All,

I have an IDL program that needs to read a csv file of data generated elsewhere on the network. Until recently the file was generated after the data collection was complete, but now the file is generated on the fly over several minutes. My IDL program is having a hard time with this! It's now loading the data file before it's complete, and sometimes before it contains any data at all.

I'd like to know if there's an IDL way of determining if file is still open and in use by another program. I've looked at file_test(), but none of the available flags provide this information.

any suggestions would be appreciated,

Will.
Re: file in use by another program [message #88098 is a reply to message #88097] Wed, 19 March 2014 22:03 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Wednesday, March 19, 2014 10:11:40 PM UTC-4, wallabadah wrote:
> Hi All,
>
>
>
> I have an IDL program that needs to read a csv file of data generated elsewhere on the network. Until recently the file was generated after the data collection was complete, but now the file is generated on the fly over several minutes. My IDL program is having a hard time with this! It's now loading the data file before it's complete, and sometimes before it contains any data at all.
>
>
>
> I'd like to know if there's an IDL way of determining if file is still open and in use by another program. I've looked at file_test(), but none of the available flags provide this information.
>
>
>
> any suggestions would be appreciated,

Use two files. One file contains the data. The other file is only created after the first file is complete. Then by monitoring the signal file, your IDL code will know when it's safe to read the data file.
Re: file in use by another program [message #88100 is a reply to message #88097] Thu, 20 March 2014 02:38 Go to previous messageGo to next message
Rob Klooster is currently offline  Rob Klooster
Messages: 18
Registered: February 2013
Junior Member
This is usually done in other languages by trying to move the file to itself. This gives an IO error when the file is in use. The IDL file_move routine is useless for this however (it will either always succeed or always fail, depending on the ALLOW_SAME keyword). But maybe you can spawn a move/mv process and return its error code. It will be platform dependent though...

Rob.
Re: file in use by another program [message #88137 is a reply to message #88098] Sun, 23 March 2014 15:36 Go to previous message
ccfsgau is currently offline  ccfsgau
Messages: 1
Registered: March 2014
Junior Member
> Use two files. One file contains the data. The other file is only created after the first file is complete. Then by monitoring the signal file, your IDL code will know when it's safe to read the data file.

The file is created by a non-IDL program I don't have access to. Interestingly, if I open the file in Excel, it tells me that the file is in use by another program... so there must be some sort of file-system flag. If only IDL could detect it...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to choose the pixels along a curve in an image
Next Topic: How to output two images on the widget

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

Current Time: Wed Oct 08 09:15:11 PDT 2025

Total time taken to generate the page: 0.00519 seconds