google / skicka

Command-line utility for working with Google Drive. Join the mailing list at https://groups.google.com/forum/#!forum/skicka-users.
Apache License 2.0
1.3k stars 118 forks source link

Resume download #93

Open Hunsu opened 9 years ago

Hunsu commented 9 years ago

Please implement the possibility to resume a download.

mmp commented 9 years ago

Unfortunately it isn't obvious how to do this given the Drive APIs. (But maybe it can be possible with some creative thinking...)

The issue is that, given a partially downloaded file, we need to be able to figure out if the bytes in the file so far match the starting bytes of the file on Drive. Drive will happily give us the MD5 checksum of the whole file, which doesn't help, or will give us the last modification time of the file, which might help: we'd need to store the Drive-side modification time of the file locally when we start a download and then compare that to the Drive-side modification time before trying to resume a partial download.

In turn, it's not obvious where best to store that information locally: perhaps a temporary directory. (But then there's the issue that it's important to be sure to clean up those files eventually as well..)

Hunsu commented 9 years ago

The solution maybe is to add a --resume option for download command, so when the file already exist try to resume the download.