Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

Change the working directory.

Usages

fs_cd [dir]

Arguments

dir

Absolute directory path.

OR

Path relative to current working directory.

Output

None.

Required Configuration

Available only if FS_SHELL_CFG_CD_EN is DEF_ENABLED.

Notes/Warnings

The new working directory is formed in three steps:

  • If the argument dir begins with the path separator character (slash, ‘\’) or a volume name, it will be interpreted as an absolute directory path and will become the preliminary working directory. Otherwise the preliminary working directory path is formed by the concatenation of the current working directory, a path separator character and dir.
  • The preliminary working directory path is then refined, from the first to last path component:
    • If the component is a ‘dot’ component, it is removed
    • If the component is a ‘dot dot’ component, and the preliminary working directory path is not NULL, the previous path component is removed. In any case, the ‘dot dot’ component is removed.
    • Trailing path separator characters are removed, and multiple path separator characters are replaced by a single path separator character.
  • The volume is examined to determine whether the preliminary working directory exists. If it does, it becomes the new working directory. Otherwise, an error is output, and the working directory is unchanged.
  • No labels