Greenbone Vulnerability Management Libraries
11.0.1
|
Protos for file utility functions. More...
#include <glib.h>
Go to the source code of this file.
Functions | |
int | gvm_file_check_is_dir (const char *name) |
Checks whether a file is a directory or not. More... | |
int | gvm_file_remove_recurse (const gchar *pathname) |
Recursively removes files and directories. More... | |
gboolean | gvm_file_copy (const gchar *, const gchar *) |
Copies a source file into a destination file. More... | |
gboolean | gvm_file_move (const gchar *, const gchar *) |
Moves a source file into a destination file. More... | |
char * | gvm_file_as_base64 (const char *) |
Get the content of a file in base64 format. More... | |
gchar * | gvm_export_file_name (const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *) |
Generates a file name for exporting. More... | |
Protos for file utility functions.
This file contains the protos for fileutils.c
Definition in file fileutils.h.
gchar* gvm_export_file_name | ( | const char * | fname_format, |
const char * | username, | ||
const char * | type, | ||
const char * | uuid, | ||
const char * | creation_iso_time, | ||
const char * | modification_iso_time, | ||
const char * | name, | ||
const char * | format_name | ||
) |
Generates a file name for exporting.
[in] | fname_format | Format string. |
[in] | username | Current user name. |
[in] | type | Type of resource. |
[in] | uuid | UUID of resource. |
[in] | creation_iso_time | Creation time of resource in ISO format. |
[in] | modification_iso_time | Modification time of resource (ISO). |
[in] | name | Name of resource. |
[in] | format_name | Name of format plugin. |
Definition at line 223 of file fileutils.c.
char* gvm_file_as_base64 | ( | const char * | path | ) |
Get the content of a file in base64 format.
[in] | path | Path to file. |
Definition at line 192 of file fileutils.c.
int gvm_file_check_is_dir | ( | const char * | name | ) |
Checks whether a file is a directory or not.
This is a replacement for the g_file_test functionality which is reported to be unreliable under certain circumstances, for example if this application and glib are compiled with a different libc.
Symbolic links are not followed.
[in] | name | Name of file or directory. |
Definition at line 53 of file fileutils.c.
Referenced by gvm_file_remove_recurse().
gboolean gvm_file_copy | ( | const gchar * | source_file, |
const gchar * | dest_file | ||
) |
Copies a source file into a destination file.
If the destination file does exist already, it will be overwritten.
[in] | source_file | Source file name. |
[in] | dest_file | Destination file name. |
Definition at line 125 of file fileutils.c.
gboolean gvm_file_move | ( | const gchar * | source_file, |
const gchar * | dest_file | ||
) |
Moves a source file into a destination file.
If the destination file does exist already, it will be overwritten.
[in] | source_file | Source file name. |
[in] | dest_file | Destination file name. |
Definition at line 160 of file fileutils.c.
int gvm_file_remove_recurse | ( | const gchar * | pathname | ) |
Recursively removes files and directories.
This function will recursively call itself to delete a path and any contents of this path.
[in] | pathname | The name of the file to be deleted from the filesystem. |
Definition at line 77 of file fileutils.c.
References gvm_file_check_is_dir(), and gvm_file_remove_recurse().
Referenced by encrypt_stream_internal(), and gvm_file_remove_recurse().