| 272 | } |
| 273 | |
| 274 | bool UnixFileSystem::SetReadOnly(const StringView& path, bool isReadOnly) |
| 275 | { |
| 276 | const UnixString pathANSI(*path, path.Length()); |
| 277 | struct stat fileInfo; |
| 278 | if (stat(pathANSI.Get(), &fileInfo) != -1) |
| 279 | { |
| 280 | if (isReadOnly) |
| 281 | { |
| 282 | fileInfo.st_mode &= ~S_IWUSR; |
| 283 | } |
| 284 | else |
| 285 | { |
| 286 | fileInfo.st_mode |= S_IWUSR; |
| 287 | } |
| 288 | return chmod(pathANSI.Get(), fileInfo.st_mode) == 0; |
| 289 | } |
| 290 | return false; |
| 291 | } |
| 292 | |
| 293 | bool UnixFileSystem::MoveFile(const StringView& dst, const StringView& src, bool overwrite) |
| 294 | { |