Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 13975
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: Sat Apr 27 06:18:18 CEST 2024

Total time taken to generate the page: 0.03084 seconds