From bb7bbcc03386089dce1353e98c071c15c45aa82f Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 30 Mar 2024 04:15:10 -0400 Subject: copy file example --- tnslc/compile/generator.tnsl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'tnslc/compile/generator.tnsl') diff --git a/tnslc/compile/generator.tnsl b/tnslc/compile/generator.tnsl index 5d71a05..28a834d 100644 --- a/tnslc/compile/generator.tnsl +++ b/tnslc/compile/generator.tnsl @@ -1,13 +1,16 @@ /; generate (utils.File fin, fout) - ~uint8 fa = fin.path.to_cstr('/') - ~uint8 fb = fout.path.to_cstr('/') - _printf(fa) - _printf(newline) - _printf(fb) - _printf(newline) + fin.open() + fout.create() + + uint8 buf = fin.read() + /; loop (fin.at_end == false && fout.at_end == false) + fout.write(buf) + buf = fin.read() + ;/ + + fin.close() + fout.close() - _delete(fa) - _delete(fb) ;/ -- cgit v1.2.3