
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)
28 lines
431 B
Go
28 lines
431 B
Go
package fs
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func copyFileInfo(fi os.FileInfo, name string) error {
|
|
if err := os.Chmod(name, fi.Mode()); err != nil {
|
|
return errors.Wrapf(err, "failed to chmod %s", name)
|
|
}
|
|
|
|
// TODO: copy windows specific metadata
|
|
|
|
return nil
|
|
}
|
|
|
|
func copyFileContent(dst, src *os.File) error {
|
|
_, err := io.Copy(dst, src)
|
|
return err
|
|
}
|
|
|
|
func copyXAttrs(dst, src string) error {
|
|
return nil
|
|
}
|