ÆÄÀÏ¿¡ ÁöÁ¤ÇÑ size¸¸Å bufÀÇ ³»¿ëÀ» ±â·ÏÇÑ´Ù.
int FileWrite(int handle, string buf, int size);
int FileWrite(int handle, string buf, int size, int encoding); - 10.3.6.24 ¹öÀü À̻󿡼 Áö¿ø
ÇÔ¼öÀÎÀÚ
handle - FileOpen À̳ª FileOpenLPT ÇÔ¼ö¸¦ »ç¿ëÇÏ¿© ¾òÀº ÆÄÀÏ ÀÎ½Ä ID
buf - ÆÄÀÏ¿¡ ±â·ÏÇÒ ³»¿ë
size - ÆÄÀÏ¿¡ ±â·ÏÇÒ Å©±â. (9.3.7 ºÎÅÍ´Â size¸¦ -1À» »ç¿ëÇϸé ÀúÀåÇÒ Å©±â¸¦ ÀÚµ¿À¸·Î °áÁ¤ÇÑ´Ù.)
encoding - 0 : ANSI(½Ã½ºÅÛ ±âº»¼³Á¤), 1 : UTF-8 Çü½Ä
return °ª
¾²±â°¡ ¼º°øÀûÀ¸·Î ³¡³ª¸é return°ªÀº ±â·ÏÇÑ Å©±â ¸¸ÅÀÌ µ¹¾Æ¿Â´Ù.
¿¹Á¦1)
handle = @FileOpen("C:\\EX.TXT", "a");
if(handle != 0) {
@FileWrite(handle, "example data\r\n", 14);
@FileClose(handle);
}
¹®Àå¼³¸í : C:\\EX.TXT ÆÄÀÏÀ» ¿¾î¼ "example data"¶ó´Â µ¥ÀÌÅ͸¦ ±â·ÏÇÑ µÚ ÆÄÀÏÀ» ´Ý´Â´Ù.
¿¹Á¦2)
handle = @FileOpen("C:\\EX.TXT", "a");
if(handle != 0) {
@FileWrite(handle, "example data\r\n", 14, 1);
@FileClose(handle);
}
¹®Àå¼³¸í : C:\\EX.TXT ÆÄÀÏÀ» ¿¾î¼ UTF-8 Çü½ÄÀ¸·Î "example data"¶ó´Â µ¥ÀÌÅ͸¦ ±â·ÏÇÑ µÚ ÆÄÀÏÀ» ´Ý´Â´Ù.
°ü·Ã Ç׸ñ)