Avoid using pointers for File instances and improve error messages

This makes code easier.
Save open URI

Save folder URI if we successfully open it.