char* DeviceFileName = "test.txt";
uint32_t MaxSize = 60*1024; //60K is max file size
int32_t DeviceFileHandle = -1;
int32_t RetVal; //negative retval is an error
uint32_t Offset = 0;
unsigned char InputBuffer[100];
unsigned long MasterToken = 0;
// Create a file and write data. The file in this example is secured, without signature and with a fail safe commit
//create a secure file if not exists and open it for write.
DeviceFileHandle = sl_FsOpen((unsigned char *)DeviceFileName,
SL_FS_CREATE|SL_FS_OVERWRITE | SL_FS_CREATE_SECURE | SL_FS_CREATE_NOSIGNATURE | SL_FS_CREATE_MAX_SIZE( MaxSize ),
&MasterToken);
if( DeviceFileHandle < 0 )
{
printf("create file %s failed!\n", DeviceFileName);
}
运行到这里,返回值-2018,错误! 什么原因呢?