Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

php filemtime fails?

I prepared a "cleanup" program to delete old unneeded files from a web server; it is set as a cron job to run on the First day of every month. To make sure is was working, I put a bunch of echo's into the program (see attached).

I get this for every file:

Warning: filemtime(): stat failed for /home/lakoshva/public_html/zips/29834zip.zip in /home/lakoshva/public_html/delete_old_files.php on line 21
file 29834zip.zip deleted, created 01/01/1970, size = 0.2399 MB

This is a minor point, I manually checked the affected directories & the files as desired are all gone.

What is wrong with my usage of filemtime()?

Thank you.

delete_old_files.php
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial