Page 1 of 1

File redirection fixed

Posted: Wed Jun 05, 2019 6:38 am
by stefano
I finally spotted the main problem preventing the file redirection from working correctly.
I suspect there are still problems with operations on multiple files in parallel, but this is a bit step forward.

For those not being aware of it, the CP/M, MSX and OSCA programs are by default able to deal with stdin/stdout redirection, thus, in example, any program output will be appended to a file just by specifying an extra parameter like ">>file.txt".

Redirection can be disabled by altering the environment with a #pragma directive:
#pragma output noredir

More functions can be stripped in a similar way, e.g. for CP/M:
#pragma output nostreams - No stdio disc files
#pragma output nofileio - No fileio at all, use in conjunction to "-lndos"
#pragma output noprotectmsdos - strip the MS-DOS protection header
#pragma output protect8080 - add a check to block the program when on an 8080 CPU (not compatible)
#pragma output noredir - do not insert the file redirection option while parsing the
command line arguments (useless if "nostreams" is set)
#pragma output nogfxglobals - No global variables for graphics (required for GFX on TIKI-100, Einstein, and Spectrum +3)