unlink(directories) on localhost


#1

Hi all

My localhost refuses to delete (unlink) directories, only files. This is presumably because it doesn’t think it’s allowed to touch folders on my local machine. However, unlink(directory) works fine on a live web server.

Is there any way I can enable the deleting of directories on my local host, perhaps via the php.ini file? Is this even possible since local folders obviously don’t have CHMOD permissions?

Thanks in advance.


#2

Well this sounds more like a permissions issue with the folders.

I think this might be an issue with which operating system you are using. Sounds like you might be using windows on your local host and the live server is Unix/Linux based. This is important because the UNLINK is for deleting a FILE. However UNLINK is also works in Unix/Linux as an actual command so that might explain it, where unlink is NOT a valid Windows command.
[/quote]

Well I suggest that you try using/looking at
http://us4.php.net/manual/en/function.rmdir.php
You could also consider
http://us4.php.net/manual/en/function.shell-exec.php
or
http://us4.php.net/manual/en/function.exec.php

What exactly do you mean that Local Folders don’t have CHMOD Permissions? All files have permissions, some are just lacking any real restrictions (Such as you typically find on Windows 9x).

Hope this helps.
[/url]


#3

Thanks for that, I knew there had to be a remove_directory function but couldn’t find one and didn’t see rmdir(); I thought unlink() was only for files, but didn’t see a direcotry alternative.

When I said local folders don’t have chmod permissions, I meant that these don’t exist from the context of windows explorer mode (i.e. you can’t edit chmod by right clicking a folder in windows), I’d have to set up my local server (machine) on ftp to use chmod for my local folders, unless I’ve misunderstood the situation.


#4

Actually, Yes you can but not using CHMOD. Again, depending on your version of windos (Not 9x), you can right click on the folder and set the permissions with the security. Of course this assumes that you have the rights (typically Administrative) to perform such a task.

EIther way… Good luck.


#5

Thanks for that, I’ll look into it.