#include "os/os.h"
#include "os_common.h"
#include "base/panic.h"
#include "core/macros.h"
#include <limits.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
Go to the source code of this file.
|
STA_DECL os_error_t | os_file_exists (const char *path) |
| check if a file exists More...
|
|
CT_LOCAL os_file_impl_t | impl_file_open (const char *path, os_access_t access) |
|
STA_DECL os_error_t | os_tmpfile_open (os_file_t *file) |
|
CT_LOCAL bool | impl_file_close (os_file_impl_t file) |
|
STA_DECL os_error_t | os_file_read (os_file_t *file, void *buffer, size_t size, size_t *actual) |
|
STA_DECL os_error_t | os_file_write (os_file_t *file, const void *buffer, size_t size, size_t *actual) |
|
STA_DECL os_error_t | os_file_size (os_file_t *file, size_t *actual) |
|
STA_DECL os_error_t | os_file_resize (os_file_t *file, size_t size) |
| truncate/expand a file to a specific size More...
|
|
STA_DECL os_error_t | os_file_seek (os_file_t *file, size_t offset, size_t *actual) |
|
STA_DECL os_error_t | os_file_tell (os_file_t *file, size_t *actual) |
|
CT_LOCAL void * | impl_file_map (os_file_t *file, os_protect_t protect, size_t size, os_mapping_t *mapping) |
|
CT_LOCAL os_error_t | impl_unmap (os_mapping_t *map) |
|
◆ impl_file_close()
◆ impl_file_map()
◆ impl_file_open()
◆ impl_unmap()
◆ os_file_exists()
STA_DECL os_error_t os_file_exists |
( |
const char * |
path | ) |
|
check if a file exists
- Parameters
-
path | the path to the file to check |
- Returns
- error if the file could not be checked
- Return values
-
eOsExists | if the file exists |
eOsNotFound | if the file does not exist |
Definition at line 38 of file file.c.
◆ os_file_read()
STA_DECL os_error_t os_file_read |
( |
os_file_t * |
file, |
|
|
void * |
buffer, |
|
|
size_t |
size, |
|
|
size_t * |
actual |
|
) |
| |
◆ os_file_resize()
truncate/expand a file to a specific size
- Parameters
-
file | the file to truncate/expand |
size | the size to truncate/expand the file to |
- Returns
- an error if the operation could not be performed
Definition at line 143 of file file.c.
◆ os_file_seek()
STA_DECL os_error_t os_file_seek |
( |
os_file_t * |
file, |
|
|
size_t |
offset, |
|
|
size_t * |
actual |
|
) |
| |
◆ os_file_size()
◆ os_file_tell()
◆ os_file_write()
STA_DECL os_error_t os_file_write |
( |
os_file_t * |
file, |
|
|
const void * |
buffer, |
|
|
size_t |
size, |
|
|
size_t * |
actual |
|
) |
| |
◆ os_tmpfile_open()