Fix QFile::isSequential on Windows
commitf808fe435dc00398775fe8040d3c811aed6332a9
authorJoão Abecasis <joao@abecasis.name>
Fri, 23 Oct 2009 11:44:23 +0000 (23 13:44 +0200)
committerJoão Abecasis <joao@abecasis.name>
Fri, 23 Oct 2009 13:06:37 +0000 (23 15:06 +0200)
tree1d4dfcea0af1f422952407ae5221d88d4573ecca
parentb402b8c4216ebb2d7db1e7e6cd33a45d1af422e9
Fix QFile::isSequential on Windows

When not using native HANDLEs, the return of isSequential was hardcoded
to true for files with a fd, and for the standard FILE* streams stdin,
stdout and stderr; false for all other FILE* streams.

We now use the native GetFileType call for all files by obtaining a
native handle where required. We also treat files of type FILE_TYPE_CHAR
as sequential, as is the case for the standard streams in console
applications.

When standard streams are redirected to/from files, GetFileType will
return FILE_TYPE_DISK for them and they won't be considered sequential.
This is alright since in this mode they behave like regular files and
QFile::seek() will work for random offsets.

Reviewed-by: Marius Storm-Olsen
src/corelib/io/qfsfileengine_win.cpp