🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #9360

Closing Redirected stdout/stdin

#9360
From: Brian Moffet
Date: Thu, 21 Jul 1988 16:43
31 lines
1670 bytes
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!'
Technical Details
Message-ID: <682@viscous>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!sco!brianm

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!sco!brianm
From: brianm@sco.COM (Brian Moffet)
Newsgroups: comp.sys.amiga.tech
Subject: Closing Redirected stdout/stdin
Keywords: How to do it
Message-ID: <682@viscous>
Date: 21 Jul 88 16:43:31 GMT
Organization: The Santa Cruz Operation, Inc.
Lines: 31