summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/resources/touch-temp-file.php
blob: d2829df1ab0832da5714ce811d35a1d02ca0ef00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
require_once 'portabilityLayer.php';

if (!sys_get_temp_dir()) {
    echo "FAIL: No temp dir was returned.\n";
    exit();
}

$tmpFile = sys_get_temp_dir() . "/" . $_GET['filename'];

$stat = stat($tmpFile);
if (!$stat) {
    echo "FAIL: stat() call failed.\n";
    exit();
}

$mtime = $stat['mtime'] + 1;

if (!touch($tmpFile, $mtime)) {
    echo "FAIL: touch() call failed.\n";
}
?>