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
When path is empty, adding a filename to it puts it into system root rather than current directory, which is a ground for gotchas. Majority vote (4:1) prefers current directory in this case:
When added filename is an absolute path, resulting path is invalid. So a pattern that successfully adds relative path to the current directory fails if path is absolute:
>> path: %/D/devel/red/
>> boot: %./1.exe
>> path/:boot
== %/D/devel/red/./1.exe ;) valid path to the binary
>> boot: %/D/devel/red/1.exe
>> path/:boot
== %/D/devel/red//D/devel/red/1.exe ;) garbage out
It is understandable that / works simply as append dirize, but it requires higher level function wrapper to achieve this very common goal.
Similarly we may want to address these cases as well:
>> dirize %"" ;) will lead to root access
== %/
>> dirize clean-path %""
== %/C/Users/1/
>> clean-path dirize %"" ;) unexpected order-related difference
== %/
Describe the bug
It is understandable that
/
works simply asappend dirize
, but it requires higher level function wrapper to achieve this very common goal.Similarly we may want to address these cases as well:
Expected behavior
Since there's no direct function equivalent of this behavior, there are multiple options:
/
simple but provide a function wrapper for path joining/
smarter/
smarter and add a function alias to itI'm leaning towards (3). Note that
append dirize
equivalent cannot fulfill this case, requires more smarts:Platform version
Red 0.6.4 for Windows built 22-Nov-2023/17:24:25+03:00 commit #34f26df
The text was updated successfully, but these errors were encountered: