summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2017-09-17 14:40:58 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2017-09-17 14:40:58 -0300
commit3528b1e571dee24917b0141232f135e29bf088ba (patch)
tree1994ea234d7c52dac02084242671348844bed3fc /core
parent574a5714dcbf5fcf126f3f99caab62a345e665c1 (diff)
Fix x11 exported executables not getting the +x flag
Diffstat (limited to 'core')
-rw-r--r--core/os/dir_access.cpp7
-rw-r--r--core/os/dir_access.h2
-rw-r--r--core/os/file_access.h2
3 files changed, 9 insertions, 2 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index f24d6d16ca..1437e7cdfc 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -292,7 +292,7 @@ String DirAccess::get_full_path(const String &p_path, AccessType p_access) {
return full;
}
-Error DirAccess::copy(String p_from, String p_to) {
+Error DirAccess::copy(String p_from, String p_to, int chmod_flags) {
//printf("copy %s -> %s\n",p_from.ascii().get_data(),p_to.ascii().get_data());
Error err;
@@ -329,6 +329,11 @@ Error DirAccess::copy(String p_from, String p_to) {
fdst->store_8(fsrc->get_8());
}
+ if (err == OK && chmod_flags != -1) {
+ fdst->close();
+ err = fdst->_chmod(p_to, chmod_flags);
+ }
+
memdelete(fsrc);
memdelete(fdst);
diff --git a/core/os/dir_access.h b/core/os/dir_access.h
index 6ad8b4c49b..7fa3ce5cf1 100644
--- a/core/os/dir_access.h
+++ b/core/os/dir_access.h
@@ -89,7 +89,7 @@ public:
static bool exists(String p_dir);
virtual size_t get_space_left() = 0;
- virtual Error copy(String p_from, String p_to);
+ virtual Error copy(String p_from, String p_to, int chmod_flags = -1);
virtual Error rename(String p_from, String p_to) = 0;
virtual Error remove(String p_name) = 0;
diff --git a/core/os/file_access.h b/core/os/file_access.h
index 8e5728f525..151c41c263 100644
--- a/core/os/file_access.h
+++ b/core/os/file_access.h
@@ -140,6 +140,8 @@ 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) {}
+
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.