Page 103 - Nodejs 교과서 개정2판
P. 103
• path.sep ҃۽ ҳ࠙ੑפ ਦبח \ 104*9ח /ੑפ
• path.delimiter ജ҃ ߸ࣻ ҳ࠙ੑפ process.env.PATHܳ ੑ۱ೞݶ ৈ۞ ѐ ҃۽о ҳ࠙۽
ҳ࠙غয णפ ਦبח ࣁۿ ;)Ҋ 104*9ח ۿ :)ੑפ
• path.dirname(경로) ੌ ਤೠ ಫ؊ ҃۽ܳ ࠁৈસפ
• path.extname(경로) ੌ ഛܳ ࠁৈસפ
• path.basename(경로, ഛ ੌ ܴ ഛ ನೣ ਸ दפ ੌ ܴ݅ दೞҊ रݶ ba
sename ف ߣ૩ ੋࣻ۽ ੌ ഛܳ ֍ਵݶ ؾפ
• path.parse(경로) ੌ ҃۽ܳ root dir base ext nameਵ۽ ܻ࠙פ
• path.format(객체) path.parse()ೠ ёܳ ੌ ҃۽۽ פ
• path.normalize(경로) /ա \ܳ पࣻ۽ ৈ۞ ߣ ࢎਊ೮Ѣա ഒਊ೮ਸ ٸ ࢚ੋ ҃۽۽ ߸ജפ
• path.isAbsolute(경로) ੌ ҃۽о ҃۽ੋ ࢚҃۽ੋܳ trueա false۽ ঌ݀פ
• path.relative(기준경로, 비교경로) ҃۽ܳ ف ѐ ֍ਵݶ ߣ૩ ҃۽ীࢲ ف ߣ૩ ҃۽۽ оח ߑߨਸ
ঌ݀פ
• path.join(경로, …) ৈ۞ ੋࣻܳ ֍ਵݶ ೞա ҃۽۽ פ ࢚҃۽ੋ ࠗݽ ٣۩ఠܻ җ അ ਤ
ب ঌইࢲ ܻפ
• path.resolve(경로, …) path.join()җ ࠺तೞ݅ ରо णפ ର ী աয়ח /PUFীࢲ
ࢸݺפ
/PUF KPJOҗ SFTPMWF ର
path.joinҗ path.resolve ݫࢲ٘ח ࠺त೧ ࠁ݅ ز ߑध ܵפ ܳ ݅աݶ path.resolveח ҃۽۽ ੋध
೧ࢲ খ ҃۽ܳ ޖदೞҊ path.join ࢚҃۽۽ ܻפ ٘۽ ࠁݶ ೧ೞӝ औणפ
path.join('/a', '/b', 'c'); /* 결과 : /a/b/c/ */
path.resolve('/a', '/b', 'c'); /* 결과 : /b/c */
/PUF যڃ ٸ ==ܳ ࢎਊೞҊ যڃ ٸ =ܳ ࢎਊೞաਃ
ࣛ Ѿҗܳ ࠁݶ যڃ ٸח ==ܳ ࢎਊೞҊ যڃ ٸח Ӓր =ܳ ࢎਊೞৈ ਦب ҃۽ܳ द೮णפ ӝࠄਵ۽ ҃۽ח = ೞա
ܳ ࢎਊ೧ࢲ दפ ೞ݅ ߄झ݀ ޙৌীࢲח =о ౠࣻ ޙ۽ =ܳ ف ѐ ࠢৈ ҃۽ܳ द೧ঠ פ
ܳ ٜয \n ߄झ݀ ޙৌীࢲ ߄Էۄח ڷ۽ $ =OPEF৬ э ҃۽ীࢲ بೞ ঋ য়ܨо ߊࢤೡ ࣻ
णפ ٸח $ ==OPEFۢ द೧ঠ פ
QBUI ݽٕ ਤ৬ э ҃ী ߊࢤೞח ޙઁܳ ঌইࢲ ܻפ ח ਦبীࢲ QBUI ݽٕ ԙ ਃೠ ਬӝب פ
/PUF ࢚҃۽৬ ҃۽