This is a patch for wget-1.9.1 to enable the fetching of dot files over FTP: by default, these are omitted. This patch has been tested on Red Hat Linux 6.2 and FreeBSD 4.5. It doesn't look like the kind of thing that is unportable (famous last words) This patch has been posted on my web site as http://www.unixwiz.net/techtips/wget-patch.html -- Steve Friedl (steve@unixwiz.net) -- Stephen J Friedl | Software Consultant | Unix Wizard | +1 714 544-6561 www.unixwiz.net | Tustin, CA USA | Microsoft MVP | steve@unixwiz.net ChangeLog entry: 2002-08-18 Steve Friedl * added a -. and --dotfiles option to allow FTP fetches to include the dot files. Required to *really* mirror a web site over FTP --- doc/wget.texi.orig 2003-11-08 23:46:33.000000000 +0000 +++ doc/wget.texi 2004-03-12 23:53:10.502560681 +0000 @@ -1258,6 +1258,14 @@ specified on the command-line, rather than because it was recursed to, this option has no effect. Symbolic links are always traversed in this case. + +@cindex dotfiles +@item -. +@itemx --dotfiles +Enumerate files beginning with "dot" by sending the @code{LIST -a} +FTP command to the other end instead of the default @code{LIST}. May +have no effect on non-*ix platforms. + @end table @node Recursive Retrieval Options, Recursive Accept/Reject Options, FTP Options, Invoking --- src/main.c.orig 2003-10-11 13:57:11.000000000 +0000 +++ src/main.c 2004-03-12 23:53:10.489563501 +0000 @@ -233,6 +233,7 @@ -g, --glob=on/off turn file name globbing on or off.\n\ --passive-ftp use the \"passive\" transfer mode.\n\ --retr-symlinks when recursing, get linked-to files (not dirs).\n\ + -., --dotfiles retrieve files starting with dot (\"ls -a\").\n\ \n"), stdout); fputs (_("\ Recursive retrieval:\n\ @@ -280,6 +281,7 @@ { "debug", no_argument, NULL, 'd' }, { "delete-after", no_argument, NULL, 136 }, { "dont-remove-listing", no_argument, NULL, 149 }, + { "dot-files", no_argument, NULL, 181 }, { "follow-ftp", no_argument, NULL, 142 }, { "force-directories", no_argument, NULL, 'x' }, { "force-hier", no_argument, NULL, 'x' }, /* obsolete */ @@ -398,7 +400,7 @@ that the options with required arguments must be followed by a ':'. -- Dan Harkless ] */ while ((c = getopt_long (argc, argv, "\ -hpVqvdkKsxmNWrHSLcFbEY:G:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:C:", +.hpVqvdkKsxmNWrHSLcFbEY:G:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:C:", long_options, (int *)0)) != EOF) { switch (c) @@ -452,6 +454,12 @@ case 165: setoptval ("randomwait", "on"); break; + + case 181: + case '.': + setoptval ("dotfiles", "on"); + break; + case 'b': setoptval ("background", "on"); break; --- src/ftp-basic.c.orig 2003-11-08 19:17:55.000000000 +0000 +++ src/ftp-basic.c 2004-03-12 23:53:10.492562850 +0000 @@ -692,7 +692,7 @@ uerr_t err; /* Send LIST request. */ - request = ftp_request ("LIST", file); + request = ftp_request (opt.dot_files ? "LIST -a" : "LIST", file); nwritten = iwrite (RBUF_FD (rbuf), request, strlen (request)); if (nwritten < 0) { --- src/options.h.orig 2003-10-11 13:57:11.000000000 +0000 +++ src/options.h 2004-03-12 23:58:49.963062714 +0000 @@ -155,6 +155,7 @@ dot. */ int dots_in_line; /* How many dots in one line. */ int dot_spacing; /* How many dots between spacings. */ + int dot_files; /* FTP should add "-a" to "LIST" cmd */ int delete_after; /* Whether the files will be deleted after download. */ --- src/init.c.orig 2003-10-11 13:57:11.000000000 +0000 +++ src/init.c 2004-03-12 23:58:26.545138278 +0000 @@ -139,6 +139,7 @@ { "dnstimeout", &opt.dns_timeout, cmd_time }, { "domains", &opt.domains, cmd_vector }, { "dotbytes", &opt.dot_bytes, cmd_bytes }, + { "dotfiles", &opt.dot_files, cmd_boolean }, { "dotsinline", &opt.dots_in_line, cmd_number }, { "dotspacing", &opt.dot_spacing, cmd_number }, { "dotstyle", &opt.dot_style, cmd_string },