File System - Resolve (Path Resolving)

About

The resolve function is a algorithm on a file system that return a path from another path.

It is equivalent to the execution of change directory (cd) on every argument but it apply also to file.

Example

resolve('/c','/m','b') = '/m/b'
  • the first argument is executed, the current path is the absolute path /c because it begins with a root character /
  • the second argument is executed, the current path is the absolute path /m because it begins with a root character /
  • the third argument is executed, the current path is the path /m/b because b is a relative path (ie it does not begin with a root character /)

Powered by ComboStrap