PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] fflush
Date: Sunday, 06 Sep 2020, 21:51:10


    > Message Posted By: Unknown
    >
    > How do we flush the buffer before a system() call? On the pset, it says
    > fflush(), but I'm getting a bit confused on what the input to fflush
    > should be in this case.

-print prints to stdout; -exec may as well, depending on
the command executed.  To ensure that the two outputs
are intermixed correctly, fiend must flush the buffer
for the FILE pointer stdout before it calls system() to
to execute the command.

Note that system() is a library function that causes
a bash shell to execute a command.  It is not the same
as a system call.

--Stan-
PREV INDEX NEXT