OpenFile opens the named file with specified flag (O_RDONLY etc.) and perm (0666 etc.) if applicable.
If the file is not exists, it will be created automatically.
If successful, methods on the returned File can be used for I/O.
If there is an error, it will be of type *PathError.