[fpc-pascal] Exec(), Linux, and /dev/null redirection
Marco van de Voort
marcov at stack.nl
Wed Feb 17 09:03:51 CET 2010
In our previous episode, cobines said:
> 2010/2/17 Zitt Zitterkopf <zittware at hotmail.com>:
> > Exec( '/bin/mount', '/dev/'+ aline +' /media/' + aline + ' &> /dev/null');
> Exec( '/bin/mount', '/dev/'+ aline +' /media/' + aline + ' 1>/dev/null');
> for redirecting STDOUT or
> Exec( '/bin/mount', '/dev/'+ aline +' /media/' + aline + ' 2>/dev/null
> for redirecting STDOUT and STDERR.
it executes a shell, and &> 1> 2> are shell commands, and won't work with
direct execution commands like exec (which is old anyway, use
> This puts stdout and stderr into one pipe however. There must be some
> way to read from stdout and stderr separately, maybe using TProcess,
> but I've never needed it so I don't know how.
TProcess is definitely the thing to look at.
More information about the fpc-pascal