Guten Morgen!
Bin gerade dabei, eine FTP Verbindung auf SFTP zu ändern. Und wenn ich das richtig sehe muss ich
->dir() gegen
->list() tauschen, wenn ich bisher
Net::FTP und zukünftig
Net::FTPSSL verwende. Soweit so gut. Nur liefert mir
->list() nicht, was ich sehen möchte.
my $sftp = Net::FTPSSL->new(
'******',
Debug => 1,
Timeout => 60,
) or die 'Fehler in '.__LINE__;
$sftp->login('*****','*****') or die 'Fehler in '.__LINE__;
my $hash_ref = $sftp->list() or die 'Fehler in '.__LINE__;
print "\$hash_ref = '$hash_ref'\n";
liefert:
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Net-FTPSSL Version: 0.26
Perl: 5.016003 [5.16.3], OS: MSWin32
Server (port): ***** (21)
Keys: (Debug), (Timeout)
Values: (1), (60)
SKT <<< 220 FTP on ***** ready
SKT >>> AUTH TLS
SKT <<< 234 AUTH TLS successful
Object Net::FTPSSL Details ... (*****:21 - E)
Croak ==> (undef)
Crypt ==> E
FixGetTs ==> 0
FixPutTs ==> 0
Host ==> *****
OverridePASV ==> (undef)
Pret ==> 0
Timeout ==> 60
_SSL_arguments ==> HASH(0x32121f4)
-- PeerAddr ===> *****
-- PeerPort ===> 21
-- Proto ===> tcp
-- SSL_cert_file ===> certs/client-cert.pem
-- SSL_check_crl ===> 0
-- SSL_cipher_list ===> ALL:!LOW
-- SSL_honor_cipher_order ===> 0
-- SSL_key_file ===> certs/client-key.pem
-- SSL_server ===> 0
-- SSL_use_cert ===> 0
-- SSL_verify_mode ===> 0
-- SSL_version ===> TLSv1
_SSL_ctx ==> IO::Socket::SSL::SSL_Context=HASH(0x32122f4)
-- context ===> 46005552
_SSL_fileno ==> 3
_SSL_ioclass_upgraded ==> IO::Socket::INET
_SSL_last_err ==> SSL wants a read first
_SSL_object ==> 41446584
_SSL_opened ==> 1
buf_size ==> 10240
data_prot ==> P
dcsc_mode ==> 1
debug ==> 1
debug_extra ==> 0
io_sock_nonblocking ==> 0
io_socket_domain ==> 2
io_socket_proto ==> 6
io_socket_timeout ==> 60
io_socket_type ==> 1
last_ftp_msg ==> 234 AUTH TLS successful
mySocketOpts ==> HASH(0x2b99af4)
-- PeerAddr ===> *****
-- PeerPort ===> 21
-- Proto ===> tcp
-- Timeout ===> 60
trace ==> 0
type ==> A
>>> USER +++++++
<<< 331 Password required for <++++++>
>>> PASS *******
<<< 230 User <++++++> logged in
>>> HELP
<<< 214-The following commands are recognized (* =>'s unimplemented):
<<< CWD XCWD CDUP XCUP SMNT* QUIT PORT PASV
<<< EPRT EPSV ALLO* RNFR RNTO DELE MDTM RMD
<<< XRMD MKD XMKD PWD XPWD SIZE SYST HELP
<<< NOOP FEAT OPTS AUTH CCC* CONF* ENC* MIC*
<<< PBSZ PROT TYPE STRU MODE RETR STOR STOU
<<< APPE REST ABOR USER PASS ACCT* REIN* LIST
<<< NLST STAT SITE MLSD MLST
<<< 214 Direct comments to root@*****
>>> FEAT
<<< 211-Features:
<<< MDTM
<<< MFMT
<<< TVFS
<<< AUTH TLS
<<< MFF modify;UNIX.group;UNIX.mode;
<<< MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
<<< PBSZ
<<< PROT
<<< REST STREAM
<<< SIZE
<<< 211 End
<<+ 214 The HELP command is supported.
>>> PBSZ 0
<<< 200 PBSZ 0 successful
>>> PROT P
<<< 200 Protection set to Private
>>> PASV
<<< 227 Entering Passive Mode (85,13,151,219,196,106).
--- Host (*****) Port (50282)
>>> LIST
<<< 150 Opening ASCII mode data connection for file list
<<< 226 Transfer complete
$hash_ref = '13'
Wenn ich das Gleiche mit
->dir() von
Net::FTP mache bekomme ich eine wunderbare Hashreferenz wie ich sie mit
Net::FTPSSL auch gern hätte. Woran kann das liegen?
modedit Editiert von pq: code-tag
Last edited: 2015-03-03 11:38:56 +0100 (CET)
10 print "Hallo"
20 goto 10