Sailo100
asked on
PHP Rename Permission Denied - Error Handlng
My website maintains a database along with a set of folders on my server. The Syncronization between these is working fine. By this I mean if you add a record to the table a folder is created with the same name, if you rename the record the folder is renamed to the new name etc etc.
The problem i am having is that becuase we run a Windows 2003 server and remote desktop onto it to do various other file management tasks to the contents within these folders created by the website you can provoke a Permission Denied error on the website by accidently having a file open within a folder that PHP wishes to rename!
I understand that this is what should happen as the results are the same within Windows but instead of my website just keeling over with an error message i would like to pop up a message saying "Folder in use : rename not possible, try again later...." or something along those lines?
I have tried :
if (!rename($old_folder, $new_folder)) .....
But this does not work...
Is there another way around this?
The problem i am having is that becuase we run a Windows 2003 server and remote desktop onto it to do various other file management tasks to the contents within these folders created by the website you can provoke a Permission Denied error on the website by accidently having a file open within a folder that PHP wishes to rename!
I understand that this is what should happen as the results are the same within Windows but instead of my website just keeling over with an error message i would like to pop up a message saying "Folder in use : rename not possible, try again later...." or something along those lines?
I have tried :
if (!rename($old_folder, $new_folder)) .....
But this does not work...
Is there another way around this?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This does not appear to work.... I still get permission denied?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect thanks guys! I've always wanted to know what @ was used for :-)
ASKER