| 352 | } |
| 353 | |
| 354 | Str *FileExtension(Str *path) { |
| 355 | Int slash = path->rfind(PathSeparator); |
| 356 | Int dot = path->rfind('.'); |
| 357 | if (dot == NOWHERE || dot < slash) { |
| 358 | return S(""); |
| 359 | } else { |
| 360 | return path->range_excl(dot, path->len()); |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | |
| 365 | static bool MakeDirRec(Str *path) { |