function Filesystem::touch
Same name in this branch
- 11.1.x vendor/php-tuf/composer-stager/src/Internal/Filesystem/Service/Filesystem.php \PhpTuf\ComposerStager\Internal\Filesystem\Service\Filesystem::touch()
Sets access and modification time of file.
Parameters
int|null $time The touch time as a Unix timestamp, if not supplied the current system time is used:
int|null $atime The access time as a Unix timestamp, if not supplied the current system time is used:
Throws
IOException When touch fails
File
-
vendor/
symfony/ filesystem/ Filesystem.php, line 131
Class
- Filesystem
- Provides basic utility to manipulate the file system.
Namespace
Symfony\Component\FilesystemCode
public function touch(string|iterable $files, ?int $time = null, ?int $atime = null) : void {
foreach ($this->toIterable($files) as $file) {
if (!($time ? self::box('touch', $file, $time, $atime) : self::box('touch', $file))) {
throw new IOException(\sprintf('Failed to touch "%s": ', $file) . self::$lastError, 0, null, $file);
}
}
}