WebPagetest Forums
Deletion of directory "results" - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: Deletion of directory "results" (/showthread.php?tid=13457)



Deletion of directory "results" - nikosd66 - 12-30-2014 02:17 AM

When I run a server only as a relay test server and the "results" directory is empty, then the "delete.php" script, not only removes the "relay" subdirectory and its contents but also removes the "results" directory. To prevent this I did the above change in the "delete.php":

Original code:

// delete empty directories above this one
do {
$testPath = rtrim($testPath, "/\\");
$testPath = dirname($testPath);
rmdir($testPath);
} while( strpos($testPath, 'relay') );


changed to:

// delete empty directories above this one
while(strpos($testPath, 'relay')) {
$testPath = rtrim($testPath, "/\\");
$testPath = dirname($testPath);
rmdir($testPath);
}


RE: Deletion of directory "results" - pmeenan - 12-30-2014 04:50 AM

Thanks, just pushed your change. Should be in the next release: https://github.com/WPO-Foundation/webpagetest/commit/2ddcdae2a0e1707a9a3dd2ce08f19057847c01c7