-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hrvoje Niksic wrote: > Micah Cowan <[EMAIL PROTECTED]> writes: > >> Someone just asked on the #wget IRC channel if there was a way to >> exclude files with certain names, and I recommended -X, without >> realizing that that option excludes directories, not files. >> >> My question is: why do we allow users to exclude directories, but >> not files? > > -R allows excluding files. If you use a wildcard character in -R, it > will treat it as a pattern and match it against the entire file name. > If not, it will treat it as a suffix (not really an extension, it > doesn't care about "." being there or not). -X always excludes > directories and allows wildcards.
Yes, but -R has a lesser degree of control over the sorts of pathnames that it can constrain: for instance, if one uses -Rmyprefix*, it will match files myprefix-foo.html and myprefix-bar.mp3; but it will also match notmyprefix.js, which is probably not what the user desired. > It was supposed to be a DWIM thing. Where "what I mean" is what? :) My question is: what use cases are there in which one would want to exclude directories, but not files that match that pattern? I see the utility of a general matcher against file names in general; I'm not sure I see much utility of a separate option to match against just directories. How much potential harm would it cause to replace the current behavior of -X to do the equivalent to Josh's --exclude-files? - -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGnSHx7M8hyUobTrERCJbYAJ9egX3aBBxl4QCNIQMM37KGy2Z+IACggd71 sjgvAyiXpZAaeAr0Oh7poGM= =vX0p -----END PGP SIGNATURE-----
