diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/unix/file_access_unix.cpp | 9 | ||||
-rw-r--r-- | drivers/unix/file_access_unix.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 80565c5b02..e19bc738cb 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -274,6 +274,15 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) { }; } +Error FileAccessUnix::_chmod(const String &p_path, int p_mod) { + int err = chmod(p_path.utf8().get_data(), p_mod); + if (!err) { + return OK; + } + + return FAILED; +} + FileAccess *FileAccessUnix::create_libc() { return memnew(FileAccessUnix); diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index 6e5110431f..c5ab8821be 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -78,6 +78,8 @@ public: virtual uint64_t _get_modified_time(const String &p_file); + virtual Error _chmod(const String &p_path, int p_mod); + FileAccessUnix(); virtual ~FileAccessUnix(); }; |