mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user