GnomeVFSFileInfo

GnomeVFSFileInfo — stores information about files, GnomeVFS equivalent of stat

Functions

Types and Values

Description

Functions

GNOME_VFS_FILE_INFO_SYMLINK()

#define             GNOME_VFS_FILE_INFO_SYMLINK(info)

Determines whether a file is a symbolic link given info .

Parameters

info

GnomeVFSFileInfo struct

 

GNOME_VFS_FILE_INFO_SET_SYMLINK()

#define             GNOME_VFS_FILE_INFO_SET_SYMLINK(info, value)

Set the symbolic link field in info to value .

Parameters

info

GnomeVFSFileInfo struct

 

value

if TRUE, info is set to indicate the file is a symbolic link

 

GNOME_VFS_FILE_INFO_LOCAL()

#define             GNOME_VFS_FILE_INFO_LOCAL(info)

Determines whether a file is local given info .

Parameters

info

GnomeVFSFileInfo struct

 

GNOME_VFS_FILE_INFO_SET_LOCAL()

#define             GNOME_VFS_FILE_INFO_SET_LOCAL(info, value)

Set the "local file" field in info to value .

Parameters

info

GnomeVFSFileInfo struct

 

value

if TRUE, info is set to indicate the file is local

 

GNOME_VFS_FILE_INFO_SUID()

#define             GNOME_VFS_FILE_INFO_SUID(info)

Determines whether a file belongs to the super user.

Parameters

info

GnomeVFSFileInfo struct

 

GNOME_VFS_FILE_INFO_SGID()

#define             GNOME_VFS_FILE_INFO_SGID(info)

Determines whether a file belongs to the super user's group.

Parameters

info

GnomeVFSFileInfo struct

 

GNOME_VFS_FILE_INFO_STICKY()

#define             GNOME_VFS_FILE_INFO_STICKY(info)

Determines whether a file has the sticky bit set, given info

Parameters

info

GnomeVFSFileInfo struct

 

GNOME_VFS_FILE_INFO_SET_SUID()

#define             GNOME_VFS_FILE_INFO_SET_SUID(info, value)

Set the SUID field in info to value .

Parameters

info

GnomeVFSFileInfo struct

 

value

if TRUE, info is set to indicate the file belongs to the super user

 

GNOME_VFS_FILE_INFO_SET_SGID()

#define             GNOME_VFS_FILE_INFO_SET_SGID(info, value)

Set the SGID field in info to value .

Parameters

info

GnomeVFSFileInfo struct

 

value

if TRUE, info is set to indicate the file belongs to the super user's group

 

GNOME_VFS_FILE_INFO_SET_STICKY()

#define             GNOME_VFS_FILE_INFO_SET_STICKY(info, value)

Set the sticky bit in info to value .

Parameters

info

GnomeVFSFileInfo struct

 

value

if TRUE, info is set to indicate the file has the sticky bit set

 

gnome_vfs_file_info_new ()

GnomeVFSFileInfo *
gnome_vfs_file_info_new (void);

Allocate and initialize a new GnomeVFSFileInfo struct.

Returns

a pointer to the newly allocated file information struct.


gnome_vfs_file_info_unref ()

void
gnome_vfs_file_info_unref (GnomeVFSFileInfo *info);

Decreases the refcount of info by 1. Frees the struct info if refcount becomes 0.

Parameters

info

pointer to a file information struct.

 

gnome_vfs_file_info_ref ()

void
gnome_vfs_file_info_ref (GnomeVFSFileInfo *info);

Increment refcount of info by 1.

Parameters

info

pointer to a file information struct.

 

gnome_vfs_file_info_clear ()

void
gnome_vfs_file_info_clear (GnomeVFSFileInfo *info);

Clear info so that it's ready to accept new data. This is supposed to be used when info already contains meaningful information which we want to replace.

Parameters

info

pointer to a file information struct.

 

gnome_vfs_file_info_get_mime_type ()

const char *
gnome_vfs_file_info_get_mime_type (GnomeVFSFileInfo *info);

Retrieve MIME type from info . There is no need to free the return value.

Parameters

info

a pointer to a file information struct.

 

Returns

a pointer to a string representing the MIME type.


gnome_vfs_file_info_copy ()

void
gnome_vfs_file_info_copy (GnomeVFSFileInfo *dest,
                          const GnomeVFSFileInfo *src);

Copy information from src into dest .

Parameters

dest

pointer to a struct to copy src 's information into.

 

src

pointer to the information to be copied into dest .

 

gnome_vfs_file_info_dup ()

GnomeVFSFileInfo *
gnome_vfs_file_info_dup (const GnomeVFSFileInfo *orig);

Duplicates orig and returns it.

Parameters

orig

pointer to a file information structure to duplicate.

 

Returns

a new file information struct that duplicates the information in orig .


gnome_vfs_file_info_matches ()

gboolean
gnome_vfs_file_info_matches (const GnomeVFSFileInfo *a,
                             const GnomeVFSFileInfo *b);

Compare the two file info structs, return TRUE if they match exactly the same file data.

Parameters

a

first GnomeVFSFileInfo struct to compare.

 

b

second GnomeVFSFileInfo struct to compare.

 

Returns

TRUE if the two GnomeVFSFileInfos match, otherwise return FALSE.


gnome_vfs_file_info_list_ref ()

GList *
gnome_vfs_file_info_list_ref (GList *list);

Increments the refcount of the items in list by one.

Parameters

list

list of GnomeVFSFileInfo elements.

 

Returns

list .


gnome_vfs_file_info_list_unref ()

GList *
gnome_vfs_file_info_list_unref (GList *list);

Decrements the refcount of the items in list by one. Note that the list is *not freed* even if each member of the list is freed.

Parameters

list

list of GnomeVFSFileInfo elements.

 

Returns

list .


gnome_vfs_file_info_list_copy ()

GList *
gnome_vfs_file_info_list_copy (GList *list);

Creates a duplicate of list , and references each member of that list.

Parameters

list

list of GnomeVFSFileInfo elements.

 

Returns

a newly referenced duplicate of list .


gnome_vfs_file_info_list_free ()

void
gnome_vfs_file_info_list_free (GList *list);

Decrements the refcount of each member of list by one, and frees the list itself.

Parameters

list

list of GnomeVFSFileInfo elements.

 

gnome_vfs_get_file_info_result_dup ()

GnomeVFSGetFileInfoResult *
gnome_vfs_get_file_info_result_dup (GnomeVFSGetFileInfoResult *result);

Duplicate result .

Note: The internal uri and fileinfo objects are not duplicated but their refcount is incremented by 1.

Parameters

Returns

a duplicated version of result .

Since: 2.12


gnome_vfs_get_file_info_result_free ()

void
gnome_vfs_get_file_info_result_free (GnomeVFSGetFileInfoResult *result);

Unrefs the internal uri and fileinfo objects and frees the memory allocated for result .

Parameters

Since: 2.12

Types and Values

enum GnomeVFSFileFlags

Packed boolean bitfield representing special flags a GnomeVFSFileInfo struct can have.

Members

GNOME_VFS_FILE_FLAGS_NONE

no flags

 

GNOME_VFS_FILE_FLAGS_SYMLINK

whether the file is a symlink.

 

GNOME_VFS_FILE_FLAGS_LOCAL

whether the file is on a local filesystem

 

enum GnomeVFSFileType

Maps to a stat mode, and identifies the kind of file represented by a GnomeVFSFileInfo struct, stored in the type field.

Members

GNOME_VFS_FILE_TYPE_UNKNOWN

The file type is unknown (none of the types below matches).

 

GNOME_VFS_FILE_TYPE_REGULAR

The file is a regular file (stat: S_ISREG).

 

GNOME_VFS_FILE_TYPE_DIRECTORY

The file is a directory (stat: S_ISDIR).

 

GNOME_VFS_FILE_TYPE_FIFO

The file is a FIFO (stat: S_ISFIFO).

 

GNOME_VFS_FILE_TYPE_SOCKET

The file is a socket (stat: S_ISSOCK).

 

GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE

The file is a character device (stat: S_ISCHR).

 

GNOME_VFS_FILE_TYPE_BLOCK_DEVICE

The file is a block device (stat: S_ISBLK).

 

GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK

The file is a symbolic link (stat: S_ISLNK).

 

enum GnomeVFSFileInfoFields

Flags indicating what fields in a GnomeVFSFileInfo struct are valid. Name is always assumed valid (how else would you have gotten a FileInfo struct otherwise?)

Members

GNOME_VFS_FILE_INFO_FIELDS_NONE

No fields are valid

 

GNOME_VFS_FILE_INFO_FIELDS_TYPE

Type field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS

Permissions field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_FLAGS

Flags field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_DEVICE

Device field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_INODE

Inode field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT

Link count field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_SIZE

Size field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT

Block count field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE

I/O Block Size field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_ATIME

Access time field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_MTIME

Modification time field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_CTIME

Creating time field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_SYMLINK_NAME

Symlink name field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE

Mime type field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_ACCESS

Access bits of the permissions bitfield are valid

 

GNOME_VFS_FILE_INFO_FIELDS_IDS

UID and GID information are valid

 

GNOME_VFS_FILE_INFO_FIELDS_ACL

ACL field is valid

 

GNOME_VFS_FILE_INFO_FIELDS_SELINUX_CONTEXT

SELinux Security context is valid

 

enum GnomeVFSFilePermissions

File permissions. Some of these fields correspond to traditional UNIX semantics, others provide more abstract concepts.

Some network file systems don't support traditional UNIX semantics but still provide file access control. Thus, if you want to modify the permissions (i.e. do a chmod), you should rely on the traditional fields, but if you just want to determine whether a file or directory can be read from or written to, you should rely on the more abstract GNOME_VFS_PERM_ACCESS_* fields.

Members

GNOME_VFS_PERM_SUID

UID bit

 

GNOME_VFS_PERM_SGID

GID bit

 

GNOME_VFS_PERM_STICKY

Sticky bit.

 

GNOME_VFS_PERM_USER_READ

Owner has read permission.

 

GNOME_VFS_PERM_USER_WRITE

Owner has write permission.

 

GNOME_VFS_PERM_USER_EXEC

Owner has execution permission.

 

GNOME_VFS_PERM_USER_ALL

Owner has all permissions.

 

GNOME_VFS_PERM_GROUP_READ

Group has read permission.

 

GNOME_VFS_PERM_GROUP_WRITE

Group has write permission.

 

GNOME_VFS_PERM_GROUP_EXEC

Group has execution permission.

 

GNOME_VFS_PERM_GROUP_ALL

Group has all permissions.

 

GNOME_VFS_PERM_OTHER_READ

Others have read permission.

 

GNOME_VFS_PERM_OTHER_WRITE

Others have write permission.

 

GNOME_VFS_PERM_OTHER_EXEC

Others have execution permission.

 

GNOME_VFS_PERM_OTHER_ALL

Others have all permissions.

 

GNOME_VFS_PERM_ACCESS_READABLE

This file is readable for the current client.

 

GNOME_VFS_PERM_ACCESS_WRITABLE

This file is writable for the current client.

 

GNOME_VFS_PERM_ACCESS_EXECUTABLE

This file is executable for the current client.

 

enum GnomeVFSFileInfoOptions

Packed boolean bitfield representing options that can be passed into a gnome_vfs_get_file_info() call (or other related calls that return file info) and affect the operation of get_file_info.

Members

GNOME_VFS_FILE_INFO_DEFAULT

default flags

 

GNOME_VFS_FILE_INFO_GET_MIME_TYPE

detect the MIME type

 

GNOME_VFS_FILE_INFO_FORCE_FAST_MIME_TYPE

only use fast MIME type detection (extensions)

 

GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE

force slow MIME type detection where available (sniffing, algorithmic detection, etc)

 

GNOME_VFS_FILE_INFO_FOLLOW_LINKS

automatically follow symbolic links and retrieve the properties of their target (recommended)

 

GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS

tries to get data similar to what would return access(2) on a local file system (ie is the file readable, writable and/or executable). Can be really slow on remote file systems

 

GNOME_VFS_FILE_INFO_NAME_ONLY

When reading a directory, only get the filename (if doing so is faster). Useful to e.g. count the number of files.

 

GNOME_VFS_FILE_INFO_GET_ACL

get ACLs for the file

 

GNOME_VFS_FILE_INFO_GET_SELINUX_CONTEXT

   

enum GnomeVFSSetFileInfoMask

Packed boolean bitfield representing the aspects of the file to be changed in a gnome_vfs_set_file_info() call.

Members

GNOME_VFS_SET_FILE_INFO_NONE

don't set any file info fields

 

GNOME_VFS_SET_FILE_INFO_NAME

change the name

 

GNOME_VFS_SET_FILE_INFO_PERMISSIONS

change the permissions

 

GNOME_VFS_SET_FILE_INFO_OWNER

change the file's owner

 

GNOME_VFS_SET_FILE_INFO_TIME

change the file's time stamp(s)

 

GNOME_VFS_SET_FILE_INFO_ACL

change the file's ACLs

 

GNOME_VFS_SET_FILE_INFO_SELINUX_CONTEXT

   

GNOME_VFS_SET_FILE_INFO_SYMLINK_NAME

change the file's symlink name

 

GnomeVFSGetFileInfoResult

typedef struct {
	GnomeVFSURI *uri;
	GnomeVFSResult result;
	GnomeVFSFileInfo *file_info;
} GnomeVFSGetFileInfoResult;

This data structure encapsulates the details of an individual file info request that was part of a mass file info request launched through gnome_vfs_async_get_file_info(), and is passed to a GnomeVFSAsyncGetFileInfoCallback.

Members

GnomeVFSURI *uri;