RosettaCodeData/Task/FTP/Seed7/ftp.seed7

19 lines
461 B
Plaintext

$ include "seed7_05.s7i";
include "ftp.s7i";
const proc: main is func
local
var ftpFileSys: ftp is fileSys.value;
var string: line is "";
begin
ftp := openFtp("kernel.org");
setActiveMode(ftp, FALSE); # Passive is the default.
chdir(ftp, "/pub/linux/kernel");
for line range listDir(ftp, ".") do
writeln(line);
end for;
setAsciiTransfer(ftp, FALSE);
writeln(getFile(ftp, "README"));
close(ftp);
end func;