下载 FreeRTOS
 

出色的 RTOS & 嵌入式软件

最新资讯
简化任何设备的身份验证云连接。
利用 CoAP 设计节能型云连接 IoT 解决方案。
11.0.0 版 FreeRTOS 内核简介:
FreeRTOS 路线图和代码贡献流程。
使用 FreeRTOS 实现 OPC-UA over TSN。

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.