Topic awaiting preservation: File last modified in PHP (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: New Jersey, USA |
posted 01-17-2002 23:54
I'm trying to write a script that opens a directory, goes through all the files, and sorts them according to the times the files were last modified. I've got the part of the script done that gets the files. I'm running into trouble when I try to get the modified times for each file. I'm using the filemtime() function. The strange part is, I get a date and time that makes sense on the . and .. files in the directory, but the files *I* put there all have the exact time and date. Now this may not seem to strange except the date and time on all of them is "31 December 1969 16:00". |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 01-18-2002 00:18
getlastmod() |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 01-18-2002 03:15
Thanks Mage |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 01-18-2002 17:07 |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 01-18-2002 18:58 |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 01-18-2002 23:42
mr.maX |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 01-19-2002 00:00
You didn't specify valid filename in filemtime() function call... It should be called like this: |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 01-19-2002 00:30
I saw your reply in the other thread, I was working on that just before I came back here. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 01-19-2002 01:44
Hmm, I've tested your code from above (with my fix) and everything worked fine... Anyway, try the following *simple* script (put it in the *same* folder where all other files are located): |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 01-19-2002 02:03
Yes, the script you wrote works from within the same folder I am trying to get the file info from. I modified my script and put it in the same file and it worked also. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 01-19-2002 02:24
Ok, now that it partially works, let's try the following script (put it one level up from "includes" folder): |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 01-19-2002 04:15
Thanks mr.maX |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 01-19-2002 11:19 |