summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/resources/reset-temp-file.php
blob: 186376b544427b90d49d0a6100f1dc35c787d3b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?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'];

if (!file_put_contents($tmpFile, "test")) {
    echo "FAIL: unable to write to file: " . $tmpFile . "\n";
    exit();
}
if (!unlink($tmpFile)) {
    echo "FAIL: Unable to delete file: " . $tmpFile . "\n";
    exit();
}
?>