Closed dohki closed 3 years ago
PR welcome.
path without considering current working directory.
Actually I don't understand the issue. Can you elaborate? What is a current directory in a sub file system?
https://github.com/xoofx/zio/blob/d245c2c4297a2cf79c753d94e917a706eb4d7bdb/src/Zio/FileSystems/SubFileSystem.cs#L65-L69
This implementation is fine when path is absolute. The problem happens when path is relative because it doesn't consider the current working directory. path.ToRelative
won't affect relative path since itself is already an relative path and the result safePath
will be directly appended to SubPath
as if it were an absolute path.
Again, I don't understand, there is no concept of current directory in Zio. SubPath
is supposed to be an absolute folder. Could you give an example with what you are trying to do?
Relative path is literally the path relative to the current working directory.
But, it seems Zio
works like as if current working directory is root (e.g. /
) as you said.
https://github.com/xoofx/zio/blob/8026d37030d4011fec428226bf199ef47909e815/src/Zio/UPathExtensions.cs#L40-L50
Then, I'll be sure to pass only absolute path to ConvertPathToDelegate
after prepending current working directory on relative path case if you don't want to introduce current working directory concept.
if you don't want to introduce current working directory concept.
It can't. A current working directory is only relevant for a system wide current directory. In Zio, you can have multiple filesystems in // that don't share anything. So a current directory has no meaning.
Zio works only with absolute paths when accessing a filesystems.
It just prepends root path to the relative path without considering current working directory. https://github.com/xoofx/zio/blob/d245c2c4297a2cf79c753d94e917a706eb4d7bdb/src/Zio/FileSystems/SubFileSystem.cs#L68
Can you implement this two features?
Thank you.