mate-vfs-module-shared

mate-vfs-module-shared

Synopsis

const char *        mate_vfs_mime_type_from_mode        (mode_t mode);
const char *        mate_vfs_mime_type_from_mode_or_default
                                                        (mode_t mode,
                                                         const char *defaultv);
void                mate_vfs_stat_to_file_info          (MateVFSFileInfo *file_info,
                                                         const struct stat *statptr);
MateVFSResult       mate_vfs_set_meta                   (MateVFSFileInfo *info,
                                                         const char *file_name,
                                                         const char *meta_key);
MateVFSResult       mate_vfs_set_meta_for_list          (MateVFSFileInfo *info,
                                                         const char *file_name,
                                                         const GList *meta_keys);
const char *        mate_vfs_get_special_mime_type      (MateVFSURI *uri);

Description

Details

mate_vfs_mime_type_from_mode ()

const char *        mate_vfs_mime_type_from_mode        (mode_t mode);

Returns a MIME type based on the mode if it references a special file (directory, device, fifo, socket or symlink). This function works like mate_vfs_mime_type_from_mode_or_default(), except that it returns NULL where mate_vfs_mime_type_from_mode_or_default() would return a fallback MIME type.

mode :

value as the st_mode field in the system stat structure.

Returns :

a string containing the MIME type, or NULL if mode is not a special file.

mate_vfs_mime_type_from_mode_or_default ()

const char *        mate_vfs_mime_type_from_mode_or_default
                                                        (mode_t mode,
                                                         const char *defaultv);

Returns a MIME type based on the mode if it references a special file (directory, device, fifo, socket or symlink). This function works like mate_vfs_mime_type_from_mode() except that it returns defaultv instead of NULL.

mode :

value as the st_mode field in the system stat structure.

defaultv :

default fallback MIME type.

Returns :

a string containing the MIME type, or defaultv if mode is not a special file.

mate_vfs_stat_to_file_info ()

void                mate_vfs_stat_to_file_info          (MateVFSFileInfo *file_info,
                                                         const struct stat *statptr);

Fills the file_info structure with the values from statptr structure.

file_info :

a MateVFSFileInfo which will be filled.

statptr :

pointer to a 'stat' structure.

mate_vfs_set_meta ()

MateVFSResult       mate_vfs_set_meta                   (MateVFSFileInfo *info,
                                                         const char *file_name,
                                                         const char *meta_key);


mate_vfs_set_meta_for_list ()

MateVFSResult       mate_vfs_set_meta_for_list          (MateVFSFileInfo *info,
                                                         const char *file_name,
                                                         const GList *meta_keys);


mate_vfs_get_special_mime_type ()

const char *        mate_vfs_get_special_mime_type      (MateVFSURI *uri);

Gets the MIME type for uri, this function only returns the type when the uri points to a file that can't be sniffed (sockets, directories, devices, and fifos).

uri :

a MateVFSURI to get the mime type for.

Returns :

a string containing the mime type or NULL if the uri doesn't present a special file.