[Lazarus] Use /dev/null for stdout

leledumbo leledumbo_cool at yahoo.co.id
Fri Oct 26 06:40:25 CEST 2018


> I'd need to open both stdout and stderr as /dev/null.

Both are represented as System.Text (or ObjPas.TextFile) named System.Output
and System.StdErr respectively (There are also System.StdOut and
System.ErrOutput as their alias, but it looks like they're not proper alias
but rather different instances pointing to the same file), you can
System.Close, Re-System.Assign to '/dev/null' at runtime (start of your
program, maybe?) then Re-Rewrite them. From that point onwards, every call
to Write[Ln](...) will write to /dev/null.



--
Sent from: http://free-pascal-lazarus.989080.n3.nabble.com/


More information about the Lazarus mailing list