| 235 | |
| 236 | |
| 237 | bool File::Close() |
| 238 | { |
| 239 | bool Success=true; |
| 240 | |
| 241 | if (hFile!=FILE_BAD_HANDLE) |
| 242 | { |
| 243 | if (!SkipClose) |
| 244 | { |
| 245 | #ifdef _WIN_ALL |
| 246 | // We use the standard system handle for stdout in Windows |
| 247 | // and it must not be closed here. |
| 248 | if (HandleType==FILE_HANDLENORMAL) |
| 249 | Success=CloseHandle(hFile)==TRUE; |
| 250 | #else |
| 251 | #ifdef FILE_USE_OPEN |
| 252 | Success=close(hFile)!=-1; |
| 253 | #else |
| 254 | Success=fclose(hFile)!=EOF; |
| 255 | #endif |
| 256 | #endif |
| 257 | } |
| 258 | hFile=FILE_BAD_HANDLE; |
| 259 | } |
| 260 | HandleType=FILE_HANDLENORMAL; |
| 261 | if (!Success && AllowExceptions) |
| 262 | ErrHandler.CloseError(FileName); |
| 263 | return Success; |
| 264 | } |
| 265 | |
| 266 | |
| 267 | bool File::Delete() |
no test coverage detected