Create Directory
mkdir("/path/to/my/dir", 0700);
?>
delete dir
rmdir($dir);
Permissions :
chmod("/adirectory/", 0777); //Will CHMOD a directory
chmod("/adirectory/afile.txt",0777); //Will CHMOD a file
delete file:
// Then unlink :)
unlink($somefile);
example:
function SureRemoveDir($dir, $DeleteMe) {
if(!$dh = @opendir($dir)) return;
while (false !== ($obj = readdir($dh))) {
if($obj=='.' || $obj=='..') continue;
if (!@unlink($dir.'/'.$obj)) SureRemoveDir($dir.'/'.$obj, true);
}
closedir($dh);
if ($DeleteMe){
@rmdir($dir);
}
}
PHP Files n Directory manipulation
Labels: PHPby gini at 9:18 PM
Subscribe to:
Post Comments (Atom)
support and powered by colorvibes | visit Blog and Web
0 comments:
Post a Comment