Hello Monks: I am writing a perl script that download files from a directory C:/Users/Win7/Desktop/intenship doc2 in the local machine added to an ftp server, to another directory C:/users/Desk/personal in the same local machine not added to the ftp server. When I run the script the server outputs an error: (000019)4/4/2012 12:20:20 PM - terence (127.0.0.1)> 550 CWD failed. "/C:/Users/Win7/Desktop/intenship doc2": directory not found. I checked the directory investigating if i have mixed up the cases of the letters but everything was O.K, Can the monks help m? here is the code

#!/usr/local/bin/perl use DBI; use Net::FTP; use File::Basename; #connection paraneters to localhost $IP='127.0.0.1'; $users='Terence'; $password='christine'; $directory="C:/Users/Win7/Desktop/intenship doc2/"; #Connection to netboss $ftp = Net::FTP->new($IP, Debug => 0, Passive => 0) or die "cannot + connect"; $ftp->login($users,$password); $ftp->cwd($directory); #list files @fichier=$ftp->ls($directory); foreach (@fichier) { $file = basename($_); if($file = "00wa-mb") { $ftp->get($file,"C:/users/Desk/personal".$file); } $ftp->quit;

In reply to script for accessing ftp servers by terrytedzi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.