summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-07-18 00:08:02 +0000
committerjkh <jkh@FreeBSD.org>1996-07-18 00:08:02 +0000
commitdc8c550225559ee6cb3644e3093b13b7173d19c4 (patch)
treed2d2d01fa65bdb434ae5ed6125a199f8e230c191 /usr.bin/fetch
parent88c897a67d54cb92582372ed301e56b11a861936 (diff)
downloadFreeBSD-src-dc8c550225559ee6cb3644e3093b13b7173d19c4.zip
FreeBSD-src-dc8c550225559ee6cb3644e3093b13b7173d19c4.tar.gz
Add -n flag to use the current modtime rather than preserving it.
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/fetch.18
-rw-r--r--usr.bin/fetch/main.c11
2 files changed, 13 insertions, 6 deletions
diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1
index 4d250f9..9c30943 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 389384d..99c782e 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 <stdlib.h>
#include <stdio.h>
@@ -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;
OpenPOWER on IntegriCloud