gdrive icon indicating copy to clipboard operation
gdrive copied to clipboard

Directory upload in Win

Open PSolera opened this issue 11 years ago • 7 comments

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

PSolera avatar Apr 25 '15 08:04 PSolera

Have you tried using an absolute path to the folder ?

Drezzler avatar Apr 30 '15 18:04 Drezzler

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?

aglim avatar May 27 '15 08:05 aglim

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

SDCC-gholder avatar Jun 12 '15 13:06 SDCC-gholder

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

hwiorn avatar Jul 18 '15 05:07 hwiorn

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 avatar Jul 18 '15 15:07 prasmussen

@prasmussen, i tested drive-windows-x64.exe v1.9.0 and it works.

mago27 avatar Jul 18 '15 20:07 mago27

Great, thanks.

prasmussen avatar Jul 19 '15 09:07 prasmussen