Thread: flushing I/O?
View Single Post
Old Jul 19th, 2006, 8:56 AM   #1
MegaArcon
Programmer
 
MegaArcon's Avatar
 
Join Date: Aug 2005
Posts: 66
Rep Power: 0 MegaArcon is an unknown quantity at this point
flushing I/O?

Hi all.

I have a little bash script that simply outputs "foo" into a file under the /tmp dir

!#/bin/bash
echo foo &> /tmp/foo.txt
exit $?

A little thing about this code is that I'm executing it thought "C"'s "execl" command. It works fine the first time...but then hangs the second....if I kill the process and leave it for a while, it will work again...once...and then hang until I kill.

I think that there is a combat for resources here and that either the bash script or the C script is tieing up the I/O Stream....I have reason to believe it's the bash...although I've been wrong many...many times before. ^_^

Long story short, is there any way to "flush" out the I/O stream in bash?

Thanks in advance! ^_^
__________________
Isn't that just the way life goes? If it's worth doing, it's NP-Hard. Todd Wareham - Memorial University of Newfoundland
MegaArcon is offline   Reply With Quote