[win] Как из консоли поменять дату правки файла?

Biglem

На серваке неплохо было б замести следы правки файла
как назло - там стоит винда
но есть доступ к консоли винды - возможно ли изменить дату правки из нее?
или винда слишком убога для этого?

otets-mihail

ищи в инете touch.exe

Biglem

гы
ну линукс туда портировать маза
но у меня слишком стремный шелл, чтобы это заработало легко (пхпшный)
хотя попробую все равно, может и без проблем пойдет

Biglem

эээ
ну touch.exe не позволяет менять дату модификации
она только применяет текущую
а текущую изменить у меня прав нет ;(
есть ещё варианты?

psihodog

bash-3.00$ touch --help
Usage: touch [OPTION]... FILE...
Update the access and modification times of each FILE to the current time.
Mandatory arguments to long options are mandatory for short options too.
-a change only the access time
-c, --no-create do not create any files
-d, --date=STRING parse STRING and use it instead of current time
-f (ignored)
-m change only the modification time
-r, --reference=FILE use this file's times instead of current time
-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time
--time=WORD change the specified time:
WORD is access, atime, or use: equivalent to -a
WORD is modify or mtime: equivalent to -m
--help display this help and exit
--version output version information and exit
Note that the -d and -t options accept different time-date formats.
Report bugs to <bug-gnu.org>.

Biglem

ну да
по подобным причинам у меня дома стоит только линух
и я люблю когда на серверах стоит nix
C:\Bepcyc\distr>touch
Usage: touch.exe <path to file>
Sets the modification date/time of <file> to the current date/time.
This is a simple version of the Unix touch program for Win32.
Written by Helge Klein, 2002, http://www.helge.mynetcologne.de
не хочу искать другую
лучше напишу сам

Biglem

вот, если кому надо такое же
код не ругать
мне нужно буквально три файлика поменять незаметно, так что мне пойдёт:
<?php
if (!isset($_GET['fname']{
return -1;
}
if (!isset($_GET['hour']{
return -1;
}
if (!isset($_GET['minute']{
return -1;
}
if (!isset($_GET['second']{
return -1;
}
if (!isset($_GET['year']{
return -1;
}
if (!isset($_GET['month']{
return -1;
}
if (!isset($_GET['day']{
return -1;
}
$hour = $_GET['hour'];
$minute = $_GET['minute'];
$second = $_GET['second'];
$day = $_GET['day'];
$month = $_GET['month'];
$year = $_GET['year'];
$FileName = $_GET['fname'];
$time = mktime($hour, $minute, $second, $month, $day, $year);
$date = date("r", $time);
if (touch($FileName, $time, $time {
echo "$FileName modification time has been changed to $date";
} else {
echo "Sorry Could Not change modification time of $FileName";
}
?>
пример использования:
http://somehost/touch.php?fname=index.php&hour...
лицензия GPL
Оставить комментарий
Имя или ник:
Комментарий: