Modify file date on server

Use this snippet to modify the access and modification times of a file on the server

Usage

This sets the access and modification times of a file on the server.
Returns true or false.
So call it like:


if (!set_file_mod_time('/home/user/public_html/file.txt', '23 November 2008 22:30:10'))
{
echo 'Something went wrong';
}
else
{
echo 'Modified time changed!';
}

Of course the pitfall is that the process must own the file. On a plain environment
it should be nobody or www the file owner.

Comments

Posted on 25.12.2008 06:50 by guest

thanks, got it!