Changeset 2115 for box/trunk/lib/common/FileStream.cpp
- Timestamp:
- 28/03/2008 22:18:44 (4 years ago)
- File:
-
- 1 edited
-
box/trunk/lib/common/FileStream.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/common/FileStream.cpp
r1369 r2115 31 31 : mOSFileHandle(::open(Filename, flags, mode)), 32 32 #endif 33 mIsEOF(false) 33 mIsEOF(false), 34 mFileName(Filename) 34 35 { 35 36 #ifdef WIN32 … … 50 51 } 51 52 } 52 #ifdef WIN3253 this->fileName = Filename;54 #endif55 53 } 56 54 … … 66 64 FileStream::FileStream(tOSFileHandle FileDescriptor) 67 65 : mOSFileHandle(FileDescriptor), 68 mIsEOF(false) 66 mIsEOF(false), 67 mFileName("HANDLE") 69 68 { 70 69 #ifdef WIN32 … … 78 77 THROW_EXCEPTION(CommonException, OSFileOpenError) 79 78 } 80 #ifdef WIN3281 this->fileName = "HANDLE";82 #endif83 79 } 84 80 … … 151 147 ); 152 148 153 if ( valid)149 if(valid) 154 150 { 155 151 r = numBytesRead; 156 152 } 157 else if (GetLastError() == ERROR_BROKEN_PIPE)153 else if(GetLastError() == ERROR_BROKEN_PIPE) 158 154 { 159 155 r = 0; … … 161 157 else 162 158 { 163 BOX_ERROR("Failed to read from file: " << 164 GetErrorMessage(GetLastError())); 159 BOX_LOG_WIN_ERROR("Failed to read from file: " << mFileName); 165 160 r = -1; 166 161 } 167 162 #else 168 163 int r = ::read(mOSFileHandle, pBuffer, NBytes); 169 #endif170 164 if(r == -1) 171 165 { 166 BOX_LOG_SYS_ERROR("Failed to read from file: " << mFileName); 167 } 168 #endif 169 170 if(r == -1) 171 { 172 172 THROW_EXCEPTION(CommonException, OSFileReadError) 173 173 } 174 174 175 if(r == 0) 175 176 {
Note: See TracChangeset
for help on using the changeset viewer.
