下载 FreeRTOS
 

出色的 RTOS & 嵌入式软件

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

ff_chdir()

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

ff_stdio.h
int ff_chdir( const char *pcDirectoryName );
		

更改嵌入式 FAT 文件系统中的当前工作目录。

参数:

pcDirectoryName   指向以 null 结尾的标准 C 字符串的指针,该字符串包含 当前工作目录 的名称。 该字符串可包含相对路径。

返回:

如果当前工作目录已更改成功,则返回零。

如果当前工作目录无法更改,则返回 -1,并 可设置任务的 errno以指示原因。 任务 可使用 stdioGET_errno API 函数获取其 errno 值。

用法示例:


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

/* Create a in subfolder called sub1. */
ff_mkdir( "subfolder/sub1" );

/* Make subfolder/sub1 the current working directory. */
ff_chdir( "subfolder/sub1" );

/* Make the route directory the current working directory again. This could
also have used ff_chdir( "/" ); */

ff_chdir( "../.." );
}

Example use of the ff_chdir() API function to open or create a file


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