FTP: Difference between revisions
Rename Perl 6 -> Raku, alphabetize, minor clean-up
(Add Nim) |
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
||
Line 617:
<pre>Currently 20 files in the 'upload' directory
Your file was stored as 512KB.zip in the current directory!</pre>
=={{header|Perl 6}}==▼
{{works with|rakudo|2018.04}}▼
<lang perl6>use Net::FTP;▼
my $host = 'speedtest.tele2.net';▼
my $user = 'anonymous';▼
my $password = '';▼
my $ftp = Net::FTP.new( host => $host, :passive );▼
$ftp.login( user => $user, pass => $password );▼
$ftp.cwd( 'upload' );▼
$ftp.cwd( '/' );▼
say $_<name> for $ftp.ls;▼
$ftp.get( '1KB.zip', :binary );</lang>▼
{{out}}▼
<pre>1000GB.zip▼
100GB.zip▼
100KB.zip▼
100MB.zip▼
10GB.zip▼
10MB.zip▼
1GB.zip▼
1KB.zip▼
1MB.zip▼
200MB.zip▼
20MB.zip▼
2MB.zip▼
3MB.zip▼
500MB.zip▼
50MB.zip▼
512KB.zip▼
5MB.zip▼
upload</pre>▼
=={{header|Phix}}==
Line 749 ⟶ 708:
(ftp-close-connection conn))
</lang>
(formerly Perl 6)
▲{{works with|rakudo|2018.04}}
▲<lang perl6>use Net::FTP;
▲my $host = 'speedtest.tele2.net';
▲my $user = 'anonymous';
▲my $password = '';
▲my $ftp = Net::FTP.new( host => $host, :passive );
▲$ftp.login( user => $user, pass => $password );
▲$ftp.cwd( 'upload' );
▲$ftp.cwd( '/' );
▲say $_<name> for $ftp.ls;
▲$ftp.get( '1KB.zip', :binary );</lang>
▲{{out}}
▲<pre>1000GB.zip
▲100GB.zip
▲100KB.zip
▲100MB.zip
▲10GB.zip
▲10MB.zip
▲1GB.zip
▲1KB.zip
▲1MB.zip
▲200MB.zip
▲20MB.zip
▲2MB.zip
▲3MB.zip
▲500MB.zip
▲50MB.zip
▲512KB.zip
▲5MB.zip
▲upload</pre>
=={{header|REBOL}}==
Line 756 ⟶ 757:
write/binary %README read/binary ftp://kernel.org/pub/linux/kernel/README
</lang>
=={{header|Ruby}}==
<lang ruby>require 'net/ftp'
Line 866 ⟶ 868:
}</lang>
{{Out}}See it in running in your browser by [https://scastie.scala-lang.org/3Lq8ehzIQTCuAOPXWofNLw Scastie (JVM)].
=={{header|Seed7}}==
The library [http://seed7.sourceforge.net/libraries/ftp.htm ftp.s7i] contains functions to
|