Re: fileExistsAtPath with * to indicate random
Re: fileExistsAtPath with * to indicate random
- Subject: Re: fileExistsAtPath with * to indicate random
- From: "Kyle Sluder" <email@hidden>
- Date: Mon, 10 Mar 2008 12:33:18 -0400
On Mon, Mar 10, 2008 at 12:10 PM, Mr. Gecko <email@hidden> wrote:
> But it does not seem to know * as a random indicator like PHP and
> Terminal does. I can't seem to think of a way to do this so, if any
> one can help me figure this out I would be very grateful.
It's not "random", it's called a "glob" (or more formally "pattern
matching"). Your shell does that for you; when you do `ls foo*`, the
shell checks to see if there are any entries that match that pattern
in the current directory, and if so replaces the pattern with them
before executing the command; the result is the same as if you had
typed `ls foo1 foo2 foo3`. If no file exists matching that pattern,
the shell passes the pattern through unscathed, at which point ls will
complain it can't find a file named `foo*`.
The point I'm trying to make is that PHP's auto-globbing is strange.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden