Implement OS.execute_with_pipe method to run process with redirected stdio.

Implement `pipe://*` path handling for creation of named pipes.
This commit is contained in:
bruvzg
2023-10-19 14:35:10 +03:00
parent 7d151c8381
commit 082b420c0a
16 changed files with 790 additions and 11 deletions

View File

@@ -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;