diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-04-07 15:46:52 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2019-04-07 15:45:30 -0300 |
commit | cd4449e7abe97b2bc883e2d182db2cc41eb35f8c (patch) | |
tree | 2498bac08105314c5defedde82141430e01ffd0c /core/os/file_access.h | |
parent | 65f3a953de3db4406f099d014acbc630f53eca9c (diff) | |
download | redot-engine-cd4449e7abe97b2bc883e2d182db2cc41eb35f8c.tar.gz |
Add FileAccess::set_unix_permissions for Unix platforms
Diffstat (limited to 'core/os/file_access.h')
-rw-r--r-- | core/os/file_access.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/os/file_access.h b/core/os/file_access.h index 9df2a5cade..4930eae35a 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -56,6 +56,9 @@ public: bool endian_swap; bool real_is_double; + virtual uint32_t _get_unix_permissions(const String &p_file) = 0; + virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) = 0; + protected: String fix_path(const String &p_path) const; virtual Error _open(const String &p_path, int p_mode_flags) = 0; ///< open a file @@ -148,14 +151,14 @@ public: virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType - virtual Error _chmod(const String &p_path, int p_mod) { return ERR_UNAVAILABLE; } - static FileAccess *create(AccessType p_access); /// Create a file access (for the current platform) this is the only portable way of accessing files. static FileAccess *create_for_path(const String &p_path); static FileAccess *open(const String &p_path, int p_mode_flags, Error *r_error = NULL); /// Create a file access (for the current platform) this is the only portable way of accessing files. static CreateFunc get_create_func(AccessType p_access); static bool exists(const String &p_name); ///< return true if a file exists static uint64_t get_modified_time(const String &p_file); + static uint32_t get_unix_permissions(const String &p_file); + static Error set_unix_permissions(const String &p_file, uint32_t p_permissions); static void set_backup_save(bool p_enable) { backup_save = p_enable; }; static bool is_backup_save_enabled() { return backup_save; }; |