Thunarx.FileInfo: thunarx-python Reference Manual

## Thunarx.FileInfo Thunarx.FileInfo — Thunarx.FileInfo Reference |

## Synopsis

     Thunarx.FileInfo extends, GObject.GInterface {
      get_name();
      get_uri();
      get_parent_uri();
      get_uri_scheme();
      get_mime_type();
      has_mime_type(mime_type);
      is_directory();
      get_file_info();
      get_filesystem_info();
      get_location();
      changed();
      renamed();
    }

## Ancestry

    +-- GObject.GInterface
        +-- Thunarx.FileInfo

## Description

Each `Thunarx.FileInfo` object is an abstraction of a real file.

## Signals

"changed" | `callback();`
"renamed" | `callback();`

## Public Methods

### Thunarx.FileInfo.get_name

    get_name();

Returns : | Returns the real name of the file represented by file_info in the local file system encoding.

### Thunarx.FileInfo.get_uri

    get_uri();

Returns : | Returns the escaped, fully qualified URI of the file object represented by file_info.

### Thunarx.FileInfo.get_parent_uri

    get_parent_uri();

Returns : | Returns the URI to the parent file of file_info or NULL if file_info has no parent. Note that the parent URI may be of a different type than the URI of file_info. For example, the parent of "file:///" is "computer:///".

### Thunarx.FileInfo.get_uri_scheme

    get_uri_scheme();

Returns : | Returns the URI scheme of the file represented by file_info. E.g. if file_info refers to the file "file:///usr/home", the return value will be "file".

### Thunarx.FileInfo.get_mime_type

    get_mime_type();

Returns : | Returns the MIME-type of the file represented by file_info or NULL if no MIME-type is known for file_info.

### Thunarx.FileInfo.has_mime_type

    has_mime_type();

`mime_type` : | the mime_type to check for
Returns : | Checks whether file_info is of the given mime_type or whether the MIME-type of file_info is a subclass of mime_type. This is the preferred way for most extensions to check whether they support a given file or not, and you should consider using this method rather than Thunarx.FileInfo.get_mime_type(). A simple example would be a menu extension that performs a certain action on text files. In this case you want to check whether a given Thunarx.FileInfo refers to any kind of text file, not only to "text/plain" (e.g. this also includes "text/xml" and "application/x-desktop"). But you should be aware that this method may take some time to test whether mime_type is valid for file_info, so don't call it too often.

### Thunarx.FileInfo.is_directory

    is_directory();

Returns : | Checks whether file_info refers to a directory.

### Thunarx.FileInfo.get_file_info

    get_file_info();

Returns : | Returns the GFileInfo object associated with file_info, which includes additional information about the file_info as queried from GIO earlier.

### Thunarx.FileInfo.get_filesystem_info

    get_filesystem_info();

Returns : | Returns the GFileInfo which includes additional information about the filesystem file_info resides on.

### Thunarx.FileInfo.get_location

    get_location();

Returns : | Returns the GFile file_info points to. The GFile is a more powerful tool than just the URI or the path.

### Thunarx.FileInfo.changed

    changed();

Returns : | Emits the ::changed signal on file_info. This method should not be invoked by Thunar plugins, instead the file manager itself will use this method to emit ::changed whenever it notices a change on file_info.

### Thunarx.FileInfo.renamed

    renamed();

Returns : | Emits the ::renamed signal on file_info. This method should not be invoked by Thunar plugins, instead the file manager will emit this signal whenever the user renamed the file_info. The plugins should instead connect to the ::renamed signal and update it's internal state and it's user interface after the file manager renamed a file.

## Signal Details

### The "changed" Thunarx.FileInfo Signal

Emitted whenever the system notices a change to file_info.

Thunar plugins should use this signal to stay informed about changes to a file_info for which they currently display information (i.e. in a Thunarx.PropertyPage), and update it's user interface whenever a change is noticed on file_info.

### The "renamed" Thunarx.FileInfo Signal

Emitted when the file_info is renamed to another name.

For example, within Thunar, ThunarFolder uses this signal to reregister it's VFS directory monitor, after the corresponding file was renamed.