Input/Output : File Access : Paths
 
Share this page                  
Paths
Paths “point to” a location in a file system. The resource identified by a path does not need to exist. Paths can be manipulated without affecting the referenced object. A path is simply an identifier that obeys certain rules of syntax. Syntactically and semantically, paths are similar to URLs.
Paths are often represented as strings. A path string always begins with a scheme identifier indicating the type of file system referenced. One notable exception exists—local files do not require a scheme, allowing file paths to be used unchanged. The remainder is scheme-specific, but generally consists of optional information to further identify the particular file system instance and a hierarchical path to the resource from the file system root.
The general format of a path string is:
<scheme identifier>:<scheme specific data>
File Patterns
Some file systems support a form of pattern matching. The exact syntax of patterns is scheme-specific, but a pattern string follows the same format as a path string, with the pattern supplied as the scheme-specific data.
A file pattern cannot be used as a path, though it can be used to produce a list of matching paths. A path string is always a valid file pattern which matches only itself.
The file reader operators provided in the DataFlow library all accept file patterns (or directories) as a means of selecting multiple files to read. See Using ByteSource Implementations for examples.