RosettaCodeData/Task/File-input-output/Lisaac/file-input-output.lisaac

33 lines
526 B
Plaintext

Section Header
+ name := FILE_IO;
Section Public
- main <- (
+ e : ENTRY;
+ f : STD_FILE;
+ s : STRING;
e := FILE_SYSTEM.get "input.txt";
(e != NULL).if {
f ?= e.open_read_only;
(f != NULL).if {
s := STRING.create(f.size);
f.read s size (f.size);
f.close;
};
};
(s != NULL).if {
e := FILE_SYSTEM.make_file "output.txt";
(e != NULL).if {
f ?= e.open;
(f != NULL).if {
f.write s from (s.lower) size (s.count);
f.close;
};
};
};
);