![]() |
![]() |
![]() |
Thunar-VFS Reference Manual | ![]() |
---|
ThunarVfsInfoThunarVfsInfo — |
#include <thunar-vfs/thunar-vfs.h> ThunarVfsInfo; ThunarVfsInfo* thunar_vfs_info_new_for_path (ThunarVfsPath *path, GError **error); ThunarVfsInfo* thunar_vfs_info_ref (ThunarVfsInfo *info); void thunar_vfs_info_unref (ThunarVfsInfo *info); gboolean thunar_vfs_info_execute (const ThunarVfsInfo *info, GdkScreen *screen, GList *path_list, GError **error); gboolean thunar_vfs_info_rename (ThunarVfsInfo *info, const gchar *name, GError **error); gboolean thunar_vfs_info_matches (const ThunarVfsInfo *a, const ThunarVfsInfo *b); void thunar_vfs_info_list_free (GList *info_list);
typedef struct { /* File type */ ThunarVfsFileType type : 8; /* File permissions and special mode flags */ ThunarVfsFileMode mode : 12; /* File flags */ ThunarVfsFileFlags flags : 12; /* Owner's user id */ ThunarVfsUserId uid; /* Owner's group id */ ThunarVfsGroupId gid; /* Size in bytes */ ThunarVfsFileSize size; /* time of last access */ ThunarVfsFileTime atime; /* time of last modification */ ThunarVfsFileTime mtime; /* time of last status change */ ThunarVfsFileTime ctime; /* inode id */ ThunarVfsFileInode inode; /* device id */ ThunarVfsFileDevice device; /* file's mime type */ ThunarVfsMimeInfo *mime_info; /* file's absolute path */ ThunarVfsPath *path; /* file's custom icon (path or themed icon name) */ gchar *custom_icon; /* file's display name (UTF-8) */ gchar *display_name; } ThunarVfsInfo;
ThunarVfsFileType type : 8; |
the file type. |
ThunarVfsFileMode mode : 12; |
the file permissions and special mode flags. |
ThunarVfsFileFlags flags : 12; |
the file flags. |
ThunarVfsUserId uid ; |
the owner's user id. |
ThunarVfsGroupId gid ; |
the owner's group id. |
ThunarVfsFileSize size ; |
the file size in bytes. |
ThunarVfsFileTime atime ; |
the time of last access. |
ThunarVfsFileTime mtime ; |
the time of last modification. |
ThunarVfsFileTime ctime ; |
the time of last status change. |
ThunarVfsFileInode inode ; |
the file's inode. |
ThunarVfsFileDevice device ; |
the file's device. |
ThunarVfsMimeInfo *mime_info ; |
the file's mime type. |
ThunarVfsPath *path ; |
the file's path. |
gchar *custom_icon ; |
a custom icon name or NULL .
|
gchar *display_name ; |
the file's display name (UTF-8). |
ThunarVfsInfo* thunar_vfs_info_new_for_path (ThunarVfsPath *path, GError **error);
Queries the ThunarVfsInfo for the given path
. Returns the
ThunarVfsInfo if the operation is successfull, else NULL
.
In the latter case, error
will be set to point to a GError
describing the cause of the failure.
path : |
the ThunarVfsPath of the file whose info should be queried. |
error : |
return location for errors or NULL .
|
Returns : | the ThunarVfsInfo for path or NULL .
|
ThunarVfsInfo* thunar_vfs_info_ref (ThunarVfsInfo *info);
Increments the reference count on info
by 1 and
returns a pointer to info
.
info : |
a ThunarVfsInfo. |
Returns : | a pointer to info .
|
void thunar_vfs_info_unref (ThunarVfsInfo *info);
Decrements the reference count on info
by 1 and if
the reference count drops to zero as a result of this
operation, the info
will be freed completely.
info : |
a ThunarVfsInfo. |
gboolean thunar_vfs_info_execute (const ThunarVfsInfo *info, GdkScreen *screen, GList *path_list, GError **error);
Executes the file referred to by info
, given path_list
as parameters,
on the specified screen
. info
may refer to either a regular,
executable file, or a .desktop
file, whose
type is Application
.
info : |
a ThunarVfsInfo. |
screen : |
a GdkScreen or NULL to use the default GdkScreen.
|
path_list : |
the list of ThunarVfsPaths to give as parameters
to the file referred to by info on execution.
|
error : |
return location for errors or NULL .
|
Returns : | TRUE on success, else FALSE .
|
gboolean thunar_vfs_info_rename (ThunarVfsInfo *info, const gchar *name, GError **error);
Tries to rename the file referred to by info
to the
new name
.
The rename operation is smart in that it checks the
type of info
first, and if info
refers to a
.desktop
file, the file name
won't be touched, but instead the Name
field of the .desktop
will be
changed to name
. Else, if info
refers to a regular
file or directory, the file will be given a new
name.
info : |
a ThunarVfsInfo. |
name : |
the new file name in UTF-8 encoding. |
error : |
return location for errors or NULL .
|
Returns : | TRUE on success, else FALSE .
|
gboolean thunar_vfs_info_matches (const ThunarVfsInfo *a, const ThunarVfsInfo *b);
Checks whether a
and b
refer to the same file
and share the same properties.
a : |
a ThunarVfsInfo. |
b : |
a ThunarVfsInfo. |
Returns : | TRUE if a and b match.
|
void thunar_vfs_info_list_free (GList *info_list);
Unrefs all ThunarVfsInfos in info_list
and
frees the list itself.
info_list : |
a list of ThunarVfsInfos. |
<< ThunarVfsPath | Utility Functions >> |