GCab.File

g GCab.File GCab.File GObject.Object GObject.Object GObject.Object->GCab.File

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new_with_bytes (name, bytes)

class

new_with_file (name, file)

get_attributes ()

get_bytes ()

get_date (result)

get_date_time ()

get_extract_name ()

get_file ()

get_name ()

get_size ()

set_attributes (attr)

set_bytes (bytes)

set_date (tv)

set_date_time (dt)

set_extract_name (name)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

bytes

GLib.Bytes

r/w

bytes

file

Gio.File

r/w

file

name

str

r/w

name

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class GCab.File(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GCab.FileClass

An opaque object, referencing a file in a Cabinet.

classmethod new_with_bytes(name, bytes)
Parameters:
  • name (str) – name of the file within the cabinet

  • bytes (GLib.Bytes) – a GLib.Bytes to be added to the cabinet

Returns:

a new GCab.File

Return type:

GCab.File

Create a GCab.File from a given GLib.Bytes.

If this file is to be added to an archive you should also probably use GCab.File.set_date() and GCab.File.set_attributes() to set sensible values.

New in version 1.0.

classmethod new_with_file(name, file)
Parameters:
  • name (str) – name of the file within the cabinet

  • file (Gio.File) – a Gio.File to be added to the cabinet

Returns:

a new GCab.File

Return type:

GCab.File

Create a GCab.File from a given Gio.File, to be added to a GCab.Cabinet for archive creation.

get_attributes()
Returns:

the cabinet file attributes

Return type:

int

Get the file attributes.

New in version 0.6.

get_bytes()
Returns:

the associated GLib.Bytes or None

Return type:

GLib.Bytes

Get the Gio.File associated with self. This will only be non-None if the GCab.File has been created using GCab.File.new_with_bytes().

New in version 1.0.

get_date(result)
Parameters:

result (GLib.TimeVal) – a GLib.TimeVal to return date

Returns:

True if tv was set

Return type:

bool

Get the file date, in result.

New in version 0.6.

get_date_time()
Returns:

file date, or None if unknown.

Return type:

GLib.DateTime

Gets the file date and returns it as a GLib.DateTime..

New in version 1.4.

get_extract_name()
Returns:

a file name

Return type:

str or None

Get the file name to use for extraction, or None.

get_file()
Returns:

the associated Gio.File or None

Return type:

Gio.File

If the cabinet is being created, get the Gio.File associated with self. This must be an exisiting file that can be read, in order to be added to the archive during cabinet creation.

If self is from an existing cabinet, the fuction will return None.

get_name()
Returns:

the cabinet file name

Return type:

str

Get the file name within the cabinet.

get_size()
Returns:

the cabinet file size

Return type:

int

Get the file size.

New in version 0.6.

set_attributes(attr)
Parameters:

attr (int) – the attributes, e.g. GCab.FileAttribute.RDONLY

Set the file attributes.

New in version 1.0.

set_bytes(bytes)
Parameters:

bytes (GLib.Bytes) – a GLib.Bytes

Replace the GLib.Bytes associated with self. This is most usefule when the GCab.File has been created using GCab.File.new_with_bytes() and the data needs to be modified.

New in version 1.5.

set_date(tv)
Parameters:

tv (GLib.TimeVal) – a GLib.TimeVal

Sets the file modification date, instead of the value provided by the Gio.File.

New in version 1.0.

set_date_time(dt)
Parameters:

dt (GLib.DateTime) – a GLib.DateTime

Sets the file modification date (instead of the date provided by the Gio.File)

New in version 1.4.

set_extract_name(name)
Parameters:

name (str or None) – a file name or None

Sets the file name to use for extraction, instead of the name provided by the Cabinet.

Property Details

GCab.File.props.bytes
Name:

bytes

Type:

GLib.Bytes

Default Value:

None

Flags:

READABLE, WRITABLE

bytes

GCab.File.props.file
Name:

file

Type:

Gio.File

Default Value:

None

Flags:

READABLE, WRITABLE

file

GCab.File.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

name