Web Hosting Talk







View Full Version : Linux Server Opened Files Question


Tertsi
08-08-2007, 06:01 AM
What happens on CentOS 4.4 when a file is being written to with the handle open
and before the writing has finished another script tries to read the file?

Will that attempt to read fail or will it wait until writing has finished or what?

What about if a file is being read and another script tries to write to that file before reading has finished?

Multiple users will use these scripts concurrently and I can't have reading nor writing attempts fail so I must know if I need to add special code because of this.

Azavia
08-08-2007, 08:10 AM
You need to check into file locking to use for those scripts writing to the file.