dat icon indicating copy to clipboard operation
dat copied to clipboard

single file download

Open joehand opened this issue 7 years ago • 9 comments

Having single file download would be cool. A couple options:

  1. dat download <key>/file.txt, dat <key>/file.txt - download file with in memory metadata
  2. dat clone <key>/file.txt - download file with sparse state

The first would be easier and can be implemented now. Second requires some sparse state tracker. This is because if you have a .dat folder and run dat sync it will try to download the whole dat by default, even if you only cloned a single file. We need some way to track:

  1. If a dat was initialized in sparse mode
  2. What files have been requested for download

This should probably happen in dat-node, since Desktop would have the same issue of sparse downloads ending up with the whole dat.

joehand avatar Jun 05 '17 22:06 joehand

sparse ness on the commandline seems like it might benefit from some sort of 'include' config (file?) that says which files should be included in the sync

okdistribute avatar Jun 05 '17 22:06 okdistribute

Or maybe just use the .datignore for that :P

okdistribute avatar Jun 05 '17 22:06 okdistribute

sparse ness on the commandline seems like it might benefit from some sort of 'include' config (file?) that says which files should be included in the sync

Ya, something like that would be necessary.

Or maybe just use the .datignore for that :P

This would be deleted and/or changed by hyperdrive if the source dat had a .datignore file in it.

joehand avatar Jun 05 '17 22:06 joehand

.datdownload cause it's the opposite of .datignore and we'd add that file to the default ignore list

mafintosh avatar Jun 05 '17 22:06 mafintosh

just noting that this should work with folders and not just files as well :)

mafintosh avatar Jun 05 '17 22:06 mafintosh

And adding that this should work also on subdirectories. So:

dat download dat://key/directory/subdirectory

mitar avatar Feb 22 '18 00:02 mitar

Tools like dat ls / dat download would def make it easier to work with large dat repositories.

I have a medium-size dat repository (dat://dcpos.ch, ~10GB). Parts of it aren't loading correctly in Beaker. To narrow down whether this is a Beaker or Dat issue, I tried downloading those files via command-line dat... and found there's no way short of dat clone-ing the whole thing.

http:// has wget and curl, IMO dat:// needs an equivalent.

dcposch avatar Sep 09 '18 08:09 dcposch

@dcposch meanwhile, there's https://github.com/millette/dat-shell/ to help you navigate a dat (cd, ls, cat) without downloading the whole thing.

millette avatar Sep 09 '18 18:09 millette

Neither dat ls or dat download should be terribly hard to implement.

pfrazee avatar Sep 09 '18 18:09 pfrazee