private with_extension — function with_extension(path, ext) Return a path with the extension set to ext.