Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 19th, 2006, 7: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
Old Jul 19th, 2006, 8:56 AM   #2
MegaArcon
Programmer
 
MegaArcon's Avatar
 
Join Date: Aug 2005
Posts: 66
Rep Power: 0 MegaArcon is an unknown quantity at this point
Never mind...found it after. The command is sync.

Works now for SOME users....there still seems to be an I/O deadlock happening for some. I'll have to go though the rest of my code and make sure everything is fully flushed.

Thanks!
__________________
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
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
flushing input buffer sharadpro Java 3 May 25th, 2006 5:10 PM
Flushing out an array (solved) Navid C 5 Jun 28th, 2005 11:35 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:30 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC