Replies: 2 comments 3 replies
-
@lihaoyi, I wanted to bring your attention to this issue. This is effectively a contradiction to our claim from the project description:
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Java's |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just recognized that we have some discrepancies in os-lib regarding Windows file paths. E.g. we have no clear abstraction over file system roots.
This is not an issue on Unix-like system, as they only have one root which is kind-of un-named and must not be explicitly declared. But for Windows, we typically have multiple roots (e.g. drive letters) and we can't construct absolute paths without them.
There is especially no way to access the drive letter via os-lib API. And there is the open question, whether we should treat it as a first segment or as something more special?
Currently, when we use
os.Path.segments
, the drive letter is not included. This is consistent with the underlyingjava.nio.file.Path.iterator
API. As a consequence, there is no proper way to re-create aos.Path
from all segments on Windows.This is no issue on Unix-like systems though.
Linux: Gettings all segments and re-construct a
os.Path
from it worksWindows: Getting all segments and re-construct a
os.Path
does not workBeta Was this translation helpful? Give feedback.
All reactions