} The function below creates folder $foldName in
} The function below creates folder $foldName in $currFolderfolder: // Create Folder function createFolder($currFolder, $foldName) { return mkdir(getAbsolutePath($currFolder.”/”.$foldName), 0700); } The following function deletes the folder $foldName which is a sub-folder of $currFolder: // Delete folder - recursively function deleteFolder($currFolder, $foldName) { global $fileSeparator; if (($dir = opendir(getAbsolutePath($currFolder . “/” . $foldName))) < 0) { return $dir; } while (($file = readdir($dir)) != null) { $absFilePath = getAbsolutePath($currFolder . "/" . $foldName) . $fileSeparator . $file; if (is_dir($absFilePath)) { if (($file != ".") && ($file != "..")) { if (($res = deleteFolder($currFolder . "/" . $foldName, $file)) < 0) { return $res; } } } else { if (($res = deleteFile($currFolder . "/" . $foldName, $file)) < 0) { return $res; } } } closedir($dir); return rmdir(getAbsolutePath($currFolder."/".$foldName)); } The function below deletes the file $fileName from $currFolder: // Delete file Page 255
Note: If you are looking for cheap and inexpensive provider to host and run your tomcat application check Actions tomcat hosting services