diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-13 10:10:50 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-13 10:10:50 -0300 |
commit | 7f02627290cedf2d5ef6b45cddc6117c763cb15b (patch) | |
tree | e25e3f1a33e63a941732c8e920908c3e20bab113 /core/os/file_access.h | |
parent | f0abda999e179faf1577026d0369062349cb4897 (diff) |
-Add visible IO errors when closing a file fails due to it being locked (most likely on windows), closes #4760
Diffstat (limited to 'core/os/file_access.h')
-rw-r--r-- | core/os/file_access.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/os/file_access.h b/core/os/file_access.h index 2c894c94eb..8d5823663e 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -47,6 +47,8 @@ public: ACCESS_MAX }; + typedef void (*FileCloseFailNotify)(const String&); + typedef FileAccess*(*CreateFunc)(); bool endian_swap; bool real_is_double; @@ -56,7 +58,7 @@ protected: virtual Error _open(const String& p_path, int p_mode_flags)=0; ///< open a file virtual uint64_t _get_modified_time(const String& p_file)=0; - + static FileCloseFailNotify close_fail_notify; private: static bool backup_save; @@ -69,8 +71,12 @@ private: return memnew( T ); } + + public: + static void set_file_close_fail_notify_callback(FileCloseFailNotify p_cbk) { close_fail_notify=p_cbk; } + virtual void _set_access_type(AccessType p_access); enum ModeFlags { |