Page 132 - Nodejs 교과서 개정2판
P. 132

writeStream.write('한	번	더	씁니다.');
           writeStream.end();




         XSJUFNF  UYUܳ ৌয ࠁݶ ઑӘ ੹ী ֍঻؍ ޙ੗ৌ੉ Ӓ؀۽ ٜয ੓ਸ Ѫੑפ׮

          콘솔

           $	node	createWriteStream
           파일	쓰기	완료




         ݢ੷ createWriteStreamਵ۽ ॳӝ झ౟ܿਸ ٟ݅פ׮  ୐ ߣ૩ ੋࣻ۽ח ୹۱ ౵ੌݺਸ ੑ۱೤פ׮  ف ߣ૩ ੋ
         ࣻח ২࣌ੋؘ  ৈӝࢲח ࢎਊೞ૑ ঋणפ׮


         finish ੉߮౟ ܻझցب ࠢ৓णפ׮  ౵ੌ ॳӝо ઙܐغݶ ௒ߔ ೣࣻо ഐ୹ؾפ׮

         writeStreamীࢲ ઁҕೞח write ݫࢲ٘۽ ֍ਸ ؘ੉ఠܳ ॺפ׮  ৈ۞ ߣ ഐ୹ೡ ࣻ ੓णפ׮  ؘ੉ఠܳ ׮ ो

         ׮ݶ end ݫࢲ٘۽ ઙܐܳ ঌ݀פ׮  ੉ٸ finish ੉߮౟о ߊࢤ೤פ׮

         createReadStreamਵ۽ ౵ੌਸ ੍Ҋ Ӓ झ౟ܿਸ ੹׳߉ই createWriteStreamਵ۽ ౵ੌਸ ॶ ࣻب ੓णפ׮

         ౵ੌ ࠂࢎ৬ ࠺त೤פ׮  झ౟ܿՙܻ োѾೞח Ѫਸ r౵੉ೝೠ׮sҊ ಴അ೤פ׮  ঘ୓о ൒ܰח ҙ ౵੉೐ QJQF
         ୊ۢ ؘ੉ఠо ൒ܲ׮Ҋ ೧ࢲ ૑য૓ ੉ܴੑפ׮


          readme4.txt
           저를	writeme3.txt로	보내주세요.




          pipe.js

           const	fs	=	require('fs');


           const	readStream	=	fs.createReadStream('readme4.txt');
           const	writeStream	=	fs.createWriteStream('writeme3.txt');
           readStream.pipe(writeStream);



          콘솔

           $	node	pipe




         SFBENF  UYU৬ ڙэ਷ ղਊ੄ XSJUFNF  UYUо ࢤࢿغ঻ਸ Ѫੑפ׮  ޷ܻ ੍ӝ झ౟ܿҗ ॳӝ झ౟ܿਸ ٜ݅
         যك റ ف ѐ੄ झ౟ܿ ࢎ੉ܳ pipe ݫࢲ٘۽ োѾೞݶ ੷੺۽ ؘ੉ఠо XSJUF4USFBNਵ۽ ֈযцפ׮  ٮ۽ on

         ('data')ա writeStream.writeܳ ೞ૑ ঋইب ঌইࢲ ੹׳غ޲۽ ಞܻ೤פ׮  ֢٘ 8 5 ߡ੹੉ աয়ӝ ੹ө૑

         ח ੉ ߑधਵ۽ ౵ੌਸ ࠂࢎೞҌ ೮णפ׮  ࢜۽਍ ౵ੌ ࠂࢎ ߑध਷ 3 6 3੺ী ա২פ׮
   127   128   129   130   131   132   133   134   135   136   137