Hi,
I was using the FISH protocol and wanted to continue a download of a file.
However, lftp uses a "dd" trick to pipe the already downloaded bytes to
/dev/null and the rest to the client. This caused the server to spend ages
retrieving the first hundreds of megabytes from (the relatively slow)
disk.
I propose using "dd skip=X" instead, to make the server simply use a
"seek" call to skip the bytes.
Patch attached. I tested one file and verified integrity using md5sum.
I'm not sure if this method is just a portable though.
Best Regards,
Lars
diff -urw lftp-3.0.13/src/Fish.cc lftp-3.0.13-mod/src/Fish.cc
--- lftp-3.0.13/src/Fish.cc 2004-11-17 14:00:32.000000000 +0100
+++ lftp-3.0.13-mod/src/Fish.cc 2004-12-25 02:17:45.000000000 +0100
@@ -537,7 +537,7 @@
Send("#RETRP %lld %s\n"
"ls -lLd %s; "
"echo '### 100'; "
- "cat %s|(dd ibs=1 count=%lld of=/dev/null 2>/dev/null;cat); "
+ "cat %s|dd ibs=1 skip=%lld; "
"echo '### 200'\n",
(long long)pos,e,e,e,(long long)pos);
}