ff_stdio.h
int ff_remove( const char *pcPath );
从嵌入式 FAT 文件系统中移除、删除文件或取消该文件链接。如果文件已打开,
则无法删除。
参数:
pcDirectory
|
指向以 null 结尾的标准 C 字符串的指针,该字符串包含
正在删除的文件的名称。文件名
可包含到所述目录的相对路径。 |
返回:
如果文件删除成功,则返回零。
如果无法删除文件,则返回 NULL ,并
errno 以指示原因。任务
可以使用
stdioGET_ERRNO() API 函数
API 函数获取其 errno 值。如果文件已打开,则无法删除。
用法示例:
void vExampleFunction( void )
{
ff_remove( "/ram1/filename.txt" );
}
Example use of the ff_remove() API function to delete a file
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.