Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,57 +0,0 @@
|
|||
with Ada.Text_IO;
|
||||
with Sf.Network.Ftp;
|
||||
with Sf.Network.IpAddress;
|
||||
with Sf.System.Time;
|
||||
|
||||
procedure Main is
|
||||
use Sf; use Sf.Network; use Sf.Network.Ftp;
|
||||
FTP_Error : exception;
|
||||
|
||||
FTP_Object : constant sfFtp_Ptr := create;
|
||||
|
||||
procedure Check_Response (FTP_Response : sfFtpResponse_Ptr) is
|
||||
Message : constant String := Response.getMessage (FTP_Response);
|
||||
begin
|
||||
Response.destroy (FTP_Response);
|
||||
if not Response.isOk (FTP_Response) then
|
||||
raise FTP_Error with Message;
|
||||
else
|
||||
Ada.Text_IO.Put_Line ("OK: " & Message);
|
||||
end if;
|
||||
end Check_Response;
|
||||
|
||||
procedure List_Directory (Path : String) is
|
||||
Response : sfFtpListingResponse_Ptr;
|
||||
begin
|
||||
Response := getDirectoryListing (FTP_Object, Path);
|
||||
if ListingResponse.isOk (Response) then
|
||||
for Index in 0 .. ListingResponse.getCount (Response) - 1 loop
|
||||
Ada.Text_IO.Put_Line (ListingResponse.getName (Response, Index));
|
||||
end loop;
|
||||
else
|
||||
Ada.Text_IO.Put_Line (ListingResponse.getMessage (Response));
|
||||
end if;
|
||||
ListingResponse.destroy (Response);
|
||||
end List_Directory;
|
||||
|
||||
begin
|
||||
|
||||
Check_Response
|
||||
(connect (FTP_Object,
|
||||
server => IpAddress.fromString ("speedtest.tele2.net"),
|
||||
port => 21,
|
||||
timeout => Sf.System.Time.sfSeconds (30.0)));
|
||||
|
||||
Check_Response (loginAnonymous (FTP_Object));
|
||||
|
||||
Check_Response (changeDirectory (FTP_Object, "/upload"));
|
||||
Check_Response (changeDirectory (FTP_Object, "/"));
|
||||
|
||||
List_Directory (".");
|
||||
|
||||
Check_Response (download (FTP_Object,
|
||||
remoteFile => "100KB.zip",
|
||||
localPath => ".",
|
||||
mode => sfFtpBinary));
|
||||
destroy (FTP_Object);
|
||||
end Main;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
system/schemes/ftp/passive: on
|
||||
print read ftp://kernel.org/pub/linux/kernel/
|
||||
write/binary %README read/binary ftp://kernel.org/pub/linux/kernel/README
|
||||
Loading…
Add table
Add a link
Reference in a new issue