resolve function #426
Replies: 3 comments 1 reply
-
Just seeing this now. I think this is a great idea and definitely is inline with how files are treated in every other language. The implicit suggestion in wdl that "a file is just a special string" leads to soooo many issues and inconsistent behaviour. I would definitely +1 this proposal |
Beta Was this translation helpful? Give feedback.
-
Looks great! The way you describe it it brings Python's I would propose that this function can allow an arbitrary number of arguments, or an array. My only gripe is with the name. |
Beta Was this translation helpful? Give feedback.
-
If OpenWDL has standardized on BASH, then implicitly you've standardized on POSIX, therefore the path separator should always be |
Beta Was this translation helpful? Give feedback.
-
One thing that has tripped up many people is concatenation of
File
andString
. Specifically, it is not clear whether the following expressions should result inFile
orString
:File
+String
String
+File
I propose that we disallow all concatenations between
File
andString
, and instead introduce a resolve function:File resolve(String|File, String|File)
resolve
accepts two arguments that are both assumed to be paths. The first argument may be a relative or absolute path; the second argument must be a relative path.resolve
appends the two paths and returns the result as aFile
. Importantly,resolve
ensures the two paths are joined by the system-specific path separator (i.e./
on *nix and\
on Windows).Beta Was this translation helpful? Give feedback.
All reactions