; comp ',~\.go$' '/tmp/x,~\.go$' #diff comp.go:208: and /tmp/x/comp.go:207: - x.diff() #diff: comp.go:209: and /tmp/x/comp.go:209: + x.diff() ...
There are several things working together here
- Commands accept names made of two elements: a path and a predicate (separated by a comma). In the example the predicates match the name against what would be "*.go" in UNIX.
- Each name is issued to a finder to find a stream of directory entries
- Directory entries are self-describing, and thus a stream of directory entries is enough to reach the different file servers involved in the name space used for the search.
- File and directory contents may be retrieved along with the find request; they are streamed through channels, like everybody else.
- Directories always report and find entries in the same order, i.e. they are always sorted
As a result, the compare command only has to use a library function to make each name become a stream and then compare the two streams.
No comments:
Post a Comment