On Thu, 25 Nov 1999, Boon, Eric wrote:

>       [Howto]
> >     cat fudeba.txt | head 20 | tail 10 | less
> 
> I know for sure (i.e. 95% ;-)) that Messy DOS uses temporary files in this
> case...
> (so actaully does something like:
>    cat fudeba.txt > tmp001
>    head -20 tmp001 > tmp002; del tmp001
>    tail -10 tmp002 > tmp003; del tmp002
>    less tmp003; del tmp003
> (DOS might even postpone the deletion of the tmp... files to the end!))

This is correct. Unix uses a much more flexible approach. It uses a
buffer, that is filled by the first process and emptied by the second. If
the buffer is full, the first process blocks (stops executing), until
there is some space. If the buffer is empty, the second process is put to
sleep. This way, there is no problem when the piped data is much (like an
endless pipe, for which in DOS the second process would never be
executed). That is why it is not considered a waste of resources.

I hope you understand it.
Bye,
shevek

/***********Use gcc to compile***Don't mind the warning************/

 int*a,k   ,v[    9];    int*main   (){    int   i,j,s=1,   x,z   ,c[
]={        1,4    ,7,    4,3        ,4,    5,4   ,1,        1,1  ,2,
3,3        ,3,    4};    for        (i=    0;(   i++        <9) &!k
 ;s=-s)    {k=0;scanf    ("%d",&    z);v  [--z   ]=s;for    (j=0;j
     <8;   j++    ){z    =v[         c[j ]];k    |=z        ==v [c[
     j]-   c[j    +8]    ]&(          z&&(v[     c[j        ]+c  [j+
8]]==z)    );;    ;}}    printf("       %d       won\n",-   s*k   );}

/*******************Tic-tac-toe.use 1-9 to play********************/


****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to