Fix Windows-to-Linux export error
Now chmod() returns ERR_UNAVAILABLE by default, to signal the caller the problem is lack of support instead of a failed operation.
This commit is contained in:
parent
7983fb95b0
commit
c356fbe05f
@ -139,7 +139,7 @@ public:
|
|||||||
|
|
||||||
virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType
|
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 FAILED; }
|
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(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 *create_for_path(const String &p_path);
|
||||||
|
@ -1350,6 +1350,9 @@ Error EditorExportPlatformPC::export_project(const String &p_path, bool p_debug,
|
|||||||
int flags = get_chmod_flags();
|
int flags = get_chmod_flags();
|
||||||
if (flags) {
|
if (flags) {
|
||||||
err = dst->_chmod(p_path, flags);
|
err = dst->_chmod(p_path, flags);
|
||||||
|
// If exporting from a platform with no chmod support (i.e., Windows), don't fail
|
||||||
|
if (err == ERR_UNAVAILABLE)
|
||||||
|
err = OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user