PHP » PYTHON |
login |
register |
about
|
|
This example does not create the file if it does not exist, but is otherwise the same:
import os os.utime(filename, None) # uses current time os.utime(filename, (atime, mtime)) touch(PHP 4, PHP 5) touch — Sets access and modification time of file Description
bool touch
( string $filename
[, int $time= time()
[, int $atime
]] )
Attempts to set the access and modification times of the file named in the filename parameter to the value given in time . Note that the access time is always modified, regardless of the number of parameters. If the file does not exist, it will be created. Parameters
Return ValuesReturns TRUE on success or FALSE on failure. Changelog
Examples
Example #1 touch() example
<?php
Example #2 touch() using the time parameter
<?php
Notes
Warning
Prior to PHP 5.3.0 it was not possible to change the modification time of a directory with this function under Windows. |
more
Recently updated
more
Most requested
more
Last requests
|