Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/File-input-output/Lisaac/file-input-output.lisaac
Normal file
32
Task/File-input-output/Lisaac/file-input-output.lisaac
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue