-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add root to Path & root constructor (#196)
Resolve #170 This PR adds a `def root(root: String, fileSystem: FileSystem): Path` in `os` package object. Additionally, it adds `root` and `filesystem` members to `Path`. It addresses two problems: - Specifying custom roots for a path - Using custom filesystems ## Filesystem Filesystem was added as a field of the `os.Path`. It was not added as a Root field for simplicity and consistency with Java's `nio`. Root is a part of the path; filesystem is the context of the whole path. One filesystem can have many roots; one root can have many subdirectories. ## Root as String A string is the simplest type that can represent the path's root. It also corresponds to the mental model of the path - usually, developers perceive it as a String. Therefore - String was chosen as the type of root. Pull request: #196 --------- Co-authored-by: Li Haoyi <[email protected]>
- Loading branch information
Showing
8 changed files
with
328 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.