int FileRead(int handle, string buf, int size);
int FileRead(int handle, string buf, int size, int encoding); - 10.3.6.24 ¹öÀü À̻󿡼 Áö¿ø
ÆÄÀÏ¿¡¼ ÁöÁ¤ÇÑ size¸¸ÅÀ» ÀÐ¾î¼ buf¿¡ ´ã´Â ÇÔ¼öÀÌ´Ù.
ÇÔ¼öÀÎÀÚ
handle - FileOpen ÇÔ¼ö¸¦ »ç¿ëÇÏ¿© ¾òÀº ÆÄÀÏ ÀÎ½Ä ID
buf - ÆÄÀÏ¿¡¼ Àоî¿Í¼ ´ãÀ» ¸Þ¸ð¸®
size - ÆÄÀÏ¿¡¼ Àоî¿Ã Å©±â
encoding - 0 : ANSI(½Ã½ºÅÛ ±âº»¼³Á¤), 1 : UTF-8 Çü½Ä
return °ª
ÀбⰡ ¼º°øÀûÀ¸·Î ³¡³ª¸é return°ªÀº ÀÐÀº Å©±â ¸¸ÅÀÌ µ¹¾Æ¿Â´Ù.
¿¹Á¦1)
handle = @FileOpen("C:\\EX.TXT", "r");
if(handle != 0) {
@FileRead(handle, buf, 14);
@FileClose(handle);
}
¹®Àå¼³¸í : C:\\EX.TXT ÆÄÀÏÀ» ¿¾î¼ buf¿¡ 14°³ÀÇ µ¥ÀÌÅ͸¦ Àоî¿Â µÚ ÆÄÀÏÀ» ´Ý´Â´Ù.
¿¹Á¦2)
filepath =
"C:\\AutoBase\\Project\\ApiClientTest\\RESTAPIClient\\žç¿_log.txt";
size =
@FileGetSize(filepath);
handle = @FileOpen(filepath, "r"); //ÀбâÀü¿ëÀ¸·Î ¿±â
if(handle != 0) {
@FileRead(handle, buf, size, 1); // UTF-8 Çü½ÄÀ¸·Î Àбâ
@FileClose(handle);
}
$ST_buf = buf;
¹®Àå¼³¸í : žç¿_log.txt ÆÄÀÏÀ» ¿¾î¼ UTF-8 Çü½ÄÀ¸·Î ÀÐÀº ÈÄ buf¿¡ ÀúÀåÇÏ°í $ST_buf ¹®ÀÚ¿
ű׿¡ ÀúÀåÇÑ´Ù.
°ü·Ã Ç׸ñ)