Please note that starts_with is purely lexical and does not necessarily reflect whether the paths are actually nested in the filesystem because symlinks are a thing. You might want to call canonicalize first on both paths (although that does require both paths to actually exist).