I need a cross-platform solution for multi-thread to write to a same file concurrently, at least Windows and Mac OS X. Different thread write to different file region.
The file is a little large. May be several GB or several hundred MB. So MMF doesn’t fit right.
QFile is a cross-platform overlap. I have searched the QFile document, there isn’t a share write option.
Under Windows, this can be done by CreateFile using FILE_SHARE_WRITE option. What about Mac OS X?
Does Qt support this or I should do my own encapsulation? How to do this under Mac OS X?
You could use
QFilewith aQReadWriteLock(documentation).