summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-06-13 17:40:48 +0200
committerGitHub <noreply@github.com>2022-06-13 17:40:48 +0200
commit1f152b33177725bfa3423a10e9e7583b76519f87 (patch)
tree7064359b03fcc9a9bce6fea64ea69ed20b6f36c3
parent133d29102aa91acfcf91b60bcb4f442e40da2324 (diff)
parent1c90b066dd32d0a3fa0f1747be2836b70e7a0598 (diff)
Merge pull request #61945 from KoBeWi/making_move_to_trash_less_trash
-rw-r--r--doc/classes/OS.xml5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 2512dec4b3..e6d5ea61da 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -469,7 +469,12 @@
<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">