diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-10-19 14:35:10 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-03-27 11:41:16 +0200 |
commit | 082b420c0ab6ddb7cc658b929124893ee2ad72b2 (patch) | |
tree | a5f1b40945aaffbcc01c2195ce18b939640c3105 /core/io/file_access.cpp | |
parent | 7d151c83811f8ac8873439826c16d88c83aba12f (diff) | |
download | redot-engine-082b420c0ab6ddb7cc658b929124893ee2ad72b2.tar.gz |
Implement `OS.execute_with_pipe` method to run process with redirected stdio.
Implement `pipe://*` path handling for creation of named pipes.
Diffstat (limited to 'core/io/file_access.cpp')
-rw-r--r-- | core/io/file_access.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp index 55286277fa..d2a5103953 100644 --- a/core/io/file_access.cpp +++ b/core/io/file_access.cpp @@ -47,6 +47,7 @@ thread_local Error FileAccess::last_file_open_error = OK; Ref<FileAccess> FileAccess::create(AccessType p_access) { ERR_FAIL_INDEX_V(p_access, ACCESS_MAX, nullptr); + ERR_FAIL_NULL_V(create_func[p_access], nullptr); Ref<FileAccess> ret = create_func[p_access](); ret->_set_access_type(p_access); @@ -75,7 +76,8 @@ Ref<FileAccess> FileAccess::create_for_path(const String &p_path) { ret = create(ACCESS_RESOURCES); } else if (p_path.begins_with("user://")) { ret = create(ACCESS_USERDATA); - + } else if (p_path.begins_with("pipe://")) { + ret = create(ACCESS_PIPE); } else { ret = create(ACCESS_FILESYSTEM); } @@ -209,6 +211,9 @@ String FileAccess::fix_path(const String &p_path) const { } } break; + case ACCESS_PIPE: { + return r_path; + } break; case ACCESS_FILESYSTEM: { return r_path; } break; |