private static function doReportTempDir(PrintStream $out)
    {
        $tempdir = PhingFile::getTempDir();
        if ($tempdir == null) {
            $out->println("Warning: php.tmpdir is undefined");
            return;
        }
        $out->println("Temp dir is " . $tempdir);
        $tempDirectory = new PhingFile($tempdir);

        if (!$tempDirectory->exists()) {
            $out->println("Warning, php.tmpdir directory does not exist: " . $tempdir);
            return;
        }

        $now = time();
        $tempFile = PhingFile::createTempFile('diag', 'txt', $tempDirectory);
        $fileWriter = new FileWriter($tempFile);
        $fileWriter->write('some test text');
        $fileWriter->close();

        $filetime = $tempFile->lastModified();

        $tempFile->delete();

        $out->println("Temp dir is writeable");
        $drift = $filetime - $now;
        $out->println("Temp dir alignment with system clock is " . $drift . " s");
        if (abs($drift) > 10) {
            $out->println("Warning: big clock drift -maybe a network filesystem");
        }
    }