|
//打开文件部分,模块初始化时候打开
TCHAR sFilePath[NURO_MAX_PATH];
nuGetModuleFileName(NULL, sFilePath, NURO_MAX_PATH);
for(int i = nuTcslen(sFilePath) - 1; i >= 0; i--)
{
if( sFilePath == nuTEXT('\\') )
{
sFilePath[i+1] = nuTEXT('\0');
break;
}
}
nuMemset( sFileLogGps, 0, sizeof(sFileLogGps) );
nuTcscat( sFileLogGps, sFilePath );
nuTcscat( sFileLogGps, nuTEXT("GPSLOG.TXT"));
g_pLogFile = nuTfopen( sFileLogGps , NURO_FS_WB );
//写文件部分,这里会不断写,直到系统关闭的时候
if ( g_pLogFile )
{
nuFwrite( ReceiveCharBuf, ReceiveCharBufNum, 1,g_pLogFile );
}
//关闭,模块退出关闭
if ( g_pLogFile )
{
nuFclose(g_pLogFile);
}
|
|