From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arijit Das Sent: 25 August 2005 19:25 To: [email protected]; [email protected] Subject: Flushing all open file descriptors... 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... ... .... a_func_that_flushes_all_open_files(); kill -9, getpgrp();
As far as I am aware there is no such function, other than exit, that is. If you let your program die naturally (i.e. exit instead of kill) you would not need such a function. However, if you really must use 'kill -9', you should probably enable autoflush when you open files (see for example 'perldoc FileHandle'), then such a function would be unnecessary. Why are you using kill? I see that you are sending the signal to a program group, so what about the other processes in that group, how can they flush their files? HTH ----------------------------------------------------------------------- The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary companies. ----------------------------------------------------------------------- _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
