Basic File Operations
Basic File Operations —
Synopsis
enum GnomeVFSOpenMode;
GnomeVFSResult gnome_vfs_create (GnomeVFSHandle **handle,
const gchar *text_uri,
GnomeVFSOpenMode open_mode,
gboolean exclusive,
guint perm);
GnomeVFSResult gnome_vfs_create_uri (GnomeVFSHandle **handle,
GnomeVFSURI *uri,
GnomeVFSOpenMode open_mode,
gboolean exclusive,
guint perm);
GnomeVFSResult gnome_vfs_open (GnomeVFSHandle **handle,
const gchar *text_uri,
GnomeVFSOpenMode open_mode);
GnomeVFSResult gnome_vfs_open_uri (GnomeVFSHandle **handle,
GnomeVFSURI *uri,
GnomeVFSOpenMode open_mode);
GnomeVFSResult gnome_vfs_close (GnomeVFSHandle *handle);
GnomeVFSResult gnome_vfs_unlink (const gchar *text_uri);
GnomeVFSResult gnome_vfs_unlink_from_uri (GnomeVFSURI *uri);
GnomeVFSResult gnome_vfs_move_uri (GnomeVFSURI *old_uri,
GnomeVFSURI *new_uri,
gboolean force_replace);
GnomeVFSResult gnome_vfs_move (const gchar *old_text_uri,
const gchar *new_text_uri,
gboolean force_replace);
GnomeVFSResult gnome_vfs_check_same_fs_uris (GnomeVFSURI *source_uri,
GnomeVFSURI *target_uri,
gboolean *same_fs_return);
GnomeVFSResult gnome_vfs_check_same_fs (const gchar *source,
const gchar *target,
gboolean *same_fs_return);
gboolean gnome_vfs_uri_exists (GnomeVFSURI *uri);
GnomeVFSResult gnome_vfs_create_symbolic_link
(GnomeVFSURI *uri,
const gchar *target_reference);
Description
Details
enum GnomeVFSOpenMode
typedef enum {
GNOME_VFS_OPEN_NONE = 0,
GNOME_VFS_OPEN_READ = 1 << 0,
GNOME_VFS_OPEN_WRITE = 1 << 1,
GNOME_VFS_OPEN_RANDOM = 1 << 2
} GnomeVFSOpenMode;
gnome_vfs_create ()
GnomeVFSResult gnome_vfs_create (GnomeVFSHandle **handle,
const gchar *text_uri,
GnomeVFSOpenMode open_mode,
gboolean exclusive,
guint perm);
handle : | A pointer to a pointer to a GnomeVFSHandle object
|
text_uri : | String representing the URI to create
|
open_mode : | mode to leave the file opened in after creation (or GNOME_VFS_OPEN_MODE_NONE
to leave the file closed after creation)
|
exclusive : | Whether the file should be created in "exclusive" mode:
i.e. if this flag is nonzero, operation will fail if a file with the
same name already exists.
|
perm : | Bitmap representing the permissions for the newly created file
(Unix style).
|
Returns : | An integer representing the result of the operation
|
gnome_vfs_create_uri ()
GnomeVFSResult gnome_vfs_create_uri (GnomeVFSHandle **handle,
GnomeVFSURI *uri,
GnomeVFSOpenMode open_mode,
gboolean exclusive,
guint perm);
handle : | A pointer to a pointer to a GnomeVFSHandle object
|
uri : | URI for the file to create
|
open_mode : | Open mode
|
exclusive : | Whether the file should be created in "exclusive" mode:
i.e. if this flag is nonzero, operation will fail if a file with the
same name already exists.
|
perm : | Bitmap representing the permissions for the newly created file
(Unix style).
|
Returns : | An integer representing the result of the operation
|
gnome_vfs_open ()
GnomeVFSResult gnome_vfs_open (GnomeVFSHandle **handle,
const gchar *text_uri,
GnomeVFSOpenMode open_mode);
handle : | A pointer to a pointer to a GnomeVFSHandle object
|
text_uri : | String representing the URI to open
|
open_mode : | Open mode
|
Returns : | An integer representing the result of the operation
|
gnome_vfs_open_uri ()
GnomeVFSResult gnome_vfs_open_uri (GnomeVFSHandle **handle,
GnomeVFSURI *uri,
GnomeVFSOpenMode open_mode);
handle : | A pointer to a pointer to a GnomeVFSHandle object
|
uri : | URI to open
|
open_mode : | Open mode
|
Returns : | An integer representing the result of the operation
|
gnome_vfs_close ()
GnomeVFSResult gnome_vfs_close (GnomeVFSHandle *handle);
handle : | A pointer to a GnomeVFSHandle object
|
Returns : | An integer representing the result of the operation.
|
gnome_vfs_unlink ()
GnomeVFSResult gnome_vfs_unlink (const gchar *text_uri);
text_uri : | URI of the file to be unlinked
|
Returns : | An integer representing the result of the operation
|
gnome_vfs_unlink_from_uri ()
GnomeVFSResult gnome_vfs_unlink_from_uri (GnomeVFSURI *uri);
uri : | URI of the file to be unlinked
|
Returns : | An integer representing the result of the operation
|
gnome_vfs_move_uri ()
GnomeVFSResult gnome_vfs_move_uri (GnomeVFSURI *old_uri,
GnomeVFSURI *new_uri,
gboolean force_replace);
old_uri : | Source URI
|
new_uri : | Destination URI
|
force_replace : | If TRUE, move target to new_uri even if there
is already a file at new_uri. If there is a file, it will be discarded.
|
Returns : | An integer representing the result of the operation.
|
gnome_vfs_move ()
GnomeVFSResult gnome_vfs_move (const gchar *old_text_uri,
const gchar *new_text_uri,
gboolean force_replace);
old_text_uri : | Source URI
|
new_text_uri : | Destination URI
|
force_replace : | if TRUE, perform the operation even if it unlinks an existing
file at new_text_uri
|
Returns : | An integer representing the result of the operation.
|
gnome_vfs_check_same_fs_uris ()
GnomeVFSResult gnome_vfs_check_same_fs_uris (GnomeVFSURI *source_uri,
GnomeVFSURI *target_uri,
gboolean *same_fs_return);
source_uri : | A URI
|
target_uri : | Another URI
|
same_fs_return : | Pointer to a boolean variable which will be set to TRUE
if source_uri and target_uri are on the same file system on return.
|
Returns : | An integer representing the result of the operation.
|
gnome_vfs_check_same_fs ()
GnomeVFSResult gnome_vfs_check_same_fs (const gchar *source,
const gchar *target,
gboolean *same_fs_return);
source : | A URI
|
target : | Another URI
|
same_fs_return : | Pointer to a boolean variable which will be set to TRUE
|
Returns : | An integer representing the result of the operation.
|
gnome_vfs_uri_exists ()
gboolean gnome_vfs_uri_exists (GnomeVFSURI *uri);
uri : | A URI
|
Returns : | TRUE if URI exists.
|
gnome_vfs_create_symbolic_link ()
GnomeVFSResult gnome_vfs_create_symbolic_link
(GnomeVFSURI *uri,
const gchar *target_reference);
uri : | URI to create a link at
|
target_reference : | URI "reference" to point the link to (URI or relative path)
|
Returns : | An integer representing the result of the operation
|