Skip to content

Commit ce5b8b8

Browse files
committed
Alternative definition for SetFileReadWrite()
Signed-off-by: Mohammad AlSaleh <[email protected]>
1 parent 3531b16 commit ce5b8b8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

units/nSupport.h

+10
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ inline bool FileIsReadOnly(const std::string& fileName_in)
102102
return false;
103103
}
104104

105+
inline bool SetFileReadWrite(const std::string& fileName_in)
106+
{
107+
struct stat st;
108+
if ( stat(fileName_in.c_str(), &st) ) {
109+
return false;
110+
}
111+
112+
return !chmod(fileName_in.c_str(), st.st_mode | S_IRUSR | S_IWUSR);
113+
}
114+
105115
inline bool DirectoryExists(const std::string& dirName_in)
106116
{
107117
struct stat st;

0 commit comments

Comments
 (0)