Page 1 of 1

checking if a file exists on my file system

Posted: Mon Jan 30, 2006 6:04 am
by jasongr
Hello people

I need to find whether a file that begins with a certain prefix exists on my file system
The file starts with '1_'
It could be for example:
1_test.jpg
1_hello.jpg

basically it must start with '1_' but the rest cannot be assumed

Function file_exists takes a complete file name and returns true if it exists
it is only useful if I know the full file name (which I don't in my case)

is there a way to solve this (possible using regular expressions with file access)?

I'd rather not traverse the entire folder which contains 2000+ files

regards

Posted: Mon Jan 30, 2006 6:06 am
by foobar
glob() - Find pathnames matching a pattern