I keep getting myself in knots when I am manipulating paths and file names because I don’t follow a naming standard for path components.
Consider the following toy pr
Simple answer you could adopt for simple projects:
| name | example | |-------|------------------| | path | /foo/bar/baa.txt | | dir | /foo/bar/ | | file | baa.txt | | stem | baa | | ext | .txt | | parent| /foo/bar/ | (useful for parent dirs)