View Source Crawler.Linker.PathExpander (Crawler v1.5.0)

Expands the path by expanding any . and .. characters.

See this pull request.

Summary

Functions

Expands the path by expanding any . and .. characters.

Functions

Expands the path by expanding any . and .. characters.

Note this function only expands any . and .. characters within the given path, and it does not take into account the absolute or relative nature of the path itself, for that please use expand/1 or expand/2.

Examples

### Intended use case

iex> PathExpander.expand_dot("foo/bar/../baz")
"foo/baz"

iex> PathExpander.expand_dot("/foo/bar/../baz")
"/foo/baz"

### Non-intended use cases are ignored

iex> PathExpander.expand_dot("foo/bar/./baz")
"foo/bar/baz"

iex> PathExpander.expand_dot("../foo/bar")
"foo/bar"