## GCabFile GCabFile — A file contained in the Cabinet |

## Stability Level

Stable, unless otherwise indicated

## Functions

gboolean | (*GCabFileCallback) ()
guint32 | gcab_file_get_attributes ()
void | gcab_file_get_date ()
const gchar * | gcab_file_get_extract_name ()
GFile * | gcab_file_get_file ()
const gchar * | gcab_file_get_name ()
guint32 | gcab_file_get_size ()
GCabFile * | gcab_file_new_with_file ()
void | gcab_file_set_extract_name ()

## Properties

GFile * | file | Read / Write / Construct Only
gchar * | name | Read / Write / Construct Only

## Types and Values

enum | GCabFileAttribute
| GCabFile

## Object Hierarchy

        GEnum
        ╰── GCabFileAttribute
        GObject
        ╰── GCabFile

## Includes

    #include <libgcab.h>

## Description

A GCabFile is a handle to a file inside a Cabinet archive. It can either be a file that is already within an exisiting archive, or a file that reference a file on disk that will be used for a new archive creation. In the later case, `gcab_file_get_file()` must return a valid handle.

## Functions

### GCabFileCallback ()

    gboolean
    (*GCabFileCallback) (GCabFile *file,
                         gpointer user_data);

The type used for callback called when processing Cabinet archive files.

#### Parameters

file | the file being processed |
user_data | user data passed to the callback. |

### gcab_file_get_attributes ()

    guint32
    gcab_file_get_attributes (GCabFile *file);

Get the file attributes.

#### Parameters

file | a GCabFile |

#### Returns

the cabinet file attributes

Since: 0.6

### gcab_file_get_date ()

    void
    gcab_file_get_date (GCabFile *file,
                        GTimeVal *result);

Get the file date, in `result` .

#### Parameters

file | a GCabFile |
result | a GTimeVal to return date |

Since: 0.6

### gcab_file_get_extract_name ()

    const gchar *
    gcab_file_get_extract_name (GCabFile *file);

Get the file name to use for extraction, or `NULL`.

#### Parameters

file | a GCabFile |

#### Returns

a file name.

[allow-none]

### gcab_file_get_file ()

    GFile *
    gcab_file_get_file (GCabFile *file);

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

If `file` is from an existing cabinet, the fuction will return `NULL`.

#### Parameters

file | a GCabFile |

#### Returns

the associated GFile or `NULL`.

[transfer full]

### gcab_file_get_name ()

    const gchar *
    gcab_file_get_name (GCabFile *file);

Get the file name within the cabinet.

#### Parameters

file | a GCabFile |

#### Returns

the cabinet file name

### gcab_file_get_size ()

    guint32
    gcab_file_get_size (GCabFile *file);

Get the file size.

#### Parameters

file | a GCabFile |

#### Returns

the cabinet file size

Since: 0.6

### gcab_file_new_with_file ()

    GCabFile *
    gcab_file_new_with_file (const gchar *name,
                             GFile *file);

Create a GCabFile from a given GFile, to be added to a GCabCabinet for archive creation.

#### Parameters

name | name of the file within the cabinet |
file | a GFile to be added to the cabinet |

#### Returns

a new GCabFile

### gcab_file_set_extract_name ()

    void
    gcab_file_set_extract_name (GCabFile *file,
                                const gchar *name);

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

#### Parameters

file | a GCabFile |
name | a file name or `NULL`. | [allow-none]

## Types and Values

### enum GCabFileAttribute

Attributes associated with the GCabFile.

#### Members

GCAB_FILE_ATTRIBUTE_RDONLY | file is read-only |
GCAB_FILE_ATTRIBUTE_HIDDEN | file is hidden |
GCAB_FILE_ATTRIBUTE_SYSTEM | file is a system file |
GCAB_FILE_ATTRIBUTE_ARCH | file modified since last backup |
GCAB_FILE_ATTRIBUTE_EXEC | run after extraction |
GCAB_FILE_ATTRIBUTE_NAME_IS_UTF | name contains UTF |

### GCabFile

    typedef struct _GCabFile GCabFile;

An opaque object, referencing a file in a Cabinet.

## Property Details

### The `“file”` property

      “file”                     GFile *

file.

Flags: Read / Write / Construct Only

### The `“name”` property

      “name”                     gchar *

name.

Flags: Read / Write / Construct Only

Default value: NULL

## See Also

GCabFolder