| 85 | } |
| 86 | |
| 87 | bool FileOpsImpl::FileWriteable |
| 88 | ( |
| 89 | const string _filename |
| 90 | ) |
| 91 | { |
| 92 | WIN32_FILE_ATTRIBUTE_DATA fad = { 0 }; |
| 93 | |
| 94 | |
| 95 | if (!FileExists(_filename)) { |
| 96 | /* check if the directory is writtable */ |
| 97 | wstring wFileName(ozwdirname(_filename).begin(), ozwdirname(_filename).end()); |
| 98 | |
| 99 | if (0 == GetFileAttributesEx(wFileName.c_str(), GetFileExInfoStandard, &fad)) |
| 100 | return false; |
| 101 | } |
| 102 | else { |
| 103 | wstring wFileName(_filename.begin(), _filename.end()); |
| 104 | |
| 105 | if (0 == GetFileAttributesEx(wFileName.c_str(), GetFileExInfoStandard, &fad)) |
| 106 | return false; |
| 107 | } |
| 108 | |
| 109 | return (fad.dwFileAttributes != INVALID_FILE_ATTRIBUTES && |
| 110 | !(fad.dwFileAttributes & FILE_ATTRIBUTE_READONLY)); |
| 111 | |
| 112 | } |
| 113 | |
| 114 | bool FileOpsImpl::FileRotate |
| 115 | ( |