folder/file permissions
Hey Ray
Just wondering if IR sets a permission level 644 on image files when it creates a folder in the image_cache root folder?
Reason I ask is that I have a script that runs through a cron to delete files and folders in the image_cache folder and is failing if there is a folder /fit/ in the sub folders (if its /crop/ or other it seems to work fine)
this is the error when I run the cron:
couldn't delete /home/sites/6a/2/2864597a2d/public_html/images/image_cache/images/products/fit<br />
PHP Warning: rmdir(/home/sites/6a/2/2864597a2d/public_html/images/image_cache/images/products/fit): Directory not empty in /home/sites/6a/2/2864597a2d/public_html/delete.php on line 14
and this is the script am running
<?php
define('PATH', '/home/sites/6a/2/2864597a2d/public_html/images/image_cache/');
function destroy($dir) {
$mydir = opendir($dir);
while(false !== ($file = readdir($mydir))) {
if($file != "." && $file != "..") {
chmod($dir.$file, 0777);
if(is_dir($dir.$file)) {
chdir('.');
destroy($dir.$file.'/');
rmdir($dir.$file) or DIE("couldn't delete $dir$file<br />");
}
else
unlink($dir.$file) or DIE("couldn't delete $dir$file<br />");
}
}
closedir($mydir);
}
destroy(PATH);
echo 'all done.';
?>
Thanks
Jamie