Leser: 21
2011-03-17T08:08:29 reneeDu könntest mit "Rename" arbeiten...
1 2 3 4 5 6 7 8 9 10 11 12 13
if($ftp -> supported("RNFR") && $ftp -> supported("RNTO")) { print "rename supported!\n"; print "Es folgt RENAME\n"; if ($ftp->command('RNFR', 'tmpdevelop/test_ftp.pl') && $ftp->command('RNTO','tmp/test.pl')) { print "Es folgt ISFILE\n"; if ($ftp -> isfile ("tmp/test.pl")) { print "Erledigt!\n"; } } else { print "Fehler >" . $ftp->message . "<\n"; } }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Net::FTP=GLOB(0x1d31744)>>> HELP RNFR
Net::FTP=GLOB(0x1d31744)<<< 214 Syntax: RNFR <sp> pathname
Net::FTP=GLOB(0x1d31744)>>> HELP RNTO
Net::FTP=GLOB(0x1d31744)<<< 214 Syntax: RNTO <sp> pathname
rename supported!
Es folgt RENAME
Net::FTP=GLOB(0x1d31744)>>> RNFR tmpdevelop/test_ftp.pl
Net::FTP=GLOB(0x1d31744)>>> RNTO tmp/test.pl
Es folgt ISFILE
Net::FTP=GLOB(0x1d31744)>>> HELP SIZE
Net::FTP=GLOB(0x1d31744)<<< 350 File or directory exists, ready for destination name
Net::FTP=GLOB(0x1d31744)>>> HELP STAT
Net::FTP=GLOB(0x1d31744)<<< 250 Rename successful
Net::FTP=GLOB(0x1d31744)>>> STAT tmp/test.pl
Net::FTP=GLOB(0x1d31744)<<< 214 Syntax: SIZE <sp> pathname
Net::FTP=GLOB(0x1d31744)>>> PWD
Net::FTP=GLOB(0x1d31744)<<< 214 Syntax: STAT [<sp> pathname]
Net::FTP=GLOB(0x1d31744)>>> CWD tmp/test.pl
Net::FTP=GLOB(0x1d31744)<<< 211-Status of tmp/test.pl:
Net::FTP=GLOB(0x1d31744)<<< 211--rw-r----- 1 [username] users 4907 Mar 21 17:34 tmp/test.pl
Net::FTP=GLOB(0x1d31744)<<< 211 End of status
Net::FTP=GLOB(0x1d31744)>>> CWD /
Net::FTP=GLOB(0x1d31744)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1d31744)>>> PWD
Net::FTP=GLOB(0x1d31744)<<< 550 tmp/test.pl: No such file or directory
Use of uninitialized value $c in string ne at C:/strawberry/perl/site/lib/Net/FTP/File.pm line 95.
Use of uninitialized value $e in string ne at C:/strawberry/perl/site/lib/Net/FTP/File.pm line 95.
Net::FTP=GLOB(0x1d31744)>>> PWD
Net::FTP=GLOB(0x1d31744)<<< 250 CWD command successful
Net::FTP=GLOB(0x1d31744)>>> CWD tmp/test.pl
Net::FTP=GLOB(0x1d31744)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1d31744)>>> CWD /
Net::FTP=GLOB(0x1d31744)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1d31744)>>> PWD
Net::FTP=GLOB(0x1d31744)<<< 550 tmp/test.pl: No such file or directory
Use of uninitialized value $c in string ne at C:/strawberry/perl/site/lib/Net/FTP/File.pm line 95.
Use of uninitialized value $e in string ne at C:/strawberry/perl/site/lib/Net/FTP/File.pm line 95.
$ftp->rename( OLDNAME, NEWNAME )
$ftp->command('CPFR', 'dir/test.txt') && $ftp->command('CPTO','dir2/test.old.txt');
1 2 3 4 5 6 7
if ($ftp->command('CPFR', 'pfad1/test_ftp.pl') && $ftp->command('CPTO','pfad2/test.pl')) { print "OK\n" } else { print "Fehler >" . $ftp->message . "<\n"; } print "setze binary\n"; $ftp->binary; exit();
QuoteNet::FTP=GLOB(0xe87e84)<<< 220 ProFTPD 1.3.2rc3 Server [IP]
Net::FTP=GLOB(0xe87e84)>>> USER [username]
Net::FTP=GLOB(0xe87e84)<<< 331 Password required for [host]
Net::FTP=GLOB(0xe87e84)>>> PASS ....
Net::FTP=GLOB(0xe87e84)<<< 230 User [adresse] logged in
Net::FTP=GLOB(0xe87e84)>>> CPFR pfad1/test_ftp.pl
Net::FTP=GLOB(0xe87e84)>>> CPTO pfad2/test.pl
OK
setze binary
Net::FTP=GLOB(0xe87e84)>>> TYPE I
Net::FTP=GLOB(0xe87e84)<<< 500 CPFR not understood
1 2 3 4
if($ftp->command('CPFR', 'pfad1/test_ftp.pl') && $ftp->command('CPTO','pfad2/test.pl') && $ftp->response() == Net::Cmd::CMD_OK) { ... }
2011-03-20T16:49:03 topegif($ftp->supported("CPFR") && $ftp->supported("CPTO")){...}
2011-03-21T11:26:36 topegSchau aber mal nach ob es auch wirklich so funktioniert.