{
if (strlen($this->dir) > 1) {
require_once 'System.php';
- echo "rmdir {$this->dir}";
- System::rm('-r', $this->dir);
+ //System::rm('-r', $this->dir);
}
}
+
+ function rmdir($dir) {
+ require_once 'System.php';
+ $rm = System::which('rm');
+ $cmd = "$rm -rf " . escapeshellarg($dir);
+ `$cmd`;
+
+
+ }
+
function generateTempDir()
{
+
+ $tn = '/var/lib/php5/mtrackworkingdirlEwD96a';
+ if (file_exists($tn)) {
+ $this->rmdir($tn);
+ }
+ clearstatcache();
+ if (file_exists($tn)) {
+ die("OOPS");
+ }
+ return $tn;
+
$tn = tempnam(ini_get('session.save_path'),'mtrackworkingdir');
unlink($tn);
return $tn;