| Libfm Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#define FM_FILE_INFO (ptr) FmFileInfo; gboolean fm_file_info_can_thumbnail (FmFileInfo *fi); time_t fm_file_info_get_atime (FmFileInfo *fi); goffset fm_file_info_get_blocks (FmFileInfo *fi); const char * fm_file_info_get_collate_key (FmFileInfo *fi); const char * fm_file_info_get_desc (FmFileInfo *fi); dev_t fm_file_info_get_dev (FmFileInfo *fi); const char * fm_file_info_get_disp_mtime (FmFileInfo *fi); const char * fm_file_info_get_disp_name (FmFileInfo *fi); const char * fm_file_info_get_disp_size (FmFileInfo *fi); const char * fm_file_info_get_fs_id (FmFileInfo *fi); gid_t fm_file_info_get_gid (FmFileInfo *fi); FmIcon * fm_file_info_get_icon (FmFileInfo *fi); FmMimeType * fm_file_info_get_mime_type (FmFileInfo *fi); mode_t fm_file_info_get_mode (FmFileInfo *fi); time_t fm_file_info_get_mtime (FmFileInfo *fi); const char * fm_file_info_get_name (FmFileInfo *fi); FmPath * fm_file_info_get_path (FmFileInfo *fi); goffset fm_file_info_get_size (FmFileInfo *fi); const char * fm_file_info_get_target (FmFileInfo *fi); uid_t fm_file_info_get_uid (FmFileInfo *fi); gboolean fm_file_info_is_accessible (FmFileInfo *fi); gboolean fm_file_info_is_desktop_entry (FmFileInfo *fi); gboolean fm_file_info_is_dir (FmFileInfo *fi); gboolean fm_file_info_is_executable_type (FmFileInfo *fi); gboolean fm_file_info_is_hidden (FmFileInfo *fi); gboolean fm_file_info_is_image (FmFileInfo *fi); gboolean fm_file_info_is_mountable (FmFileInfo *fi); gboolean fm_file_info_is_native (FmFileInfo *fi); gboolean fm_file_info_is_shortcut (FmFileInfo *fi); gboolean fm_file_info_is_symlink (FmFileInfo *fi); gboolean fm_file_info_is_text (FmFileInfo *fi); gboolean fm_file_info_is_unknown_type (FmFileInfo *fi); gboolean fm_file_info_list_is_same_fs (FmFileInfoList *list); gboolean fm_file_info_list_is_same_type (FmFileInfoList *list); FmFileInfoList * fm_file_info_list_new (); FmFileInfo * fm_file_info_new (); FmFileInfo * fm_file_info_new_from_gfileinfo (FmPath *path,GFileInfo *inf); FmFileInfo * fm_file_info_new_from_menu_cache_item (FmPath *path,struct _MenuCacheItem *item); FmFileInfo * fm_file_info_ref (FmFileInfo *fi); void fm_file_info_set_disp_name (FmFileInfo *fi,const char *name); void fm_file_info_set_from_gfileinfo (FmFileInfo *fi,GFileInfo *inf); void fm_file_info_set_from_menu_cache_item (FmFileInfo *fi,struct _MenuCacheItem *item); gboolean fm_file_info_set_from_native_file (FmFileInfo *fi,const char *path,GError **err); void fm_file_info_set_path (FmFileInfo *fi,FmPath *path); void fm_file_info_unref (FmFileInfo *fi); void fm_file_info_update (FmFileInfo *fi,FmFileInfo *src);
goffset fm_file_info_get_blocks (FmFileInfo *fi);
|
A FmFileInfo struct |
Returns : |
how many filesystem blocks used by the file. |
const char * fm_file_info_get_collate_key (FmFileInfo *fi);
Get the collate key used for locale-dependent
filename sorting. The keys of different files
can be compared with strcmp() directly.
|
A FmFileInfo struct |
Returns : |
a const string owned by FmFileInfo which should not be freed. |
const char * fm_file_info_get_desc (FmFileInfo *fi);
Get a human-readable description for the file.
|
A FmFileInfo struct |
Returns : |
a const string owned by FmFileInfo which should not be freed. |
dev_t fm_file_info_get_dev (FmFileInfo *fi);
Get the filesystem device id (POSIX dev_t)
This is only applicable when the file is native.
e.g. fm_file_info_is_native() returns TRUE.
|
A FmFileInfo struct |
Returns : |
device id (POSIX dev_t, st_dev member of struct stat). |
const char * fm_file_info_get_disp_mtime (FmFileInfo *fi);
Get a human-readable string for showing file modification time in the UI.
|
A FmFileInfo struct |
Returns : |
a const string owned by FmFileInfo which should not be freed. |
const char * fm_file_info_get_disp_name (FmFileInfo *fi);
Get the display name used to show the file in the file manager UI. The display name is guaranteed to be UTF-8 and may be different from the real file name on the filesystem.
|
A FmFileInfo struct |
Returns : |
a const strin owned by FmFileInfo which should not be freed. |
const char * fm_file_info_get_disp_size (FmFileInfo *fi);
Get the size of the file as a human-readable string. It's convinient for show the file size to the user.
|
A FmFileInfo struct |
Returns : |
a const string owned by FmFileInfo which should not be freed. (non-NULL) |
const char * fm_file_info_get_fs_id (FmFileInfo *fi);
Get the filesystem id string
This is only applicable when the file is on a remote
filesystem. e.g. fm_file_info_is_native() returns FALSE.
|
A FmFileInfo struct |
Returns : |
a const string owned by FmFileInfo which should not be freed. |
gid_t fm_file_info_get_gid (FmFileInfo *fi);
|
A FmFileInfo struct |
Returns : |
group id (gid) of the file owner. |
FmIcon * fm_file_info_get_icon (FmFileInfo *fi);
Get the icon used to show the file in the file manager.
|
A FmFileInfo struct |
Returns : |
a FmIcon struct. The returned FmIcon struct is
owned by FmFileInfo and should not be freed.
If you need to keep it, use fm_icon_ref() to obtain a
reference. |
FmMimeType * fm_file_info_get_mime_type (FmFileInfo *fi);
Get the mime-type of the file.
|
A FmFileInfo struct |
Returns : |
a FmMimeType struct owned by FmFileInfo which
should not be freed.
If you need to keep it, use fm_mime_type_ref() to obtain a
reference. |
mode_t fm_file_info_get_mode (FmFileInfo *fi);
Get the mode of the file. For detail about the meaning of
mode, see manpage of stat() and the st_mode struct field.
|
A FmFileInfo struct |
Returns : |
mode_t value of the file as defined in POSIX struct stat. |
time_t fm_file_info_get_mtime (FmFileInfo *fi);
|
A FmFileInfo struct |
Returns : |
file access time. |
const char * fm_file_info_get_name (FmFileInfo *fi);
Get the base name of the file in filesystem encoding.
|
A FmFileInfo struct |
Returns : |
a const string owned by FmFileInfo which should not be freed. |
FmPath * fm_file_info_get_path (FmFileInfo *fi);
Get the path of the file
|
A FmFileInfo struct |
Returns : |
a FmPath struct. The returned FmPath struct is
owned by FmFileInfo and should not be freed.
If you need to keep it, use fm_path_ref() to obtain a
reference. |
goffset fm_file_info_get_size (FmFileInfo *fi);
|
A FmFileInfo struct |
Returns : |
the size of the file in bytes. |
const char * fm_file_info_get_target (FmFileInfo *fi);
Get the target of a symlink or a shortcut.
|
A FmFileInfo struct |
Returns : |
a const string owned by FmFileInfo which should not be freed. NULL if the file is not a symlink or shortcut. |
uid_t fm_file_info_get_uid (FmFileInfo *fi);
|
A FmFileInfo struct |
Returns : |
user id (uid) of the file owner. |
gboolean fm_file_info_is_accessible (FmFileInfo *fi);
Checks if the user has read access to file or directory fi.
|
a file info descriptor |
Returns : |
TRUE if fi is accessible for user. |
Since 1.0.1
FmFileInfo * fm_file_info_new ();
Returns : |
a new FmFileInfo struct which needs to be freed with
fm_file_info_unref() when it's no more needed. |
FmFileInfo * fm_file_info_new_from_gfileinfo (FmPath *path,GFileInfo *inf);
Create a new FmFileInfo for file pointed by path based on
information stored in the GFileInfo object.
|
FmPath of a file |
|
a GFileInfo object |
Returns : |
A new FmFileInfo struct which should be freed with
fm_file_info_unref() when no longer needed. |
FmFileInfo * fm_file_info_new_from_menu_cache_item (FmPath *path,struct _MenuCacheItem *item);
FmFileInfo * fm_file_info_ref (FmFileInfo *fi);
Increase reference count of the FmFileInfo struct.
|
A FmFileInfo struct |
Returns : |
the FmFileInfo struct itself |
void fm_file_info_set_disp_name (FmFileInfo *fi,const char *name);
Set the display name used to show the file in the
file manager UI. If NULL is passed for name,
the original display will be freed and the real base name
will be used for display.
|
A FmFileInfo struct |
|
A UTF-8 display name. (can be NULL). |
void fm_file_info_set_from_gfileinfo (FmFileInfo *fi,GFileInfo *inf);
Get file info from the GFileInfo object and store it in the FmFileInfo struct.
|
A FmFileInfo struct |
|
a GFileInfo object |
void fm_file_info_set_from_menu_cache_item (FmFileInfo *fi,struct _MenuCacheItem *item);
gboolean fm_file_info_set_from_native_file (FmFileInfo *fi,const char *path,GError **err);
Get file info of the specified native file and store it in the FmFileInfo struct.
|
A FmFileInfo struct |
|
full path of the file |
|
a GError** to retrive errors |
Returns : |
TRUE if no error happens. |
void fm_file_info_set_path (FmFileInfo *fi,FmPath *path);
Change the path of the FmFileInfo.
|
A FmFileInfo struct |
|
a FmPath struct |
void fm_file_info_unref (FmFileInfo *fi);
Decrease reference count of the FmFileInfo struct. When the last reference to the struct is released, the FmFileInfo struct is freed.
|
A FmFileInfo struct |
void fm_file_info_update (FmFileInfo *fi,FmFileInfo *src);
Update the content of fi by copying file info
stored in src to fi.
|
A FmFileInfo struct |
|
another FmFileInfo struct |