LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
LinkBack Search this Thread
Old 07-07-2010, 11:19 AM   #1
Samrat_Chakravarty
LQ Newbie
 
Registered: Jul 2010
Posts: 1

Rep: Reputation: 0
Linux File Locking Mechanism


Hi Folks,

I have a situation where the one process 1 is writing files on Linux server and process 2 is polling for newly created files and reads them , making a copy and passes to another process.

Now, I want to know that is it possible that process 2 can read a file before the process 1 completely write it. Is there any kind of automatic kinda locking mechanism in Linux which stops process 2 to read the file before process 1 completely write it.

Any kind of help will be appreciable.

Thanks,
Samrat.
 
Old 07-07-2010, 12:50 PM   #2
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Named pipes/FIFOs might be one option. For a quick introduction, see for example this page on Linux Journal. The idea is that one program writes to a special place and the other one reads when it finds information there.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VPATH mechanism in make file sonu kumar Linux - Newbie 1 01-11-2010 11:42 AM
Is there any locking mechanism in linux scriptblues Linux - Newbie 7 06-12-2009 05:57 AM
Linux Traditional File Access Mechanism dolphine Linux - General 2 09-27-2006 02:43 PM
file locking in linux? sunpascal Linux - Newbie 8 03-15-2006 08:00 PM
File locking in Linux xailer Programming 5 12-29-2003 02:00 PM


All times are GMT -5. The time now is 02:32 PM.

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