RosettaCodeData/Task/File-input-output/Lisaac/file-input-output.lisaac
2015-02-20 09:02:09 -05:00

32 lines
526 B
Text

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;
};
};
};
);