PDA

View Full Version : a quick one to solve -- deleting nuisance files (Perl)


sarah_anne
05-19-2003, 10:03 PM
I have a problem...

Due to an AWOL Perl script, I have a folder in my cgi-bin called backup which contains two files (nonsense names, i.e. one of them is "hmzvzfhafozosysfshaxhfz shdzvzxhmznzyhazyzdzyhszzzczv hdzkzihyaaahszayaoasszhdaasaa dahansnazadaoaishzpspa khcssafhfaasoadsdadac")...

When I try and delete the "backup" folder with WS_FTP in the cgi-bin along with these files, i can't -- the "Delete of backup failed!".

If i try and delete the two files individually it says the deletion "failed".... same if i try and rename the files...

I haven't set permissions on any of the files (don't need to with my host) and it's only this rogue script that's caused all this....

I once had a similar problem, years ago... and a handy little perl script worked fine and deleted the stray file.... any advice on that, anyone? (please!)

I've looked at info on the web for help, but nothing any website suggests works... one suggested something like rm - backup but that just HID all the files -- the directory was still there and showed up when i listed all files with -al. Others suggest something similar in a perl script ("rm something.. something..something..." doesn't work anyway.)

I don't know what else to try..?

Help :(

Sarah.

ACJavascript
05-20-2003, 05:22 PM
mabye this will work..

Copy and save this as Deleter.cgi
------

#!/usr/bin/perl

$ScriptName="asdflaksjdflakjfd";

unlink("$ScriptName") || print "Sorry but we couldn't find $ScriptName File";
exit;

---------


Its small but might work lol :D