Returns the Directory whose entries are named by path. * path=[] → root; path=["DIR.DR"] → DR sub-directory. * The Smaky 6 FS is at most two levels deep; deeper paths are invalid. */
| 237 | * path=[] → root; path=["DIR.DR"] → DR sub-directory. |
| 238 | * The Smaky 6 FS is at most two levels deep; deeper paths are invalid. */ |
| 239 | Directory directoryAt(const Path& path) |
| 240 | { |
| 241 | if (path.empty()) |
| 242 | return Directory(this); |
| 243 | if (path.size() == 1) |
| 244 | { |
| 245 | auto parent = Directory(this).findFile(path[0]); |
| 246 | if (parent->file_type != TYPE_DIRECTORY) |
| 247 | throw BadPathException(path); |
| 248 | return Directory(this, parent->startSector); |
| 249 | } |
| 250 | throw BadPathException(path); |
| 251 | } |
| 252 | |
| 253 | /* Resolves a full path to its SmakyDirent. |
| 254 | * path=["FILE"] → file in root; path=["DIR.DR","FILE"] → file in sub-dir. */ |
nothing calls this directly
no test coverage detected