[comp.sys.amiga.tech] Closing Redirected stdout/stdin

brianm@sco.COM (Brian Moffet) (07/21/88)

Does anyone know how to effectively close the stdout of a program
which has been redirected?

example:
1> foo > df1:fip

foo writes for a while, and then decides that it has written enough
on this particular floppy and requests another.  I would like the
file to be closed and the inode (?) to be updated.  I have tried
fclose(stdout), close( fileno(stdout) ), but neither of these seem to
work.  It will not close the redirected file.  Will Close( Output() )
do the trick?  

Also, suppose I have a program which is going to run for a long time
and write to a file every now and then.  How can I make sure that the
file is actually updated so that if there is a power outage or some such,
I don't loose all of my data?  I realize that I might be able to 
find it by scanning the floppy directly, but I want to be able to 
open the file afterward and find my info.  Currently, the only way I can
think of doing this is to open, write, close the file every now and then.
Unfortunately, this is _slow_.

One of the reasons I like Unix is exactly the above problem.  Any way
of getting the ami-dos to do inode (FAT?) updates without
closing the file?

thanks much
-- 
Brian Moffet		brianm@sco.com  {uunet,decvax!microsof}!sco!brianm
The opinions expressed are not quite clear and have no relation to my employer.
'Evil Geniuses for a Better Tommorrow!'