. 1 UF_initialize (); 2 . 3 // Specify the local data path to the file . 4 char file_spec [] = " D: Program Files // // // NX Siemens of UGII 8.0 // // // part_detal.dat the Data zyTOOLS // " ; . 5 int Status = 0 ; . 6 // test file or directory exists . 7 UF_CFI_ask_file_exist (file_spec, & Status); . 8 char * CBUF; . 9 int qreslt = 0 ; 10 iF (Status == 0 ) . 11 { 12 is // open file 13 int Chan = uc4504 (file_spec, . 1 , 87 ); 14 // determine the length of the file open 15 uc4547 (Chan, . 1 , & qreslt); 16 // allocate memory . 17 CBUF = ( char *) the malloc ( the sizeof ( char ) * qreslt); 18 is // read file . 19 int NUM = uc4514 (Chan, CBUF); 20 is UF_UI_open_listing_window (); 21 is the while (NUM> = 0 ) 22 is { 23 is UF_UI_write_listing_window (CBUF); 24 UF_UI_write_listing_window ( " \ n- " ); 25 NUM = uc4514 (Chan, CBUF); 26 is } 27 // close file 28 uc4540 (Chan, 0 ); 29 30 } 31 is the else 32 { 33 is uc1601 ( " check whether there part_detal. " , 1 ); 34 is 35 } 36 // release memory 37 [ Free (CBUF); 38 is 39 UF_terminate();
UFUN function UF_CFI function (uc4504, uc4540, uc4514, uc4547, UF_CFI_ask_file_exist)
Guess you like
Origin www.cnblogs.com/zzyfym/p/12038598.html
Ranking