You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in cerulean, paths are always absolute. That's a good thing, because a current working directory is a bit of a tricky concept when you're dealing with remote file systems and network errors and such. However, we sometimes need relative paths, like in a recursive copy of a directory, where we need to obtain the relative path of a file inside the tree to be copied with respect to the root, so we can rebase it on the target directory to get an absolute path to copy the file to.
The chrono library in C++ has time_point and duration classes. A time_point is an absolute point in time, while a duration is the difference between two time_points. So you can add a duration to a time_point to get another time_point, or subtract it, or add two durations to get another duration. This concept seems like a good solution here.
So let's add a cerulean.RelativePath here. A RelativePath is abstract, and it's not associated with a FileSystem like a normal Path. RelativePaths can be concatenated using / to form a new RelativePath, and you can write path / relative_path to get a Path containing the concatenation.
A RelativePath is pure, which means you cannot access files through it. Which methods should it have? Some subset of PurePosixPath? TBD...
The text was updated successfully, but these errors were encountered:
Currently in cerulean, paths are always absolute. That's a good thing, because a current working directory is a bit of a tricky concept when you're dealing with remote file systems and network errors and such. However, we sometimes need relative paths, like in a recursive copy of a directory, where we need to obtain the relative path of a file inside the tree to be copied with respect to the root, so we can rebase it on the target directory to get an absolute path to copy the file to.
The chrono library in C++ has time_point and duration classes. A time_point is an absolute point in time, while a duration is the difference between two time_points. So you can add a duration to a time_point to get another time_point, or subtract it, or add two durations to get another duration. This concept seems like a good solution here.
So let's add a cerulean.RelativePath here. A RelativePath is abstract, and it's not associated with a FileSystem like a normal Path. RelativePaths can be concatenated using / to form a new RelativePath, and you can write path / relative_path to get a Path containing the concatenation.
A RelativePath is pure, which means you cannot access files through it. Which methods should it have? Some subset of PurePosixPath? TBD...
The text was updated successfully, but these errors were encountered: