summaryrefslogtreecommitdiff
path: root/doc/classes/OS.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/OS.xml')
-rw-r--r--doc/classes/OS.xml36
1 files changed, 34 insertions, 2 deletions
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index bc9bfc9676..aaf08dec2f 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -175,6 +175,10 @@
if argument.find("=") > -1:
var key_value = argument.split("=")
arguments[key_value[0].lstrip("--")] = key_value[1]
+ else:
+ # Options without an argument will be present in the dictionary,
+ # with the value set to an empty string.
+ arguments[argument.lstrip("--")] = ""
[/gdscript]
[csharp]
var arguments = new Godot.Collections.Dictionary();
@@ -185,6 +189,12 @@
string[] keyValue = argument.Split("=");
arguments[keyValue[0].LStrip("--")] = keyValue[1];
}
+ else
+ {
+ // Options without an argument will be present in the dictionary,
+ // with the value set to an empty string.
+ arguments[keyValue[0].LStrip("--")] = "";
+ }
}
[/csharp]
[/codeblocks]
@@ -278,7 +288,7 @@
<return type="String" />
<description>
Returns the name of the host OS.
- On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] (Universal Windows Platform) if exported thereon.
+ On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] if exported on Universal Windows Platform.
On macOS, this is [code]"macOS"[/code].
On Linux-based operating systems, this is [code]"Linux"[/code].
On BSD-based operating systems, this is [code]"FreeBSD"[/code], [code]"NetBSD"[/code], [code]"OpenBSD"[/code], or [code]"BSD"[/code] as a fallback.
@@ -434,6 +444,15 @@
Returns [code]true[/code] if the input keycode corresponds to a Unicode character.
</description>
</method>
+ <method name="is_process_running" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="pid" type="int" />
+ <description>
+ Returns [code]true[/code] if the child process ID ([code]pid[/code]) is still running or [code]false[/code] if it has terminated.
+ Must be a valid ID generated from [method create_process].
+ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
+ </description>
+ </method>
<method name="is_stdout_verbose" qualifiers="const">
<return type="bool" />
<description>
@@ -455,6 +474,19 @@
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
+ <method name="move_to_trash" qualifiers="const">
+ <return type="int" enum="Error" />
+ <argument index="0" name="path" type="String" />
+ <description>
+ Moves the file or directory to the system's recycle bin. See also [method Directory.remove].
+ The method takes only global paths, so you may need to use [method ProjectSettings.globalize_path]. Do not use it for files in [code]res://[/code] as it will not work in exported project.
+ [b]Note:[/b] If the user has disabled the recycle bin on their system, the file will be permanently deleted instead.
+ [codeblock]
+ var file_to_remove = "user://slot1.sav"
+ OS.move_to_trash(ProjectSettings.globalize_path(file_to_remove))
+ [/codeblock]
+ </description>
+ </method>
<method name="open_midi_inputs">
<return type="void" />
<description>
@@ -533,7 +565,7 @@
Requests the OS to open a resource with the most appropriate program. For example:
- [code]OS.shell_open("C:\\Users\name\Downloads")[/code] on Windows opens the file explorer at the user's Downloads folder.
- [code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website.
- - [code]OS.shell_open("mailto:example@example.com")[/code] opens the default email client with the "To" field set to [code]example@example.com[/code]. See [url=https://blog.escapecreative.com/customizing-mailto-links/]Customizing [code]mailto:[/code] Links[/url] for a list of fields that can be added.
+ - [code]OS.shell_open("mailto:example@example.com")[/code] opens the default email client with the "To" field set to [code]example@example.com[/code]. See [url=https://datatracker.ietf.org/doc/html/rfc2368]RFC 2368 - The [code]mailto[/code] URL scheme[/url] for a list of fields that can be added.
Use [method ProjectSettings.globalize_path] to convert a [code]res://[/code] or [code]user://[/code] path into a system path for use with this method.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows.
</description>