help me to solve this!
i have a website which written in php and let users downloads files from my server .. and i do have a admin site to manage all the download files (includes:- upload, descriptions of files, delete files or delete folders)
now i have a problems ... if there are 10 persons who accessing my folder named "MP3/ENGLISH/" and they are downloading "U2.mp3" ... AND I WANT TO DELETE THE FOLDER MP3 .. it doesn't allowed cos someone is accessing the folder ... is there any way to check if there are connections currently accessed this folder, and reset all the connections using PHP?
if you are using rmdir(), the directory must be empty first, otherwise you get an error
you would need to do something like this:
$dir = "/MP3/ENGLISH";
$dh = opendir($dir);
while(($file = readdir($dh)) !== false)
if($file != '.' && $file != '..')
Last edited by ShrineDesigns; 11-23-2004 at 10:10 PM.
i know how to remove the folder .. i even write a function that remove a folder which content files inside ..
but i don't know how to remove a folder which one of the file inside that folder are currently accessed by someone ..
file in used .. we can't delete it write?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)