Page 1 of 1
read file with astericks in the name
Posted: Fri Oct 11, 2002 3:43 pm
by ellickjohnson
I and trying to read a file file file(). The filename I am using needs to have astericks "*" in the name. PHP says " File not found if I use the *'s but if I put the full file name in it works fine. Any suggestions? I have tried escaping the *'s but no luck there.
Thasnk,
Ellick
Posted: Fri Oct 11, 2002 3:48 pm
by volka
you want to open a file that has a * within the filename or want to use * to match an incomplete filename?
Posted: Fri Oct 11, 2002 4:24 pm
by EvilWalrus
an asterisk isn't a valid filename char is it?
Posted: Fri Oct 11, 2002 8:11 pm
by volka
Posted: Tue Oct 15, 2002 4:17 pm
by ellickjohnson
I want to open a file using an asterik i.e. the file i want to open is 123stuffthatchanges789.txt
i'm trying to use file("123*789.txt");
is this possible?
Thanks
Posted: Tue Oct 15, 2002 5:20 pm
by hob_goblin
You would probably want to use readdir(), preg_match() and then your fopen() etc functions.
Read dir will get the file list, preg match will pick out the file, and then you can go from there.