#include "common.h"
Go to the source code of this file.
Functions | |
| void | file_object_init (void) |
| Initializes this module and must be called before using any other function of this module. | |
| void | file_object_close (void) |
| Releases all used resources and should be called on shutdown. | |
| file_object * | file_object_new (int fd, const char *pathname, int accmode) |
| Acquires a new file object for a given pathname. | |
| file_object * | file_object_open (const char *pathname, int accmode) |
| Acquires a file object for a given pathname and access mode. | |
| ssize_t | file_object_pwrite (const struct file_object *fo, const void *data, size_t buf, filesize_t offset) |
| Write the given data to a file object at the given offset. | |
| ssize_t | file_object_pwritev (const struct file_object *fo, const struct iovec *iov, int iov_cnt, filesize_t offset) |
| Write the given data to a file object at the given offset. | |
| ssize_t | file_object_pread (const struct file_object *fo, void *data, size_t size, filesize_t pos) |
| Read data from the file object from the given offset. | |
| ssize_t | file_object_preadv (const struct file_object *fo, struct iovec *iov, int iov_cnt, filesize_t offset) |
| Read data from a file object from the given offset. | |
| int | file_object_get_fd (const struct file_object *fo) |
| Get the file descriptor associated with a file object. | |
| const char * | file_object_get_pathname (const struct file_object *fo) |
| Get the pathname associated with a file object. | |
| void | file_object_release (struct file_object **fo_ptr) |
| Releases a file object and frees its memory. | |
| void | file_object_revoke (const char *pathname) |
| Revokes all file objects associated with the pathname. | |
|
|
Releases all used resources and should be called on shutdown.
|
|
|
Get the file descriptor associated with a file object. This should not be used lightly and the returned file descriptor should not be cached. Future versions might open/close the file descriptor on demand or dynamically.
|
|
|
Get the pathname associated with a file object.
|
|
|
Initializes this module and must be called before using any other function of this module.
|
|
||||||||||||||||
|
Acquires a new file object for a given pathname. There must not be any file object registered for this pathname already.
|
|
||||||||||||
|
Acquires a file object for a given pathname and access mode. If no matching file object exists, NULL is returned.
|
|
||||||||||||||||||||
|
Read data from the file object from the given offset.
|
|
||||||||||||||||||||
|
Read data from a file object from the given offset.
|
|
||||||||||||||||||||
|
Write the given data to a file object at the given offset.
|
|
||||||||||||||||||||
|
Write the given data to a file object at the given offset.
|
|
|
Releases a file object and frees its memory. The underlying file descriptor however is not closed unless no other file object references it. The pointer is nullified.
|
|
|
Revokes all file objects associated with the pathname. This is useful after moving a file to prevent that file_object_open() returns a file object associated with the now removed file.
|
1.3.9.1