Normal Behaviour for "Recurse Subdirectories"

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Normal Behaviour for "Recurse Subdirectories"

Post by Ambush Commander »

I've been writing a wrapper class for 7-Zip with unit testing and a strange thing confronted me the other way: When I performed a query like this:

Code: Select all

7z a -r- archive.7z -i!"files/*"
With -r- flag disabling recursion and * a wildcard ("files/*" being the files I want to compress), it still compressed all the files in the subdirectories of files. I found this behaviour a little strange and so did some other people on the Help forum, apparently. Unfortunantely, 7-Zip's maintainer Igor Pavlov says that (and I'm paraphrasing) the recursion parameter is for file wildcards like *.doc and *.txt (not suprisingly, he's right, those parameters do work). However, I think this is extremely counter-intuitive.

Can other people back me up on this claim? And if this really indeed the case (the behaviour of the recurse is incorrect), should I have the interface I provide for recursion transparently "fix" this bug (done by excluding files like: "files/*/")?

Edit - Fix AOL smurfing of r's
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I smell herring.... :?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Err... you mean a "red herring"?

If * is a wildcard, then with recursion, * selects all files in all subdirs, and without it, * just selects in the root folder and doesn't go into the subdirs... hmph... it must be how you define a wildcard, isn't it?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yeah.. it hindges on his definition of wildcard.. It's behaviour is against what I'd consider S.O.P. for them...
Post Reply