gdrive
gdrive copied to clipboard
Exporting a file with whitespaces in its name fails
Issue
Exporting a file that has whitespaces in its name on Google Drive
gdrive export <FILE_ID>
fails:
Unable to create new file 'File name with whitespaces.pdf': open File name with whitespaces.pdf: no such file or directory
Solution
The argument (i.e. the file name) to the open
call should probably be escaped or quoted to prevent the above error.
This also has a problem with a document name contains a slash.
Unable to create new file 'SuchandSuch/Documentation for X.htm': open SuchandSuch/Documentation for X.htm: no such file or directory
doing a mkdir SuchandSuch
and trying again gets past this. Obviously slashes cause a problem with local filesystems, but needing to make the directory in order to export a single file is non-obvious (well, obvious to someone who knows what "no such file or directory" means when a filename has a slash, but that's not necessarily common knowledge).