Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

(Re: x 8) Problem using Net::FTP

by jarich (Curate)
on Mar 31, 2004 at 01:30 UTC ( [id://341171]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: Re: Re: Re: Problem using Net::FTP
in thread Problem using Net::FTP

1. Read perldoc File::Copy or if that's too hard read the html version over at CPAN.

2. Read my previous posts to you, particularly the bits about File::Copy.

3. Wonder why after the above you're trying to use mv through system when I've shown you a better way.

4. Realise that you're doing that mv inside a loop so of course the damn files aren't going to be there the next time around the loop!

5. Change calls to system to use move from File::Copy instead and change these lines to be outside of the second for loop, eg the place where you send the email. Remember to then check that your move succeeded (by using the unless statements like I did).

6. Rejoice because it all finally works the way it should.

Hope it helps.

jarich

Replies are listed 'Best First'.
Re: (Re: x 8) Problem using Net::FTP
by cc (Beadle) on Apr 22, 2004 at 17:26 UTC
    hi jarich

    thanks again !
    with move works well.

    sorry for asking again, but I have other question
    howto check if the first file was transfered succesfully
    and be 100% sure, that the first file is already on the remote server
    and only then send the second file ?
    my really problem is, I cannot send the second file, when the first file is not there.

    greetings
    cc
      Read the documentation. I'm sure it'll tell you what happens if it fails to upload the file. Perhaps it returns false if that happens?

      Once you know what happens after failure, you should be able to cater for that.

      I would presume that your $ftp->put($new) or die "$server: cannot put $new: " . $ftp->message; would be sufficient myself...

      If you're seeing cases where $ftp->put($new) is not returning false and if that's what the documentation says it should and the file is not being successfully transferred then that's a different matter, and one I can't help you with.

      If you are seeing cases like that then you should try to identify under what circumstances that's happening. If you can identify the circumstances, and repeat the problem, but not fix it, then that would make an excellent SOPW question.

      All the best,

      jarich

        thanks !

        greetings
        cc

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://341171]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found