メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

File::touchDirectory

Change the modification time of the files in a directory

Description​

public void File::touchDirectory( string $directory, string $datetime )

Sets the modification time of every file and subdirectory under $directory (recursively) to $datetime. $datetime is parsed with strtotime(); nothing happens when it cannot be parsed.

Arguments​

NameData typeDefaultRemarks
$directorystringTarget directory
$datetimestringDate and time (any strtotime() format)

Example​

Controller
use Fegg\Tool\File;

$file = new File();
$file->touchDirectory('path/to/foo', '2024-04-01 10:00:00');