Re: append data / locks



On Jun 12, 6:28 am, slin...@xxxxxxxxx wrote:
Hello,

I have several scripts that are using the redirection operator >> to
append data to a masterfile.

I now want to ensure that the masterfile is only opened by one script
at a time.
I assume I can solve this somehow by locks - but then I would need to
check if the file is not already open and set a lock at the same time.
Is there a way to do this?
or any other ideas?

Thanks,
Sven

Check out this link, it provides a couple of unsafe (i.e. potential
race conditions) solutions and a more complex solution which the
author believes is safe.

http://www.unixreview.com/documents/s=9040/ur0402g/


.



Relevant Pages

  • Re: append data / locks
    ... I have several scripts that are using the redirection operator>> to ... append data to a masterfile. ... I now want to ensure that the masterfile is only opened by one script ... I assume I can solve this somehow by locks - but then I would need to ...
    (comp.unix.shell)
  • append data / locks
    ... I have several scripts that are using the redirection operator>> to ... append data to a masterfile. ... I now want to ensure that the masterfile is only opened by one script ... I assume I can solve this somehow by locks - but then I would need to ...
    (comp.unix.shell)
  • Re: tracking down lock ups in fedora
    ... When you say it locks up - is this at the console, ... loosing the network? ... I took your advise on the cron job. ... I started running all the scripts and found ...
    (comp.os.linux)
  • Re: ActiveX and Outlook Express
    ... > my setting will not allow activex scripts. ... > locks up my computer. ... MSOE to allow running viruses. ... and no scripts at all should be allowed in email. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)