Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-17-2008, 06:43 AM   #1
Registered: Feb 2006
Posts: 51

Rep: Reputation: 15
How to restrict simultaneous multiple access to a common file

I need to run 10 fuctions in the background simultaneously. Each function will need to write its output several times to a common output file. How can i restrict the access so that only one functions may access and write to the file at a time (i.e. all the functions do not write to the common output file simultaneously). Also i need to run another function when all the previous 10 functions completes their jobs. How do i know whether the previous functions have completed their jobs? Please help. Thanks.
Old 06-17-2008, 07:25 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,945
Blog Entries: 14

Rep: Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163
Have a look at "flock" (File lock). There are man pages for it on Linux.
Old 06-17-2008, 12:13 PM   #3
Registered: Feb 2006
Posts: 51

Original Poster
Rep: Reputation: 15
confused with flock... is there any easy solution?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Restrict ALL access to file from web blizunt7 Linux - Security 2 08-15-2007 02:08 PM
Multiple, simultaneous network interfaces indienick Linux - Networking 4 07-31-2006 10:33 AM
Postfix file locking stops simultaneous user access david.skinner Linux - Software 0 12-21-2005 01:40 PM
multiple simultaneous logins phonecian Linux - Newbie 6 06-05-2005 09:40 AM
restrict file access loocw General 0 03-07-2001 12:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration