Loading ...
Sorry, an error occurred while loading the content.

RE: flush file buffers associated with (was mailx via system sends zen mail)

Expand Messages
  • Srikanth Madani
    Hi all, I found the problem (a friend helped me out!) - I use the IO:Tee module as : $tee = IO::Tee- new ( $resfile , &1 ); And when I try to do something
    Message 1 of 1 , Jul 1, 2003
    • 0 Attachment
      Hi all,

      I found the problem (a friend helped me out!) - I use the IO:Tee module as :

      $tee = IO::Tee->new ( ">$resfile", ">&1");

      And when I try to do something with the contents of $resfile, I don't get anywhere as it's not yet written to disk. When I exit the script, all buffers are flushed, and the file contains the correct data.

      The question (an important one for me!) is how do I now explicitly flush this buffer? I'm not sure if I'm phrasing the question correctly, so please be tolerant, and tell me how do I ensure that everything written to $tee [via a statement like print $tee "\nThis will go into $resfile as well as STDOUT";] is finally written to disk?

      Thanks,



      Srikanth Madani
      Software Configuration Management
      Voicemail: +357-25-88-6986
      Mail: srikanth.madani@...
      Larry Wall on Perl 6 : We're working on it, slowly but surely...or not-so-surely in the spots we're not so sure.

      -----Original Message-----
      From: Srikanth Madani
      Sent: Tuesday, July 01, 2003 11:40 AM
      To: perl-beginner@yahoogroups.com
      Subject: [PBML] RE: mailx via system sends zen mail


      Greetings, Mongers!

      The following code refuses to mail the contents of $resfile to me :
      if (defined $ARGV[1]) {
      print "\nDiag:To check if resfile is still defined - $resfile and version is - $version\n";
      system qq(mailx -s"checkmr results for $version" $ARGV[1] < $resfile);
      print "\nNow mailing results to $ARGV[1]\n";
      }

      It prints:
      Diag:To check if resfile is still defined - /tmp/checkmr.13282 and version is - v33_0
      Now mailing results to srikanthm@...

      The contents of $resfile (/tmp/checkmr.13282 ) are correct - I checked it.

      But the mail I get is empty. Am I missing something obvious?


      Thanks much,
      Srik.

      Srikanth Madani
      Software Configuration Management
      Voicemail: +357-25-88-6986
      Mail: srikanth.madani@...
      Larry Wall on Perl 6 : We're working on it, slowly but surely...or not-so-surely in the spots we're not so sure.
      ----------




      ----------

      --------------------------------------------------------------------

      The information contained in this message is proprietary of Amdocs,
      protected from disclosure, and may be privileged.
      The information is intended to be conveyed only to the designated recipient(s)
      of the message. If the reader of this message is not the intended recipient,
      you are hereby notified that any dissemination, use, distribution or copying of
      this communication is strictly prohibited and may be unlawful.
      If you have received this communication in error, please notify us immediately
      by replying to the message and deleting it from your computer.
      Thank you.

      --------------------------------------------------------------------


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.