That being the case I don't see why you need a programmatic solution when a scripted one will do just fine.
Use a shell to script this process and run fuser on the file periodically to see if ftp is...
Type: Posts; User: itCbitC
That being the case I don't see why you need a programmatic solution when a scripted one will do just fine.
Use a shell to script this process and run fuser on the file periodically to see if ftp is...
This isn't the first time fcntl() has me stumped but I didn't realize it would be going "against-the-grain" so much. The code I have contradicts everything in the man pages. I duplicated your test...
Request for exclusive lock will fail if file descriptor is not opened with write access.
Instead of trying to get info about a lock on the file try to set a lock on it.
The return value of fcntl()...
Post the code snippet that calls fcntl(); P2 needs to open "out2.txt" for writing in exclusive mode and methinks you are trying to get a shared lock instead.