"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
local: Fix directory separators on Windows - fixes #24
Nick Craig-Woodd64a37772fe4
diff --git a/local/local.go b/local/local.goindex b0dd2e873..758cf1cf4 100644--- a/local/local.go+++ b/local/local.go@@ -1,6 +1,11 @@// Local filesystem interfacepackage local+// Note that all rclone paths should be / separated. Anything coming+// from the filepath module will have \ separators on windows so+// should be converted using filepath.ToSlash. Windows is quite happy+// with / separators so there is no need to convert them back.+import ("crypto/md5""encoding/hex"@@ -45,7 +50,7 @@ type FsObjectLocal struct {// NewFs contstructs an FsLocal from the pathfunc NewFs(name, root string) (fs.Fs, error) {- root = path.Clean(root)+ root = filepath.ToSlash(path.Clean(root))f := &FsLocal{root: root}// Check to see if this points to a filefi, err := os.Lstat(f.root)@@ -69,7 +74,8 @@ func (f *FsLocal) String() string {//// May return nil if an error occurredfunc (f *FsLocal) newFsObjectWithInfo(remote string, info os.FileInfo) fs.Object {- path := filepath.Join(f.root, remote)+ remote = filepath.ToSlash(remote)+ path := path.Join(f.root, remote)o := &FsObjectLocal{local: f, remote: remote, path: path}if info != nil {o.info = info@@ -173,7 +179,7 @@ func (f *FsLocal) ListDir() fs.DirChan {// Puts the FsObject to the local filesystemfunc (f *FsLocal) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error) {- dstPath := filepath.Join(f.root, remote)+ dstPath := path.Join(f.root, remote)// Temporary FsObject under construction - info filled in by Update()o := &FsObjectLocal{local: f, remote: remote, path: dstPath}err := o.Update(in, modTime, size)