Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > file read/write synchronization: advice needed

Reply
Thread Tools

file read/write synchronization: advice needed

 
 
Junpei
Guest
Posts: n/a
 
      05-29-2004
problem: I have a program A that writes (overwrite) to a file 5
times/second (the results of a realtime calculation); i want several
other programs B through E to occasionally read that file to see what
the current results are (I only need the current results). how do i
keep the programs B to E from trying to read while program A is
writing? or is there a better solution than writing to a file? hoping
for an easy solution... i'm on linux.
thanks in advance,
Junpei
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      05-29-2004

Quoth http://www.velocityreviews.com/forums/(E-Mail Removed) (Junpei):
> problem: I have a program A that writes (overwrite) to a file 5
> times/second (the results of a realtime calculation); i want several
> other programs B through E to occasionally read that file to see what
> the current results are (I only need the current results). how do i
> keep the programs B to E from trying to read while program A is
> writing? or is there a better solution than writing to a file? hoping
> for an easy solution... i'm on linux.


perldoc -f flock

Ben

--
I've seen things you people wouldn't believe: attack ships on fire off
the shoulder of Orion; I watched C-beams glitter in the dark near the
Tannhauser Gate. All these moments will be lost, in time, like tears in rain.
Time to die. (E-Mail Removed)
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      05-29-2004
Ben Morrow <(E-Mail Removed)> wrote:
>
> Quoth (E-Mail Removed) (Junpei):
>> problem: I have a program A that writes (overwrite) to a file 5
>> times/second (the results of a realtime calculation); i want several
>> other programs B through E to occasionally read that file to see what
>> the current results are (I only need the current results). how do i
>> keep the programs B to E from trying to read while program A is
>> writing? or is there a better solution than writing to a file? hoping
>> for an easy solution... i'm on linux.

>
> perldoc -f flock



See also:

perldoc -q "\block"


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Needed: Advice on Film Scanning, Or Website Which Has This Advice Larry R Harrison Jr Digital Photography 0 09-06-2003 01:00 AM
Re: Celebrity advice (was: Advice to a Junior in High School?) Peter Hansen Python 23 09-05-2003 03:11 PM
OT: Celebrity advice (was: Advice to a Junior in High School?) Gerrit Holl Python 16 08-29-2003 06:10 AM
Re: Celebrity advice (was: Advice to a Junior in High School?) Asun Friere Python 0 08-28-2003 12:50 AM
Re: Celebrity advice (was: Advice to a Junior in High School?) Asun Friere Python 1 08-27-2003 12:01 PM



Advertisments