I am new in linux. I have written a program to read and write into file. I have created same two programs, which can simultaneously access same file. How can i ensure that only single program can access the file at a time.when other program try to access the file, then i should show that file is already used and wait until it is not released.
Can i anybody tell the solution to problem.