RTEMS Logo

RTEMS 4.7.99.2 On-Line Library


chdir

PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

4.2: chdir

File:

chdir.c

Processing:

This routine will determine if the pathname that we are attempting to make that current directory exists and is in fact a directory. If these conditions are met the global indication of the current directory (rtems_filesystem_current) is set to the rtems_filesystem_location_info_t structure that is returned by the rtems_filesystem_evaluate_path() routine.

Development Comments:

This routine is layered on the rtems_filesystem_evaluate_path() routine and the filesystem specific OP table function node_type().

The routine node_type() must be a routine provided for each filesystem since it must access the filesystems node information to determine which of the following types the node is:

This acknowledges that the form of the node management information can vary from one filesystem implementation to another.

RTEMS has a special global structure that maintains the current directory location. This global variable is of type rtems_filesystem_location_info_t and is called rtems_filesystem_current. This structure is not always valid. In order to determine if the structure is valid, you must first test the node_access element of this structure. If the pointer is NULL, then the structure does not contain a valid indication of what the current directory is.


PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

Copyright © 1988-2004 OAR Corporation