Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58194 - sandbox/filesystem-v3/libs/filesystem/src
From: bdawes_at_[hidden]
Date: 2009-12-06 12:01:12


Author: bemandawes
Date: 2009-12-06 12:01:11 EST (Sun, 06 Dec 2009)
New Revision: 58194
URL: http://svn.boost.org/trac/boost/changeset/58194

Log:
Fix #3551 for Windows Mobile
Text files modified:
   sandbox/filesystem-v3/libs/filesystem/src/operations.cpp | 12 +++++++-----
   1 files changed, 7 insertions(+), 5 deletions(-)

Modified: sandbox/filesystem-v3/libs/filesystem/src/operations.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/src/operations.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/src/operations.cpp 2009-12-06 12:01:11 EST (Sun, 06 Dec 2009)
@@ -911,12 +911,12 @@
 
     if (error(::GetFileAttributesExW(p.c_str(), ::GetFileExInfoStandard, &fad)== 0,
         p, ec, "boost::filesystem::file_size"))
- return 0;
+ return static_cast<boost::uintmax_t>(-1);
 
     if (error((fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)!= 0,
- error_code(ERROR_FILE_NOT_FOUND, system_category),
+ error_code(ERROR_NOT_SUPPORTED, system_category),
         p, ec, "boost::filesystem::file_size"))
- return 0;
+ return static_cast<boost::uintmax_t>(-1);
 
     return (static_cast<boost::uintmax_t>(fad.nFileSizeHigh)
               << (sizeof(fad.nFileSizeLow)*8)) + fad.nFileSizeLow;
@@ -1471,8 +1471,10 @@
       == INVALID_HANDLE_VALUE)
     {
       handle = 0;
- return error_code(::GetLastError()== ERROR_FILE_NOT_FOUND
- ? 0 : ::GetLastError(), system_category);
+ return error_code( (::GetLastError() == ERROR_FILE_NOT_FOUND
+ // Windows Mobile returns ERROR_NO_MORE_FILES; see ticket #3551
+ || ::GetLastError() == ERROR_NO_MORE_FILES)
+ ? 0 : ::GetLastError(), system_category );
     }
     target = data.cFileName;
     if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk