Christian Smith wrote:

On Fri, 3 Sep 2004, Greg Miller wrote:
I guess the UNIX folks just didn't know any better way back then.
Putting globbing in the API instead of the shell is a much better
approach, but that wasn't all that obvious when UNIX first came along.


You condone the DOS/Windows (lack of) approach?

Put it in a library, yes. But it is still best done by the shell (IMHO.)
The shell is written once, so for the common case, globbing only has to be
implemented in one place.


And for anything even slightly uncommon, life becomes more difficult. It's hard to produce good error messages in some cases, certain command syntaxes become impossible, many commands (e.g., find) need wildcard args quoted in order to prevent the shell from screwing them up, you have to work around commandlines that exceed the length limit, etc. As both a user and programmer on UNIX(ish) operating systems, I've come to be quite annoyed by this behavior.

Having every utility do it's own globbing results is code reuse for the
sake of code reuse. I prefer just having a list of files the user wants
manipulated.


Putting globbing support in the API makes it easy without destroying information about the arguments. UNIX(ish) platforms ended up having to do this, anyway with functions like glob().

I do recall reading both the DDJ column you mentioned and the follow-up in which he acknowledged the problems with shell globbing, BTW.
--
http://www.velocityvector.com/ | "F--- 'em all. That's how I feel."
http://www.classic-games.com/ | -- Michael Moore on small business
http://www.indie-games.com/ |

Reply via email to