| 286 | } |
| 287 | |
| 288 | bool AndroidFileSystem::SetReadOnly(const StringView& path, bool isReadOnly) |
| 289 | { |
| 290 | const StringAsANSI<> pathANSI(*path, path.Length()); |
| 291 | struct stat fileInfo; |
| 292 | if (stat(pathANSI.Get(), &fileInfo) != -1) |
| 293 | { |
| 294 | if (isReadOnly) |
| 295 | { |
| 296 | fileInfo.st_mode &= ~S_IWUSR; |
| 297 | } |
| 298 | else |
| 299 | { |
| 300 | fileInfo.st_mode |= S_IWUSR; |
| 301 | } |
| 302 | return chmod(pathANSI.Get(), fileInfo.st_mode) == 0; |
| 303 | } |
| 304 | return false; |
| 305 | } |
| 306 | |
| 307 | bool AndroidFileSystem::MoveFile(const StringView& dst, const StringView& src, bool overwrite) |
| 308 | { |