Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Unlink problem

2:54 pm on May 26, 2010 (gmt 0)

10+ Year Member

Hey guys, I need some help here.
I have 1 server running on Mac OS X and on that server I run a few domains. I need a scalable solution for clients to manage their websites via Perl based file browser and rich text editor.


domain01.com here I have my CGI-Perl Directory
domain02.com here I have a clients website running
domain03.com here I have a clients website running
domain04.com here I have a clients website running

I use a Perl based file browser to write webpages into domain 01 02 and 03. The Perl based file browser needs to be able to unlink files on domain 01 02 and 03. Creating directories and renaming them works fine but unlinking doesn't All domains run on the same webserver.

Do I need to send admin permissions with the unlink request and if so, how do I do that?

Thank in advance,

3:32 pm on May 26, 2010 (gmt 0)

5+ Year Member

Hi Ton, I think what you are looking for is the 'rmdir' command. 'unlink' is more for use with files, not directories: [perldoc.perl.org ]
3:44 pm on May 26, 2010 (gmt 0)

10+ Year Member

Hello Mat, I am trying to remove files and folders from domain01 02 and 03 Via a CGI that is running on domain01. I dont want to put my complete CGI directory in every client domain. Like I said, renaming and creating files and folders works file only deleting doesnt.


3:55 pm on May 26, 2010 (gmt 0)

5+ Year Member

From your original post, it sounds like you are fine with the files, but it is the deleting of the directories that is not happening--is this correct? If so, you should probably take a peak at the documentation I posted before. Basically, 'unlink' won't work on directories unless you are running the Perl process as the superuser, and with a special '-U' flag enabled. The docs go on to say that not only is 'unlink' not the safest way to remove directories, it doesn't even work on a number of operating systems (perhaps OS X is one?). That's where 'rmdir' is preferred.

If unlink isn't working on files either, check $! after a failed delete for some error information (might not be super-useful, but at least it is something).
4:08 pm on May 26, 2010 (gmt 0)

10+ Year Member

Matt, thank you for your replies. I must be a bit tired. I found out I probably deleted the line where I chdir into the folder where I want to delete files and folders. Found it! Works again. pfew;-)

Thanx again,


Featured Threads

Hot Threads This Week

Hot Threads This Month