FTP: Difference between revisions

Content added Content deleted
(Add Nim)
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 617: Line 617:
<pre>Currently 20 files in the 'upload' directory
<pre>Currently 20 files in the 'upload' directory
Your file was stored as 512KB.zip in the current directory!</pre>
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}}==
=={{header|Phix}}==
Line 749: Line 708:
(ftp-close-connection conn))
(ftp-close-connection conn))
</lang>
</lang>

=={{header|Raku}}==
(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}}==
=={{header|REBOL}}==
Line 756: Line 757:
write/binary %README read/binary ftp://kernel.org/pub/linux/kernel/README
write/binary %README read/binary ftp://kernel.org/pub/linux/kernel/README
</lang>
</lang>

=={{header|Ruby}}==
=={{header|Ruby}}==
<lang ruby>require 'net/ftp'
<lang ruby>require 'net/ftp'
Line 866: Line 868:
}</lang>
}</lang>
{{Out}}See it in running in your browser by [https://scastie.scala-lang.org/3Lq8ehzIQTCuAOPXWofNLw Scastie (JVM)].
{{Out}}See it in running in your browser by [https://scastie.scala-lang.org/3Lq8ehzIQTCuAOPXWofNLw Scastie (JVM)].

=={{header|Seed7}}==
=={{header|Seed7}}==
The library [http://seed7.sourceforge.net/libraries/ftp.htm ftp.s7i] contains functions to
The library [http://seed7.sourceforge.net/libraries/ftp.htm ftp.s7i] contains functions to