in torchaudio/csrc/decoder/src/dictionary/System.cpp [70:86]
std::vector<std::string> getDirsOnPath(const std::string& path) {
const std::string trimPath = trim(path);
if (trimPath.empty() || trimPath == pathSeperator() || trimPath == "." ||
trimPath == "..") {
return {trimPath};
}
const std::vector<std::string> tokens = split(pathSeperator(), trimPath);
std::vector<std::string> dirs;
for (const std::string& token : tokens) {
const std::string dir = trim(token);
if (!dir.empty()) {
dirs.push_back(dir);
}
}
return dirs;
}