MCPcopy Create free account
hub / github.com/Autodesk/Aurora / fileIsWritable

Function fileIsWritable

Tests/Helpers/TestHelpers.cpp:283–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283bool fileIsWritable(const std::string& path)
284{
285 // Struct for stat results
286 struct stat info;
287
288 // Use stat to get file info (return false if result non-zero to indicate failure)
289 if (stat(path.c_str(), &info) != 0)
290 return false;
291
292 // If its a directory not file, return false
293 if (info.st_mode & S_IFDIR)
294 return false;
295
296 // Return true if write flag is set
297 return (info.st_mode & S_IWRITE) != 0;
298}
299
300bool fileIsReadable(const std::string& path)
301{

Callers

nothing calls this directly

Calls 1

statClass · 0.85

Tested by

no test coverage detected