MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetReadOnly

Method SetReadOnly

Source/Engine/Platform/Unix/UnixFileSystem.cpp:274–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274bool 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
293bool UnixFileSystem::MoveFile(const StringView& dst, const StringView& src, bool overwrite)
294{

Callers

nothing calls this directly

Calls 3

statClass · 0.70
LengthMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected