Directory upload in Win
Great little helper, I'm just missing a couple of details:
- Is it possible to upload full folders on a Win environment? I have tried all possible commands but I cannot make it work. drive-windows-amd64.exe upload -f test drive-windows-amd64.exe upload -f /test drive-windows-amd64.exe upload -f \test ... Any ideas?
Also, the ability of uploading new versions of a file would be a great addition, as discussed in many other posts. This would allow us to use the versioning feature in Drive.
Thanks again
Have you tried using an absolute path to the folder ?
Same trouble: I'm trying to upload a folder using
>drive-windows-amd64.exe upload -f folder
command but all I get is:
chdir [path]: not supported by windows
Is this a limitation of Go's os lib?
I also get this issue on windows
E:>C:\VeeamToGoogleDrive\drive-windows-amd64.exe -c C:\VeeamToGoogleDrive.config upload -f "Application Servers Backup Job" chdir E:\Application Servers Backup Job: not supported by windows
I found Chdir() error problem which is not implemented in Windows. (https://golang.org/src/os/os_test.go#L835)
func TestChdirAndGetwd(t *testing.T) {
// TODO(brainman): file.Chdir() is not implemented on windows.
if runtime.GOOS == "windows" {
return
}
gdrive/cli/cli.go:250
// Go into directory
err = input.Chdir() <-- "chdir [path]: not supported by windows" printed in windows.
if err != nil {
return err
}
-> https://golang.org/src/os/file.go#L224 --> https://golang.org/src/syscall/syscall_windows.go#L953
953 // TODO(brainman): fix all needed for os
954 func Fchdir(fd Handle) (err error) { return EWINDOWS }
I think gdrive need to be changed to os.Chdir(String) method below. -> https://golang.org/src/os/file.go#L214 --> https://golang.org/src/syscall/syscall_windows.go#L369
Thanks @hwiorn for doing the research :) I've just released gdrive 1.9 which uses os.Chdir, hopefully this will fix directory upload on windows. I don't have a windows machine to test it myself so feedback is appreciated.
@prasmussen, i tested drive-windows-x64.exe v1.9.0 and it works.
Great, thanks.