Hi,

A number of subprocessed are forked and these subprocess logs their output
in temporary files. as a processes completes its execution its output from
its temporary file on the consol. So, processes display its output in real
time. it cuases the number of periods with no visible activity while
executing.

This is working fine. the perl code given below does not include the code
for forking process and autofleshing and other stuff. This just gives the
idea of how output of different process is handled in temprary files.

my question is:
can i display the output of one process in real time instead of loging it in
temporary file and the output of the remaining process is loged in a
temporary file simultaneosuly.

....................................
sub Pooled_Compile {
  my($id,$parentfh) = @_;
  print $parentfh "start\n";
  close(STDOUT);
  close(STDERR);
  while (1) {
    chomp(my $pclass_obj = <$parentfh>);
    my $name = $pclass_obj;
    my $file = "$build_logs_dir/$name.log";
    open(STDOUT, "> $file")  or die "Can't redirect stdout: to $file ";
    open(STDERR, ">&STDOUT");
    my $result = Compile_pclassObj($pclass_obj);
    close(STDOUT) or die "Can't close STDOUT: $!";
    close(STDERR) or die "Can't close STDERR: $!";
    print $parentfh "$id $pclass_obj $result\n";
  }
  close($parentfh);
}
...................................

2008/5/20 Brian Raven <[EMAIL PROTECTED]>:

> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Sulman Mahmood
> Sent: 20 May 2008 11:59
> To: perl-unix-users@listserv.ActiveState.com
> Subject: [Perl-unix-users] output to console and to multiple files from
> multiple processes
>
> > Hi,
> >
> > currently, I have a solution in which output of all the forked process
> is being stored in temparary files and
> > when a process completes execution the output of that particular
> process is displayed from a temporary file.
> >
> > I'm looking for a way to dipslay output from one of the forked process
> in real time and other forked processes > output in different temporay
> files.
>
> How about running 'tail -f' on one of your temporary files?
>
> Sorry, but your problem description is a bit vague. A more detailed
> description, or better still, a small self contained script that
> demonstrates your problem would help.
>
> HTH
>
> --
> Brian Raven
>
> =========================================
> Atos Euronext Market Solutions Disclaimer
> =========================================
>
> 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 Atos Euronext Market Solutions.
>
> Atos Euronext Market Solutions Limited - Registered in England & Wales with
> registration no. 3962327.  Registered office address at 25 Bank Street
> London E14 5NQ United Kingdom.
> Atos Euronext Market Solutions SAS - Registered in France with registration
> no. 425 100 294.  Registered office address at 6/8 Boulevard Haussmann 75009
> Paris France.
>
> L'information contenue dans cet e-mail est confidentielle et uniquement
> destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
> Toute copie, publication ou diffusion de cet email est interdite. Si cet
> e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir
> l'expediteur immediatement et d'effacer le e-mail et annexes jointes de
> votre systeme. Le contenu de ce message electronique ne represente pas
> necessairement la position ou le point de vue d'Atos Euronext Market
> Solutions.
> Atos Euronext Market Solutions Limited Société de droit anglais,
> enregistrée au Royaume Uni sous le numéro 3962327, dont le siège social se
> situe 25 Bank Street E14 5NQ Londres Royaume Uni.
>
> Atos Euronext Market Solutions SAS, société par actions simplifiée,
> enregistré au registre dui commerce et des sociétés sous le numéro 425 100
> 294 RCS Paris et dont le siège social se situe 6/8 Boulevard Haussmann 75009
> Paris France.
> =========================================
>
> _______________________________________________
> Perl-Unix-Users mailing list
> Perl-Unix-Users@listserv.ActiveState.com
> To unsubscribe: 
> http://listserv.ActiveState.com/mailman/mysubs<http://listserv.activestate.com/mailman/mysubs>
>



-- 
Sulman Mahmood
phone# +46704679573
_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to