You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added a unified `OS.get_real_path(path)` API (exposed via scripting/bindings) to return normalized “real” paths across platforms.
* **Bug Fixes**
* Windows: improved executable-path resolution with proper normalization, better handling when module path retrieval fails, and more reliable environment variable existence/value detection.
* Unix: executable-path and platform “real” path normalization now use real-path resolution with validation and safe fallback.
* **Refactor**
* Introduced a shared real-path resolution interface, aligning OS implementations across platforms.
WARN_PRINT("Attempting to open an URL with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Redot-specific path to a system path before opening it with `OS.shell_open()`.");
Copy file name to clipboardExpand all lines: doc/classes/OS.xml
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -458,6 +458,15 @@
458
458
[b]Note:[/b] This method is only implemented on Windows, macOS, Linux and iOS. On Android and Web, [method get_processor_name] returns an empty string.
459
459
</description>
460
460
</method>
461
+
<methodname="get_real_path"qualifiers="const">
462
+
<returntype="String" />
463
+
<paramindex="0"name="path"type="String" />
464
+
<description>
465
+
Normalizes a given path, removing consecutive double-slash path separators, converts relative path logic to absolute, and resolves all symbolic links.
466
+
[b]Note:[/b] On Windows, if a path passed to the function contains backwards slashes for any path separators, those are replaced with forward slashes.
467
+
[b]Note:[/b] If the function failed for any reason, max path byte limit exceeded, the original input string with forward slash separators is returned.
// NetBSD does not always return a normalized path. For example if argv[0] is "./a.out" then executable path is "/home/netbsd/./a.out". Normalize with realpath:
0 commit comments