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.xml12
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 54f31d7918..be7bacd994 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -522,13 +522,19 @@
<return type="int" enum="Error" />
<param index="0" name="path" type="String" />
<description>
- Moves the file or directory to the system's recycle bin. See also [method Directory.remove].
+ Moves the file or directory to the system's recycle bin. See also [method DirAccess.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]
+ [codeblocks]
+ [gdscript]
var file_to_remove = "user://slot1.sav"
OS.move_to_trash(ProjectSettings.globalize_path(file_to_remove))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var fileToRemove = "user://slot1.sav";
+ OS.MoveToTrash(ProjectSettings.GlobalizePath(fileToRemove));
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="open_midi_inputs">