D-Bus 1.16.0
|
Functions | |
dbus_bool_t | _dbus_file_exists (const char *file) |
File interface. | |
DBUS_PRIVATE_EXPORT dbus_bool_t | _dbus_file_get_contents (DBusString *str, const DBusString *filename, DBusError *error) |
Appends the contents of the given file to the string, returning error code. | |
dbus_bool_t | _dbus_string_save_to_file (const DBusString *str, const DBusString *filename, dbus_bool_t world_readable, DBusError *error) |
Writes a string out to a file. | |
dbus_bool_t | _dbus_make_file_world_readable (const DBusString *filename, DBusError *error) |
Makes the file readable by every user in the system. | |
dbus_bool_t | _dbus_create_file_exclusively (const DBusString *filename, DBusError *error) |
Creates the given file, failing if the file already exists. | |
DBUS_PRIVATE_EXPORT dbus_bool_t | _dbus_delete_file (const DBusString *filename, DBusError *error) |
Deletes the given file. | |
dbus_bool_t _dbus_create_file_exclusively | ( | const DBusString * | filename, |
DBusError * | error | ||
) |
Creates the given file, failing if the file already exists.
filename | the filename |
error | error location |
Definition at line 395 of file dbus-file-unix.c.
References _dbus_close(), DBUS_ERROR_FAILED, dbus_set_error(), FALSE, NULL, and TRUE.
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_delete_file | ( | const DBusString * | filename, |
DBusError * | error | ||
) |
Deletes the given file.
filename | the filename |
error | error location |
Definition at line 441 of file dbus-file-unix.c.
References _dbus_strerror_from_errno(), DBUS_ERROR_FAILED, dbus_set_error(), FALSE, and TRUE.
dbus_bool_t _dbus_file_exists | ( | const char * | file | ) |
File interface.
File interface.
file | full path to the file |
Definition at line 564 of file dbus-sysdeps-util-unix.c.
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_file_get_contents | ( | DBusString * | str, |
const DBusString * | filename, | ||
DBusError * | error | ||
) |
Appends the contents of the given file to the string, returning error code.
At the moment, won't open a file more than a megabyte in size.
str | the string to append to |
filename | filename to load |
error | place to set an error |
Definition at line 63 of file dbus-file-unix.c.
References _dbus_close(), _dbus_error_from_errno(), _dbus_read(), _dbus_string_set_length(), DBUS_ERROR_FAILED, dbus_set_error(), FALSE, NULL, and TRUE.
Referenced by _dbus_resolve_pid_fd().
dbus_bool_t _dbus_make_file_world_readable | ( | const DBusString * | filename, |
DBusError * | error | ||
) |
Makes the file readable by every user in the system.
filename | the filename |
error | error location |
Definition at line 368 of file dbus-file-unix.c.
References DBUS_ERROR_FAILED, dbus_set_error(), FALSE, and TRUE.
Referenced by _dbus_string_save_to_file().
dbus_bool_t _dbus_string_save_to_file | ( | const DBusString * | str, |
const DBusString * | filename, | ||
dbus_bool_t | world_readable, | ||
DBusError * | error | ||
) |
Writes a string out to a file.
If the file exists, it will be atomically overwritten by the new data.
str | the string to write out |
filename | the file to save string to |
world_readable | If set, ensure the file is world readable |
error | error to be filled in on failure |
If the file exists, it will be atomically overwritten by the new data.
str | the string to write out |
filename | the file to save string to |
world_readable | if true, ensure file is world readable |
error | error to be filled in on failure |
Definition at line 208 of file dbus-file-unix.c.
References _dbus_close(), _dbus_error_from_errno(), _dbus_generate_random_ascii(), _dbus_make_file_world_readable(), _dbus_string_append(), _dbus_string_copy(), _dbus_string_free(), _dbus_string_init(), _dbus_write(), DBUS_ERROR_NO_MEMORY, dbus_set_error(), FALSE, NULL, and TRUE.
Referenced by _dbus_write_uuid_file().