homepage Welcome to WebmasterWorld Guest from 23.22.173.58
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Unlink problem
parrot




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

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.

Setup:

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,

Ton

 

mattdw




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

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 ]

parrot




msg:4140249
 3:44 pm on May 26, 2010 (gmt 0)

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.

Cheers,

Ton

mattdw




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

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).

parrot




msg:4140290
 4:08 pm on May 26, 2010 (gmt 0)

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,

Ton

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved