theseus-os / Theseus

Theseus is a modern OS written from scratch in Rust that explores 𝐢𝐧𝐭𝐫𝐚𝐥𝐢𝐧𝐠𝐮𝐚𝐥 𝐝𝐞𝐬𝐢𝐠𝐧: closing the semantic gap between compiler and hardware by maximally leveraging the power of language safety and affine types. Theseus aims to shift OS responsibilities like resource management into the compiler.
https://www.theseus-os.com/
MIT License
2.91k stars 172 forks source link

Handle paths with multiple components in `chdir` #1080

Closed tsoutsman closed 11 months ago

tsoutsman commented 11 months ago

Adds support for changing multiple levels of directories at once e.g. cd task/2.

Also since components normalizes the trailing slash, this fixes the bug which prevented changing into a directory followed by a trailing slash e.g. cd namespaces/.

This is indicative of the larger issue that each FsNode implementation needs its own path parsing algorithm e.g. cd task && cd .. doesn't work because TaskFs doesn't support ... I'll have a PR ready soon to fix that issue.