在使用ch378的時候發(fā)現,ch378可以識別并獲取英文大小寫文件名。以下代碼段即可讀?。?/p>
do?
{
?
s = CH378FileOpen( SrcFileName ); ??
if( s != ERR_SUCCESS )?
{
return( s );
}
if( ByteCount == 0 )?
{ ?
FileSize = CH378GetFileSize( ); ?
}
else?
{ ?
s = CH378ByteLocate( ByteCount ); ?
if( s != ERR_SUCCESS )?
{
return( s );
}
}
s = CH378ByteRead( buf_RFU, sizeof( buf_RFU ), &ThisLen ); ?
if( s != ERR_SUCCESS )?
{
return( s );
}
但是當要創(chuàng)建小寫英文字母的文件名,并向文件寫數據時候,發(fā)現執(zhí)行成功,插到電腦也可以看到創(chuàng)建的文件,但是無法打開,提示“文件不存在”,具體代碼為:
status=CH378FileCreate(TarFileName);
s = CH378ByteRead( buf_RFU, sizeof( buf_RFU ), &ThisLen ); ?
if( s != ERR_SUCCESS )?
{
return( s );
}
s = CH378FileOpen( TarFileName ); ?
if( s != ERR_SUCCESS )?
{
return( s );
}
s = CH378ByteLocate( ByteCount ); ?
if( s != ERR_SUCCESS )?
{
return( s );
}
s = CH378ByteWrite( buf_WTU, sizeof(buf_WTU), NULL ); ? ?
if( s != ERR_SUCCESS )?
{
return( s );
}
s = CH378FileClose( TRUE ); ??
if( s != ERR_SUCCESS )?
{
return( s );
}
ByteCount++;
請問這個問題該怎么解決呢?是用長文件名的函數來創(chuàng)建?然后我寫入的時候函數是不是不用改變
只需要將
status=CH378FileCreate(TarFileName);
換成
status = CH378CreateLongName(TarFileName,LongNameBuf);