function to know the created date of a folder

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
johnhelen
Forum Commoner
Posts: 45
Joined: Mon Feb 19, 2007 9:17 pm

function to know the created date of a folder

Post by johnhelen »

Hello all

Could you please tell me the function to know the created date of a folder

Many thanks

john
mrkite
Forum Contributor
Posts: 104
Joined: Tue Sep 11, 2007 4:19 am

Post by mrkite »

stat() would do it.
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

If your on linux, you can use exec() along with some linux command to show it..

(Just an example, im still new to linux)

Code: Select all

ls -l --time=ctime /var | grep "test"
Result

Code: Select all

drwxr-xr-x 18 kyle root  4096 2007-09-12 19:44 test
johnhelen
Forum Commoner
Posts: 45
Joined: Mon Feb 19, 2007 9:17 pm

Post by johnhelen »

Thanks

But stat() function is only for file, not for directory

exec() function is for only linux and I need for window as well

I need this as I need to delete folders (tmp) that is two weeks old in my system


Regards
mrkite
Forum Contributor
Posts: 104
Joined: Tue Sep 11, 2007 4:19 am

Post by mrkite »

johnhelen wrote: But stat() function is only for file, not for directory
Since when? It works on directories just fine. At least it does under unix.. maybe windows is different?
Post Reply