Thread perl code um text files unix2dos konvertieren (37 answers)
Opened by cc at 2004-06-20 04:16

cc
 2004-06-21 12:29
#83618 #83618
User since
2004-01-09
55 Artikel
BenutzerIn
[default_avatar]
geht aber immer noch nicht,obwhol der pfad zum file stimmt
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl -w

use strict;
use warnings;
use Net::FTP;
use Net::Netrc;

my $server = "X.X.X.X";
my $user = "user";
my $password = "password";
my $destination = "/www/ftp";
my $file = "/home/files/testfile.txt";

my $ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3);
$ftp or die "$server: cannot connect: $@";
$ftp->login ($user,$password) or die "$_: Could not login: " . $ftp->message;
$ftp->cwd($destination);

open FILE, '<', $file or die "open $file $!";
binmode FILE, 'encoding(cp850)' or die $!;
$ftp->put(\*FILE, $file) or die "$server: cannot put $file: " . $ftp->message;

$ftp->quit;


Net::FTP=GLOB(0x830bb28)<<< 220 ttn208 Microsoft FTP Service (Version 5.0).
Net::FTP=GLOB(0x830bb28)>>> user user
Net::FTP=GLOB(0x830bb28)<<< 331 Password required for user.
Net::FTP=GLOB(0x830bb28)>>> PASS ....
Net::FTP=GLOB(0x830bb28)<<< 230 User user logged in.
Net::FTP=GLOB(0x830bb28)>>> CWD /www/ftp
Net::FTP=GLOB(0x830bb28)<<< 250 CWD command successful.
Net::FTP=GLOB(0x830bb28)>>> PORT X,X,X,X,140,6
Net::FTP=GLOB(0x830bb28)<<< 200 PORT command successful.
Net::FTP=GLOB(0x830bb28)>>> STOR /home/files/testfile.txt
Net::FTP=GLOB(0x830bb28)<<< 550 /home/files/testfile.txt: The system cannot find the path specified.
X.X.X.X: cannot put /home/files/testfile.txt: /home/files/testfile.txt: The system cannot find the path specified.

View full thread perl code um text files unix2dos konvertieren