From 6b5c2db22a9f4ffae5be741f1eef57a122dec958 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Thu, 18 Jul 1996 00:08:02 +0000 Subject: [PATCH] Add -n flag to use the current modtime rather than preserving it. --- usr.bin/fetch/fetch.1 | 8 +++++--- usr.bin/fetch/main.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1 index 4d250f9450f7..9c3094374218 100644 --- a/usr.bin/fetch/fetch.1 +++ b/usr.bin/fetch/fetch.1 @@ -1,4 +1,4 @@ -.\" $Id$ +.\" $Id: fetch.1,v 1.2 1996/07/05 01:03:20 jkh Exp $ .Dd July 2, 1996 .Dt FETCH 1 .Os @@ -7,11 +7,11 @@ .Nd retrieve a file by Uniform Resource Locator .Sh SYNOPSIS .Nm fetch -.Op Fl MPmpqr +.Op Fl MPmnpqr .Op Fl o Ar file .Ar URL .Nm fetch -.Op Fl MPmpqr +.Op Fl MPmnpqr .Op Fl o Ar file .Op Fl c Ar dir .Fl f Ar file @@ -51,6 +51,8 @@ Mirror mode: Set the modification time of the file so that it is identical to the modification time of the file at the remote host. If the file already exists on the local host and is identical (as gauged by size and modification time), no transfer is done. +.It Fl n +Don't preserve the modtime of the transfered file, use the current time. .It Fl P .It Fl p Use passive mode if you are behind a firewall. diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c index 389384d39fc5..99c782e39f5e 100644 --- a/usr.bin/fetch/main.c +++ b/usr.bin/fetch/main.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. */ -/* $Id: main.c,v 1.7 1996/07/02 01:49:47 jmz Exp $ */ +/* $Id: main.c,v 1.8 1996/07/05 00:06:36 jmz Exp $ */ #include #include @@ -63,6 +63,7 @@ char *file_to_get = 0; int http = 0; int http_port = 80; int mirror = 0; +int newtime = 0; int restart = 0; time_t modtime; @@ -102,7 +103,7 @@ rm () if (file != stdout) { if (!restart && !mirror) remove (outputfile); - else if (!mirror) { + else if (!mirror && !newtime) { tv[0].tv_usec = tv[1].tv_usec = 0; tv[0].tv_sec = time(0); tv[1].tv_sec = modtime; @@ -120,7 +121,7 @@ main (int argc, char **argv) progname = s ? s+1 : argv[0]; - while ((c = getopt (argc, argv, "D:HINPMV:Lqc:f:h:o:pmr")) != EOF) { + while ((c = getopt (argc, argv, "D:HINPMV:Lqc:f:h:o:pmnr")) != EOF) { switch (c) { case 'D': case 'H': case 'I': case 'N': case 'L': case 'V': break; /* ncftp compatibility */ @@ -152,6 +153,10 @@ main (int argc, char **argv) mirror = 1; break; + case 'n': + newtime = 1; + break; + case 'r': restart = 1; break;