The File object is an IoDevice object allowing to read,:ref:write <method_IoDevice_write> and remove files. In general a file is always stored on a certain storage which also predefines the absolute path to the file. A relative path (i.e. subdirectories) may be included in the file name.
This property holds the most recently occurred error or File.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.
This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.
This property holds the name of the file. It is always relative to the storage which this file is stored on. The file name has to be set before the file is opened.
This method removes the file specified by fileName and stored on storage.
This method calls IoDevice.flush() and tells the operating system to write all pending data to its storages. Calling this method might block the program execution for a while depending on the amount of data to be written.
This enumeration describes all errors which can occur in File objects. The most recently occurred error is stored in the error property.
||No error occurred or was detected.|
||None or invalid storage set.|
||Error while creating directories on storage.|
||Error while opening file likely due to permission problem.|