Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
%DASHBOARD{ section="banner" | ||||||||
Line: 298 to 298 | ||||||||
File RedirectionThere are many Forth words to format a string e.g.emit , type or print something to the console. It is also possible to fetch user input like key , accept , etc. All these words can be used on files. Nothing new for a UNIX user. Mecrisp use hooks for redirection terminal IO, these hooks can also be used for file redirection. | ||||||||
Added: | ||||||||
> > | Step by Step Redirection to a File | |||||||
Sample to use hook-emit for redirection output from ls -l to a file.
Open file test.tmp | ||||||||
Line: 351 to 352 | ||||||||
hook-emit ! ok. | ||||||||
Added: | ||||||||
> > | Redirection the Easy Waycreate fil /FIL allot 256 buffer: path path .str" test.tmp" path fil f_open drop >file ls -l >term >f_close drop | |||||||
Some helper words in redirection.fs
: >f_open ( addr c-addr -- ior ) \ open a file to redirect to (emit, type, ...) |