Pipes sunexeia..

Dimitrios P. Bouras dbouras at hol.gr
Tue May 20 19:01:11 EEST 1997


Harris Kosmidhs wrote:
> 
> Alla sou leo to idio programma gia na leitourghsei se Irix kai linux
> xreiastike na kano close ton descriptor, eno se AIX pige kanonika...
> Mipos einai telika 8ema tou /bin/bc?

  Einai ontws "problhma" tou bc, kai bazw ta eisagwgika giati den
 einai akribws bug :)  To 0ema einai oti ean 0eleis na xrhsimpoihseis
 - ap'oti katalabainw - to bc san expression parsing engine, prepei
 na alla3eis to source tou bazontas sthn prwth grammh tou main() to

  setvbuf(stdout, (char *)NULL, _IOLBF, 0); /* line-buffering */

 h

  setvbuf(stdout, (char *)NULL, _IONBF, 0); /* unbuffered */

 ka0'oti den blepw na mporei na ginei me allo tropo apo th meria
 tou programmatos pou ka0etai sthn allh akrh tou pipe. Oso gia ta
 sxolia sthn arxh tou run, ean den einai proper terminal to stdout,
 auta *den* bgainoun. Auto mporeis na to deis kanontas 'bc > ttt'
 kai meta patwntas ^D. Den 0a graftei tipote mesa sto arxeio. Ean
 kaneis kapoia pra3h fysika, 0a graftei to apotelesma. Opote to bc
 pi0anws xrhsimopoiei thn isatty(3) gia na apofasisei ti 0a kanei.

>Anyway pou uparxoun ta source tou?

  Einai GNU project utility opote to source tou prepei na einai
 sto ftp://prep.ai.mit.edu/pub/gnu.

> PS: katalabainete ps einai malakia na kano close kai open ka8e fora pou
> 8elo na graco kati :)

  Den einai kai toso fobero na grapseis mia mikrh function pou na
 perna sto bc to string kai na epistrefei to apotelesma, kanontas
 open kai close ka0e fora. H pernwntas ena "matso" apo strings kai
 epistrefontas array apo results. Auta ean den 0eleis na "pai3eis"
 me ta sources tou bc.

  Dhmhtrhs

-- 
|  Dimitrios P. Bouras   |           Tel.: +30 1 894-1320 or 968-0554  |
|  41 Pandora Str.       |   FAX: +30 1 382-7900 "Attention: Dimitri"  |
|  166 74 Athens         |  E-mail: dbouras at hol.gr, dimitri at ee.ubc.ca  |
|  GREECE                |          Web: http://users.hol.gr/~dbouras  |
--
====================================================================
Gia na mathete pos na xrisimopoiite ton majordomo, stilte e-mail
sto "majordomo at argeas.argos.hol.gr" me 1 grammi sto keimeno: help
Ta archives tis listas einai sto http://www.argos.hol.gr/lists
Gia opoiodipote problima stilte  e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list