Fixed `file.path` to take extension

`file.path` now optionally accepts a file `ext`ension which, if present,
is added to the last part component given. Acts unchanged otherwise.