File
Superclasses: Object
On-disk representation of a Buffer
.
A GtkSourceFile
object is the on-disk representation of a Buffer
.
With a GtkSourceFile
, you can create and configure a FileLoader
and FileSaver
which take by default the values of the
GtkSourceFile
properties (except for the file loader which auto-detect some
properties). On a successful load or save operation, the GtkSourceFile
properties are updated. If an operation fails, the GtkSourceFile
properties
have still the previous valid values.
Constructors
Methods
- class File
- check_file_on_disk() None
Checks synchronously the file on disk, to know whether the file is externally modified, or has been deleted, and whether the file is read-only.
File
doesn’t create aFileMonitor
to track those properties, so this function needs to be called instead. Creating lots ofFileMonitor
’s would take lots of resources.Since this function is synchronous, it is advised to call it only on local files. See
is_local
.
- get_compression_type() CompressionType
- get_encoding() Encoding
The encoding is initially
None
. After a successful file loading or saving operation, the encoding is non-None
.
- get_newline_type() NewlineType
- is_deleted() bool
Returns whether the file has been deleted. If the
location
isNone
, returnsFalse
.To have an up-to-date value, you must first call
check_file_on_disk
.
- is_externally_modified() bool
Returns whether the file is externally modified. If the
location
isNone
, returnsFalse
.To have an up-to-date value, you must first call
check_file_on_disk
.
Properties
- class File
- props.compression_type: CompressionType
The compression type.
- props.encoding: Encoding
The character encoding, initially
None
. After a successful file loading or saving operation, the encoding is non-None
.
- props.newline_type: NewlineType
The line ending type.
Fields
- class File
- parent_instance