Download FreeRTOS
 

Quality RTOS & Embedded Software

LIBRARIES
WHAT'S NEW
Simplifying Authenticated Cloud Connectivity for Any Device.
Designing an energy efficient and cloud-connected IoT solution with CoAP.
Introducing FreeRTOS Kernel version 11.0.0:
FreeRTOS Roadmap and Code Contribution process.
OPC-UA over TSN with FreeRTOS.

ff_chdir()

[FreeRTOS-Plus-FAT Standard API Reference]

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

Change the current working directory in the embedded FAT file system.

Parameters:

pcDirectoryName   A pointer to a standard null terminated C string that holds the name of the directory to make the current working directory. The string can include a relative path.

Returns:

If the current working directory was changed successfully then zero is returned.

If the current working directory could not be changed then -1 is returned and the task's errno may be set to indicate the reason. A task can obtain its errno value using the stdioGET_ERRNO API function.

Example usage:


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.