On Windows, report a 0 file size for streams and other funny files
commit2ad49361eeb1ad14a2b9c6c95a9d20d20f9aa851
authorJoão Abecasis <joao@abecasis.name>
Fri, 23 Oct 2009 09:23:55 +0000 (23 11:23 +0200)
committerJoão Abecasis <joao@abecasis.name>
Fri, 23 Oct 2009 13:05:49 +0000 (23 15:05 +0200)
tree7b6a0251a479602385dafeb5e45e6f90d879574b
parent3be1b879c9fbe37b71cce3c95ec4a3753a25a641
On Windows, report a 0 file size for streams and other funny files

Obtain file size directly, instead of relying on fseek/ftell and messing
with the file position.

Also changed the return value on errors to 0. This is mostly relevant on
streams and pipes, where we used to return whatever error value ftell
returned (usually -1). This change also makes the return value
consistent with what is returned on Unix platforms and what we document
for Windows CE.

Nevertheless, documentation of this and related issues is misleading and
needs to be updated.

Reviewed-by: Markus Goetz
src/corelib/io/qfsfileengine_win.cpp