"Irfan Sayed" wrote in message news:1308908614.88998.yahoomail...@web125518.mail.ne1.yahoo.com...



hi,
i need to delete some directories recursively which are present at some shared location

i tried file::path perl module but the issue with that module is , it is not deleting the root/parent dir

it deletes the subdirectories and all the files inside that but not removing root dir

here is my code:
$path = "\\\\build\\" . "f\$" . "\\Store\\build\\Internal_Builds\\Daily_Builds\\Daily\\zoc\\" . $hash_fin{$key};

print "$path\n";
print "**********\n";
 remove_tree($path,{verbose => 1,safe => 1,keep_root => 0});

now whaat i expect is , module shud delete the dir which is there in $path but it does not
plz suggest


regards
irfan

Hello irfan,

why are you using 2 leading backslashes at the start of your path?
$path = "\\\\build\\"
Shouldn't there only be 1 backslash?
$path = "\\build\\"


By the way, perl will recognize forward slashes for Windows paths like:
"/build/" . "f\$" . "/Store/build/Internal_Builds/Daily_Builds/Daily/zoc/" . $hash_fin{$key};

which will save some typing and looks better as well!

Chris

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to