Re: Unlink

From: Date: Wed, 20 Nov 2002 17:10:24 +0000
Subject: Re: Unlink
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-125263@lists.php.net to get a copy of this message
On Wed, 20 Nov 2002, JohnMeyer wrote: > Does unlink work with wildcards e.g unlink("somefile*.*"); No. unlink() is a thin veneer on the system unlink() call. Wildcard expansion like you have it is done by a shell glob function. You would need to replicate what the shell does - use it as a regular expression in an opendir()/readdir()/delete file on regexp match/closedir() set of operations. Or, preferably, look up the glob() function in PHP and use the return values in an unlink() call. Much better than spawning a shell process ;^) -- "... but while you're marching in the rain, doesn't the *bell* on the sax fill with water?" - jerry "Yes, Jerry ... the bell would fill with water. (un)Fortunately, this does not affect the way a sax sounds." - Fred (postings on the Clarinet BBoard)

« previous php.general (#125263) next »