Gdrive: Filenames with forward slash (/) create erroneous directories upon download

Created on 18 Mar 2016  ·  2Comments  ·  Source: prasmussen/gdrive

Suppose you have a file in Google Drive named:

assets-cdn.github.com/images/modules/logos_page/Octocat.png

$ gdrive download 0BxsqC-<redacted>
Downloading assets-cdn.github.com/images/modules/logos_page/Octocat.png -> assets-cdn.github.com/images/modules/logos_page/Octocat.png
Downloaded 0BxsqC-<redacted> at 35.4 KB/s, total 35.4 KB
$ tree
└── assets-cdn.github.com
└── images
    └── modules
        └── logos_page
            └── Octocat.png

This behavior is suboptimal. Perhaps replace the forward slashes with underscores or another token to preserve as closely as possible the filename in Google Drive?

Most helpful comment

n.b. this is also problem with gdrive export ... but instead gdrive will fail after attempting to write the file to the erroneous path.

$ gdrive export --force --mime "application/vnd.openxmlformats-officedocument.wordprocessingml.document" 1ZdRRv<redacted>
Unable to create new file 'test / file/ with / bad/name.docx': open test / file/ with / bad/name.docx: no such file or directory

All 2 comments

n.b. this is also problem with gdrive export ... but instead gdrive will fail after attempting to write the file to the erroneous path.

$ gdrive export --force --mime "application/vnd.openxmlformats-officedocument.wordprocessingml.document" 1ZdRRv<redacted>
Unable to create new file 'test / file/ with / bad/name.docx': open test / file/ with / bad/name.docx: no such file or directory

this is the case with all the windows reserved characters:

< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jnovotny picture jnovotny  ·  3Comments

ijunaid8989 picture ijunaid8989  ·  4Comments

Tacioandrade picture Tacioandrade  ·  3Comments

GaryFurash picture GaryFurash  ·  3Comments

4getit picture 4getit  ·  4Comments