U++ framework
Do not panic. Ask here before giving up.

Home » Community » U++ community news and announcements » FileStream locking issues
FileStream locking issues [message #35589] Fri, 02 March 2012 14:04 Go to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
While working on problem with ide configuration file curruption (still unresolved), I have noticed that if two instances of same application do SaveFile at the same time, file can get corrupted.

Means there should be some sort of locking so that if some file is open with FileOut or FileAppend, next opening of the same file fails.

There already were some sharing flags, but they worked only in Win32 and IMO were never used.

Resolving situation: FileStream now supports NOWRITESHARE flag in Linux too (using flock system call), other sharing flags are deprecated (I think that for more complex situation, you cannot use FileStream anyway).

FileOut and FileAppend now specify NOWRITESHARE flag. Means second concurent try to FileOut the same file is gonna fail (file does not open).

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: svn mirror moved - and moved back
Next Topic: Stream public interface cleanup
Goto Forum:
  


Current Time: Mon Sep 14 09:31:22 GMT+2 2026

Total time taken to generate the page: 0.00491 seconds