Change `Path` into a wrapper around `java.nio.file.Path`? #346
Comments
This has happened in master and will go out 0.6.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We could preserve the type-level distinction between
Path
andRelPath
, as well as the nice superficial syntax and API. But there are things innio.file.Path
that I want:This would be a non-trivial philosophical change that would change
Path
s from a transparent struct into an opaque type. Or at very least contain a pointer to an opaque type, thejava.nio.file.FileSystem
.In general, the variables holding the
Root
andFilesystem
have to live on the paths if we want to be able to perform operations that span multipleRoot
s orFilesystem
s, which we probably do. In the simplest case, Windows users would need to move files between drives.This is impossible if you store the
Root
andFilesystem
anywhere else, e.g. on the operations (e.g.D_drive.cp
,C_drive.rm
) because you won't be able to refer to paths on multiple drives in one operation.This would also make it more awkward to use (abuse?)
Path
andRelPath
for other non-filesystem usages. That could be considered a good thing. I've done this and it always proves to be confusing. Better to define a separate non-ammonitePath
and have the types keep you straightThe text was updated successfully, but these errors were encountered: