Open der-b opened 3 years ago
I am not sure I completely understand.
You could resolve the configured path either relative to the config_path
's parent, or some other explicit root or base directory (i.e. using another parameter base_path
) via the VfsPath::join()
method.
Another option would be to return the path as plain string, and perform the path resolution outside of the config method using the appropriate base or root path there.
If you want to resolve a filesystem absolute path here, that's a bit outside the scope of this crate I think, since it specifically tries to contain everything inside the VFS. You could always create a new PhysicalFS
, if that is what is required and the path happens to be absolute.
I think, I found another issue with the VfsPath.
Let assume, that we want to read some path from a configuration file. Therefore we write a function with a header similar to this:
It would be possible, to delete the path in config_path by calling parent() until it returns None and than use join to put path into config_path. But I find this wired.
I think, VfsPath is missing some methods to construct a new path from an already existing path to keep the filesystem.
What do you think?