-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hrvoje Niksic wrote: > Micah Cowan <[EMAIL PROTECTED]> writes: > >> 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. > > Are you sure? It certainly wasn't designed that way. Your example > should only exclude files beginning with "myprefix".
I was not sure, and based on your further explanation, was probably dead-wrong; I had assumed that -R treated its arguments as suffixes in all cases, including when wildcards are used. >>> It was supposed to be a DWIM thing. >> Where "what I mean" is what? :) > > Suffix when no wildcards are used, pattern when they are. Ah! That was not clear to me; thanks. >> My question is: what use cases are there in which one would want to >> exclude directories, but not files that match that pattern? > > I don't know. The reason directories are matched separately from > files is because files often *don't* match the pattern you've chosen > for directories. For example, -X/etc should exclude anything under > /etc, such as /etc/passwd, but also /etc/foo/bar/baz. Since '*' in > shell-like globs doesn't match '/', it is impossible to write a glob > expression to match all files arbitrarily deep under a directory. Perhaps a "**" wildcard, that matches /, would be useful; then we could combine the meanings of -X and -R (and, -I and -A). If and when we support regexes for these functions, I suppose this question will become moot; as the user can define arbitrary expressions to suit their needs. Thanks very much for your explanations; this has cleared things up greatly. - -- 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 iD8DBQFGnTWv7M8hyUobTrERCEe7AJ4zRm1hz6hTDGPOj7+38LEFLpNQlACgiB5/ mnYKjRi3+qgVS0Hj0GdH5p0= =6jgz -----END PGP SIGNATURE-----
