11.5. -   FIFO-... 417

16 const int FMode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;

17

18 int main(int argc, char *argv[])

19 {

20

21   int Pid,Status,Size;

22   double Value;

25   mkfifo("/tmp/channel.1",FMode) ;

26   mkfifo("/tmp/channel.2",FMode) ;

28   vector<double> X(100,13.0) ,-

29   vector<double> Y;

30   of stream OPipe("/tmp/channel.1",ios::app);

31   ifstream IPipe("/tmp/channel.2");

32   OPipe  X.size()  endl;

33   ostream_iterator<double> Optr(OPipe,"\n");

34   copy(X.begin(),X.end(),0ptr) ;

35   OPipe  flush;

36   IPipe  Size;

37   for (int N = 0;N < Size; N++)

38   {

39     IPipe  Value;

40     Y.push_back(Value);

41   }

42

43   IPipe.close();

44   OPipe.close() ;

45   unlink("/tmp/channel.1");

46   unlink("/tmp/channel.2");

47   cout  accumulate(Y.begin(),Y.end(),-13.0)  endl;

48

49   return)0) ;

50 }

  11.3.1   FIFO-. ,  FIFO-
   . ,  
  ,       
FIFO-.   11.3.1   channel. 1  channel. 2. -
       FIFO- ( 16). 
 ,   FIFO-     
 ,         .   -
 30 FIFO- channel. 1      .   -
      :

OPipe.open("/tmp/channel.1", ios::) ;

    open () ,  FIFO-
    .   11.3.1  copy () 
     OPipe  f stream    FIFO-. 
       f stream:

fstream OPipe("/tmp/channel.1", ios::out | ios::app);

         
   .       ios: : , 
  of stream  FIFO- (.  30)   .