Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- local/local.go.orig-20161101Z151259 2016-11-01 08:04:10.891020265 -0200
- +++ local/local.go 2016-11-01 14:39:49.377083966 -0200
- @@ -12,6 +12,7 @@
- "runtime"
- "strings"
- "sync"
- + "syscall"
- "time"
- "unicode/utf8"
- @@ -19,8 +20,11 @@
- "github.com/ncw/rclone/fs"
- "github.com/pkg/errors"
- + "github.com/spf13/pflag"
- )
- +var oneFileSystem = pflag.BoolP("one-file-system", "x", false, "Don't cross filesystem boundaries.")
- +
- // Register with Fs
- func init() {
- fsi := &fs.RegInfo{
- @@ -151,6 +155,15 @@
- out.SetError(errors.Wrapf(err, "failed to open directory %q", dirpath))
- return nil
- }
- +
- + // Obtain dirpath's device
- + fdFi, err := os.Stat(dirpath)
- + if err != nil {
- + out.SetError(errors.Wrapf(err, "failed to stat directory %q", dirpath))
- + return nil
- + }
- + fdDev := fdFi.Sys().(*syscall.Stat_t).Dev
- +
- defer func() {
- err := fd.Close()
- if err != nil {
- @@ -186,7 +199,7 @@
- if out.AddDir(dir) {
- return nil
- }
- - if level > 0 {
- + if level > 0 && ! (*oneFileSystem && ! ((fi.Sys().(*syscall.Stat_t)).Dev == fdDev )) {
- subdirs = append(subdirs, listArgs{remote: newRemote, dirpath: newPath, level: level - 1})
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement