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

Home » Public Forums » archive » check if other routine is accessing a text 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: check if other routine is accessing a text file [message #88223 is a reply to message #88222] Sun, 30 March 2014 19:42 Go to previous messageGo to previous message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Sunday, March 30, 2014 7:26:54 PM UTC-6, hoiti...@gmail.com wrote:
> Hi,
>
>
>
> I'm trying to read/write (openw,openu,openr) the same text file using multiple IDL prompts. The different prompts usually read/write the file at different time, but there is a tiny chance that they read/write at the same time. Is there any keywords or routines that can test if other program is using the file?
>
>
>
> Ideally, I'd like to do something like this:
>
>
>
> test_if_someone_writing?
>
> yes: wait for 3 seconds and try again
>
> no: go ahead and read/write
>
>
>
> Thanks!

There is nothing in IDL's file I/O library that will do this directly. You might consider using a semaphore around your openw and openr statements. See the docs for SEM_CREATE, SEM_LOCK, SEM_RELEASE, and SEM_DELETE. They're intended primarily to prevent conflicts and collisions on system resources, disk files included.

Jim P.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: check if other routine is writing a text file
Next Topic: stregex fails to match underscore

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

Current Time: Thu Oct 09 21:56:34 PDT 2025

Total time taken to generate the page: 1.19847 seconds