Hi I searched for this for a while on google but could not find anything
I have a script that access a directory I would like the contents of my directory to be arranged by date added descending
any help is alway's appreciated
Thank You
Arranging Contents of file by date added
Moderator: General Moderators
-
ilovetoast
- Forum Contributor
- Posts: 142
- Joined: Thu Jan 15, 2004 7:34 pm
To get file info you can use:
fileatime - for time file was last accessed, on Win32 it will return last modified time
filemtime - for time last modified
filectime - detects last time inode was changed, useless on Win32
and of course the mother of all file info commands:
stat (see http://www.php.net/manual/en/function.stat.php)
peace
fileatime - for time file was last accessed, on Win32 it will return last modified time
filemtime - for time last modified
filectime - detects last time inode was changed, useless on Win32
and of course the mother of all file info commands:
stat (see http://www.php.net/manual/en/function.stat.php)
peace
-
ilovetoast
- Forum Contributor
- Posts: 142
- Joined: Thu Jan 15, 2004 7:34 pm
Actually you could hack together a way of doing it on a Unix system.
Basically you use symlinks.
Make a symlink for each file, and never use them. Check the symlinks last modified time using lstat(). You can update and change the files all you want, without chaning the last mod (and therefore creation date) of the symlink.
Of course you'd need to filter your directory listing to get only the symlinks......
Basically you use symlinks.
Make a symlink for each file, and never use them. Check the symlinks last modified time using lstat(). You can update and change the files all you want, without chaning the last mod (and therefore creation date) of the symlink.
Of course you'd need to filter your directory listing to get only the symlinks......