On Sun, Aug 11, 2002 at 06:26:07PM +0200, Piotr Krukowiecki wrote:
> > It tries to continue when the source file is older than than the source.
> > I guess you want it to ignore the date completely?  (That'd make it
> > resume the file if the source is larger, restart it if the source is
> > smaller--since the dest file must be something else--and leave it alone
> > if it's the same size.)
> 
> Yes, that what i want. I (and imo most of people using lftp)
> use lftp only for downloading/uploading/resuming files, not for syncing
> dirs. 

But normally, dates should work, and this shouldn't be a problem, even
if MDTM isn't working.  I could make a few guesses as to what's
happening, but you keep giving contrived examples; here you touched the file
into the future, and if that's normally happening you could just touch
it back.  It'd be easier if you'd give real-world examples.

Try this; it adds --ignore-time, which makes it ignore differences in
times when deciding whether to download or continue a file.  (It still
tries to get the time, to set timestamps.)

> > > ---> STOR testfile-do_not_download
> > > [btw. the server want us to send RETR not STOR]
> > 
> > Huh?  STOR is for client->server; RETR(ieve) is for server->client.
> 
> I don't know, maybe broken ftpd :/

An FTPD that mixes up STOR and RETR wouldn't work at all.

-- 
Glenn Maynard
Index: commands.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/commands.cc,v
retrieving revision 1.186
diff -u -r1.186 commands.cc
--- commands.cc 2002/08/06 07:20:05     1.186
+++ commands.cc 2002/08/11 20:20:48
@@ -310,6 +310,7 @@
         " -e, --delete           delete files not present at remote site\n"
         " -s, --allow-suid       set suid/sgid bits according to remote site\n"
         "     --allow-chown      try to set owner and group on files\n"
+        "     --ignore-time      ignore time when deciding whether to download\n"
         " -n, --only-newer       download only newer files (-c won't work)\n"
         " -r, --no-recursion     don't go to subdirectories\n"
         " -p, --no-perms         don't set file permissions\n"
Index: MirrorJob.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/MirrorJob.cc,v
retrieving revision 1.93
diff -u -r1.93 MirrorJob.cc
--- MirrorJob.cc        2002/08/02 08:09:23     1.93
+++ MirrorJob.cc        2002/08/11 20:20:49
@@ -204,9 +204,9 @@
         {
            if((flags&CONTINUE)
            && (old->defined&file->TYPE) && old->filetype==old->NORMAL
-           && (file->defined&file->DATE)
-           && (old->defined&old->DATE)
-           && file->date + file->date_prec < old->date - old->date_prec
+           && (flags&IGNORE_TIME ||
+               ((file->defined&file->DATE) && (old->defined&old->DATE)
+               && file->date + file->date_prec < old->date - old->date_prec))
            && (file->defined&file->SIZE) && (old->defined&old->SIZE)
            && file->size >= old->size)
            {
@@ -391,6 +391,8 @@
       ignore|=FileInfo::IGNORE_SIZE_IF_OLDER|FileInfo::IGNORE_DATE_IF_OLDER;
    if(strcmp(target_session->GetProto(),"file"))
       ignore|=FileInfo::IGNORE_DATE_IF_OLDER;
+   if(flags&IGNORE_TIME)
+      ignore|=FileInfo::DATE;
    to_transfer->SubtractSame(dest,ignore);
 
    same->SubtractAny(to_transfer);
@@ -941,6 +943,7 @@
       {"use-cache",no_argument,0,256+'C'},
       {"Remove-source-files",no_argument,0,256+'R'},
       {"parallel",optional_argument,0,'P'},
+      {"ignore-time",no_argument,0,256+'i'},
       {0}
    };
 
@@ -1056,6 +1059,9 @@
         break;
       case(256+'R'):
         remove_source_files=true;
+        break;
+      case(256+'i'):
+        flags|=MirrorJob::IGNORE_TIME;
         break;
       case('P'):
         if(optarg)
Index: MirrorJob.h
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/MirrorJob.h,v
retrieving revision 1.33
diff -u -r1.33 MirrorJob.h
--- MirrorJob.h 2002/07/31 16:45:43     1.33
+++ MirrorJob.h 2002/08/11 20:20:49
@@ -121,16 +121,17 @@
 public:
    enum
    {
-      ALLOW_SUID=1,
-      DELETE=2,
-      NO_RECURSION=4,
-      ONLY_NEWER=8,
-      NO_PERMS=16,
-      CONTINUE=32,
-      REPORT_NOT_DELETED=128,
-      RETR_SYMLINKS=256,
-      NO_UMASK=512,
-      ALLOW_CHOWN=1024
+      ALLOW_SUID=1<<0,
+      DELETE=1<<1,
+      NO_RECURSION=1<<2,
+      ONLY_NEWER=1<<3,
+      NO_PERMS=1<<4,
+      CONTINUE=1<<5,
+      REPORT_NOT_DELETED=1<<6,
+      RETR_SYMLINKS=1<<7,
+      NO_UMASK=1<<8,
+      ALLOW_CHOWN=1<<9,
+      IGNORE_TIME=1<<10
    };
 
    void SetFlags(int f,int v)

Reply via email to