Add fs package
Add diff comparison with support for double walking two trees for comparison or single walking a diff tree. Single walking requires further implementation for specific mount types. Add directory copy function which is intended to provide fastest possible local copy of file system directories without hardlinking. Add test package to make creating filesystems for test easy and comparisons deep and informative. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
12
fs/hardlink.go
Normal file
12
fs/hardlink.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package fs
|
||||
|
||||
import "os"
|
||||
|
||||
// GetLinkSource returns a path for the given name and
|
||||
// file info to its link source in the provided inode
|
||||
// map. If the given file name is not in the map and
|
||||
// has other links, it is added to the inode map
|
||||
// to be a source for other link locations.
|
||||
func GetLinkSource(name string, fi os.FileInfo, inodes map[uint64]string) (string, error) {
|
||||
return getHardLink(name, fi, inodes)
|
||||
}
|
||||
Reference in New Issue
Block a user