Topic awaiting preservation: PHP --> looping through directory (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: there...no..there..... |
posted 10-16-2003 19:27
I have a directory called "post" that I need to loop through and open each file. code: <?
code: <?
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 10-16-2003 19:41
Well, this: |
Maniac (V) Inmate From: there...no..there..... |
posted 10-17-2003 01:37
Bit: |
Maniac (V) Inmate From: there...no..there..... |
posted 10-21-2003 14:26
Here are the errors that I get with that code. Got any suggestoins as what is freaking going wrong? quote:
|
Maniac (V) Mad Scientist From: :morF |
posted 10-21-2003 14:30
The only problem you really have there is that the directories or files you're trying ot open, you don't have permission to open, then the two file handler functions after that (what I'm assuming are fread() and fclose()) won't validate since the file variable you're handing them essentially doesn't exist. This repeats three times in the file since you try to do the same thing each time... |
Maniac (V) Inmate From: there...no..there..... |
posted 10-21-2003 15:43
Well maybe I just don't understand the whole "permission" thing. This is just running on my home box with phpDev for practice and testing. |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 10-21-2003 20:37
It looks like your code is trying to open things it shouldn't. You need to include something in your code to stop fopen() from trying to open the . and .. which are directories, not files. Something like this: code: if($readdir !== '..' && $readdir !== '.') {
code: $filename = "posts/1066250730posts.dat";
|
Maniac (V) Inmate From: there...no..there..... |
posted 10-21-2003 21:13
quote:
|