下载 FreeRTOS
 

出色的 RTOS & 嵌入式软件

最新资讯
FreeRTOS-Plus-TCP 现具有统一的 IPv4 和 IPv6 功能,支持多接口。
为基于 FreeRTOS 的固件实现防砖化 MCU FOTA:
宣布停止支持 FreeRTOS 202012 LTS。
FreeRTOS 网站现已提供简体中文版本
新的 FreeRTOS Long Term Support 版本现已发布。

ff_mkdir()

[FreeRTOS-Plus-FAT 标准 API 引用]

ff_stdio.h
int ff_mkdir( const char *pcDirectory );
		

在嵌入式 FAT 文件系统中创建一个新的目录。

参数:

pcDirectory   指向以 null 结尾的标准 C 字符串的指针,该字符串包含 正在创建的目录名称。 该字符串 可包含相对路径。

返回:

如果创建目录成功,则返回零。

如果无法创建目录,则返回 -1,且设置任务 errno 以表示原因。 任务 可以使用 stdioGET_ERRNO() API 函数 获取其 errno 值。

用法示例:


void vExampleFunction( void )
{
/* Create a sub directory called subfolder. */
ff_mkdir( "subfolder" );

/* Create three subdirectories called sub1, sub2 and sub three respectively
inside the subfolder directory. */

ff_mkdir( "subfolder/sub1" );
ff_mkdir( "subfolder/sub2" );
ff_mkdir( "subfolder/sub3" );

/* Move into the subfolder/sub1 directory. */
ff_chdir( "subfolder/sub1" );

/* Create another directory called sub4 inside the subfolder/sub1 directory. */
ff_mkdir( "sub4" );
}

Example use of the ff_mkdir() API function to create a directory


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.