I think you are missing out here... DIsk files are always fully-buffered, STOUT is line buffered and STDERR is unbuffered.
My problem is I have to do a kill -9 at the end. And a process dying with kill -9 doesn't get a scope to do its cleanup like flushing open files handles and closing them. -Arijit --- $Bill Luebkert <[EMAIL PROTECTED]> wrote: > Arijit Das wrote: > > > Is there a Perl func which, when executed, ensures > that all the open > > file descriptors of the corresponding process are > flushed immediately? > > > > What I am looking for is this... > > > > #!/usr/bin/perl > > .... > > .... > > # Open lots of files here and write some data to > them but do not flush > > any of them... > > I'm pretty sure disk files are always written > immediately (unlike > buffered terminal files), but I could be wrong. If > I'm right, it > would only work for tty output. For sockets, I > think they're also > unbuffered and would be output as soon as possible. > > You could easily test it by opening your files and > going to another > terminal window and check the content of the files > while your main > code is in a long sleep loop. > > > .... > > a_func_that_flushes_all_open_files(); > > > > kill -9, getpgrp(); > > -- > ,-/- __ _ _ $Bill Luebkert > Mailto:[EMAIL PROTECTED] > (_/ / ) // // DBE Collectibles > Mailto:[EMAIL PROTECTED] > / ) /--< o // // Castle of Medieval Myth & > Magic http://www.todbe.com/ > -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ > (My Perl/Lakers stuff) > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs