Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.6.1, 4.6.2, 4.6.3, 4.7.0
-
None
-
windows and linux
Description
QFile::size() and QFile::map() does not do flush() before operation
Suppose this scenario:
1. open file for write|append
2. write something to the file
3. call ->getsize() to get size (we need this for map())
4. call ->map()
if flush() does not issued this error will be printed: "mapping beyond file size is not portable" or something else.
SO:
1. size() function should have argument (bool what_to_return=default_value)
what_to_return switchs between "size when file will be flushed" and "current file size on file system."
2. if map() uses area beyond file size on file system, flush should be issued. at least, QT should write (not sync()! only write syscall) file data needed for mmap().
for quick and dirty implementation, just call flush() before any of this opertaions.