OGMRip Reference Manual | ||||
---|---|---|---|---|
#include <ogmrip-fs.h> void ogmrip_fs_unref (gchar *filename, gboolean do_unlink); gchar* ogmrip_fs_get_tmp_dir (void); void ogmrip_fs_set_tmp_dir (const gchar *dir); gboolean ogmrip_fs_mkdir (const gchar *path, mode_t mode, GError **error); gboolean ogmrip_fs_rmdir (const gchar *path, gboolean recursive, GError **error); gchar* ogmrip_fs_mktemp (const gchar *tmpl, GError **error); gchar* ogmrip_fs_mkftemp (const gchar *tmpl, GError **error); gchar* ogmrip_fs_mkdtemp (const gchar *tmpl, GError **error); gchar* ogmrip_fs_lntemp (const gchar *oldpath, const gchar *newtmpl, gboolean symln, GError **error); gint ogmrip_fs_open_tmp (const gchar *tmpl, gchar **name_used, GError **error); gchar* ogmrip_fs_get_full_path (const gchar *filename); gint64 ogmrip_fs_get_left_space (const gchar *filename, GError **error); gchar* ogmrip_fs_get_mount_point (const gchar *filename, GError **error); gchar* ogmrip_fs_get_extension (const gchar *filename); gchar* ogmrip_fs_set_extension (const gchar *filename, const gchar *extension); gboolean ogmrip_fs_rename (const gchar *old_name, const gchar *new_name, GError **error);
void ogmrip_fs_unref (gchar *filename, gboolean do_unlink);
If do_unlink
is TRUE
, recursively removes filename
then frees the memory
pointed to by filename
.
|
A path to a filename |
|
TRUE to also remove the file
|
gchar* ogmrip_fs_get_tmp_dir (void);
Returns OGMRip's temporary directory.
Returns : |
The temporaty directory |
void ogmrip_fs_set_tmp_dir (const gchar *dir);
Sets OGMRip's temporary directory. If dir
is NULL, OGMRip's temporary
directory will be the system's temporary directory.
|
The new temporary directory |
gboolean ogmrip_fs_mkdir (const gchar *path, mode_t mode, GError **error);
Create the all the directories in path
, if they do not already exist.
|
A path of directories |
|
The file mode |
|
A location to return an error of type G_FILE_ERROR |
Returns : |
TRUE on success, FALSE if an error was set
|
gboolean ogmrip_fs_rmdir (const gchar *path, gboolean recursive, GError **error);
If recusive
is FALSE
, removes the directory of path
if it is empty. If
recusive
is TRUE
, also removes its content recursively.
|
A path to a directory |
|
TRUE to remove the directory and its content recursively
|
|
A location to return an error of type G_FILE_ERROR |
Returns : |
TRUE on success, FALSE if an error was set
|
gchar* ogmrip_fs_mktemp (const gchar *tmpl, GError **error);
Creates a file in OGMRip's temporary directory (as returned by
ogmrip_fs_get_tmp_dir()
).
|
Template for file name, as in g_mkstemp() , basename only
|
|
A location to return an error of type G_FILE_ERROR |
Returns : |
The actual name used, or NULL |
gchar* ogmrip_fs_mkftemp (const gchar *tmpl, GError **error);
Creates a fifo in OGMRip's temporary directory (as returned by
ogmrip_fs_get_tmp_dir()
).
|
Template for fifo name, basename only |
|
A location to return an error of type G_FILE_ERROR |
Returns : |
The actual name used, or NULL |
gchar* ogmrip_fs_mkdtemp (const gchar *tmpl, GError **error);
Creates a directory in OGMRip's temporary directory (as returned by
ogmrip_fs_get_tmp_dir()
).
|
Template for directory name, basename only |
|
A location to return an error of type G_FILE_ERROR |
Returns : |
The actual name used, or NULL |
gchar* ogmrip_fs_lntemp (const gchar *oldpath, const gchar *newtmpl, gboolean symln, GError **error);
Creates a link in OGMRip's temporary directory (as * returned by
ogmrip_fs_get_tmp_dir()
) to æn existing file.
|
A path to an existing file |
|
Template for link name, basename only |
|
TRUE to create a symbolic link
|
|
A location to return an error of type G_FILE_ERROR |
Returns : |
The actual name used, or NULL |
gint ogmrip_fs_open_tmp (const gchar *tmpl, gchar **name_used, GError **error);
Opens a file for writing in OGMRip's temporary directory (as returned by
g_get_tmp_dir()
).
|
Template for file name, as in g_mkstemp() , basename only
|
|
Location to store actual name used |
|
A location to return an error of type G_FILE_ERROR |
Returns : |
A file handle (as from open() ) to the file opened for reading and
writing. The file is opened in binary mode on platforms where there is a
difference. The file handle should be closed with close() . In case of errors,
-1 is returned and error will be set.
|
gchar* ogmrip_fs_get_full_path (const gchar *filename);
Return the full absolute path of filename
.
|
The path to an existing filename |
Returns : |
the full path, or NULL |
gint64 ogmrip_fs_get_left_space (const gchar *filename, GError **error);
Returns the space left in bytes on the device containing filename
.
|
A path to a filename |
|
A location to return an error of type G_FILE_ERROR |
Returns : |
The space left in bytes, or -1 |
gchar* ogmrip_fs_get_mount_point (const gchar *filename, GError **error);
Returns the mount point of the device containing filename
.
|
A path to a filename |
|
A location to return an error of type G_FILE_ERROR |
Returns : |
The moint point, or NULL |
gchar* ogmrip_fs_get_extension (const gchar *filename);
Returns the extension of filename
.
|
The path to an existing filename |
Returns : |
The extension, or NULL |
gchar* ogmrip_fs_set_extension (const gchar *filename, const gchar *extension);
If filename
already has an extension, replaces it with extension
. If not,
appends extension
to filename
.
|
The path to an existing filename |
|
The new extension |
Returns : |
The new name of the file, or NULL |
gboolean ogmrip_fs_rename (const gchar *old_name, const gchar *new_name, GError **error);
If recusive
is FALSE
, removes the directory of path
if it is empty. If
recusive
is TRUE
, also removes its content recursively.
|
The path to an existing filename |
|
The new name of the file |
|
A location to return an error of type G_FILE_ERROR |
Returns : |
TRUE on success, FALSE if an error was set
|