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

Oesi50
 2004-06-21 18:10
#83624 #83624
User since
2004-05-15
33 Artikel
BenutzerIn
[default_avatar]
hallo Steffen,
versuchs mal so:

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 

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);
if (-f "$file") {
$ftp->ascii;
my $remote_name = $ftp->put($file);
$remote_name or die "$server: cannot put $file: " . $ftp->message;
}

$ftp->quit;


[edit: ist repariert]\n\n

<!--EDIT|Oesi50|1087845383-->

View full thread perl code um text files unix2dos konvertieren