| 1 |
adx |
30 |
Overview of the file management subsystem |
| 2 |
|
|
Adrian Chadd <adrian@creative.net.au> |
| 3 |
|
|
|
| 4 |
knight |
31 |
$Id$ |
| 5 |
adx |
30 |
|
| 6 |
|
|
File operations |
| 7 |
|
|
--------------- |
| 8 |
|
|
|
| 9 |
|
|
The file operations are also wrapped through file_open() and file_close() |
| 10 |
|
|
which handle calling fd_open() / fd_close() and tracking the filedescriptors |
| 11 |
|
|
correctly. fbopen() / fbclose() use file_open() / file_close() too. |
| 12 |
|
|
|
| 13 |
|
|
fileio.c defines the functions: |
| 14 |
|
|
|
| 15 |
|
|
int |
| 16 |
|
|
file_open(const char *filename, int mode, int fmode) |
| 17 |
|
|
|
| 18 |
|
|
A wrapper around open(filename, flags, mode). Read the open manpage for |
| 19 |
|
|
information. file_open() enforces filedescriptor limits and tags the FD |
| 20 |
|
|
through fd_open(). |
| 21 |
|
|
|
| 22 |
|
|
void |
| 23 |
|
|
file_close(int fd) |
| 24 |
|
|
|
| 25 |
|
|
A wrapper around close() for files. close() handles fd_close()ing the fd. |
| 26 |
|
|
|
| 27 |
|
|
|
| 28 |
|
|
FBFILE * |
| 29 |
|
|
fbopen(const char *filename, const char *mode) |
| 30 |
|
|
|
| 31 |
|
|
void |
| 32 |
|
|
fbclose(FBFILE *fb) |
| 33 |
|
|
|
| 34 |
|
|
These are the 'buffered disk IO' routines. You can read the code yourself. |
| 35 |
|
|
Note that these routines use file_open() and file_close(). |