mkdir <path>, pwd, and cd <path> (with a special wildcard segment *).
/./) or relative (no leading /)./. Multiple consecutive slashes should be treated as a single /.. and .. which have standard semantics:
. = current directory.. = parent directory (root’s parent is itself)String pwd()/ (no trailing slash)./ (no trailing slash), e.g. /a/b/cvoid mkdir(String path)<path>.<path> is absolute, creation is anchored at /.<path> is relative, creation is anchored at the current directory.mkdir -p): missing intermediate segments are created.. or .. as literal directory names in <path>.void cd(String path)<path>.. and .. while traversing.** is allowed as a path segment and matches exactly one segment at that position.{ ".", ".." } ∪ { all direct child directory names }.. (no-op)... (root’s parent is root).cd operates on a single path; expanding * to multiple candidates is not a viable cd behavior. Start state:
/pwd → /mkdir /a/b/c
/a, /a/b, /a/b/c (parents auto-created).pwd → /cd a/b
/a/bpwd → /a/bcd *
/a/b, children = { c }.., .., c }.c./a/b/ccd ../*
/a/b/c, first .. → /a/b.* at /a/b: prefer child c./a/b/c (unchanged effectively).cd / * (space added for readability; equivalent to cd /*)
/, if there are children (e.g., a), * chooses lexicographically smallest child (e.g., a), so CWD becomes /a.If / has no children:
cd * at / → no children, prefer . → stay at /.Error case:
cd /nope/*/x where /nope doesn’t exist → fail, CWD unchanged.