| 343 | } |
| 344 | |
| 345 | Str *BaseName(Str *path) { |
| 346 | Int pos = path->rfind(PathSeparator); |
| 347 | if (pos == NOWHERE) { |
| 348 | return path->clone(); |
| 349 | } else { |
| 350 | return path->range_excl(pos+1, path->len()); |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | Str *FileExtension(Str *path) { |
| 355 | Int slash = path->rfind(PathSeparator); |