file

file

Functions

Types and Values

Description

Functions

file_new ()

File *
file_new (String const *filename,
          FileMode mode);

file_delete ()

FileError
file_delete (File *file);

file_get_filename ()

String const *
file_get_filename (File *file);

file_get_mode ()

FileMode
file_get_mode (File *file);

file_read ()

FileError
file_read (File *file,
           void *buf,
           size_t size,
           size_t *count);

file_read_buffer ()

FileError
file_read_buffer (File *file,
                  Buffer *buffer);

file_write ()

FileError
file_write (File *file,
            const void *buf,
            size_t size,
            size_t *count);

file_write_buffer ()

FileError
file_write_buffer (File *file,
                   Buffer const *buffer);

file_seek ()

FileError
file_seek (File *file,
           FileSeekMode mode,
           FileOffset offset);

file_unlink ()

FileError
file_unlink (File *file);

Types and Values

FileError

typedef int FileError;

FileMode

typedef unsigned int FileMode;

FileOffset

typedef off_t FileOffset;

enum FileSeekMode

Members

FILE_SEEK_MODE_CURRENT

   

FILE_SEEK_MODE_END

   

FILE_SEEK_MODE_SET

   

FILE_MODE_READ

#define FILE_MODE_READ		0x01

FILE_MODE_WRITE

#define FILE_MODE_WRITE		0x02

FILE_MODE_READ_WRITE

#define FILE_MODE_READ_WRITE 0x03

FILE_MODE_APPEND

#define FILE_MODE_APPEND 0x10

FILE_MODE_CREATE

#define FILE_MODE_CREATE 0x20

FILE_MODE_EXCLUSIVE

#define FILE_MODE_EXCLUSIVE 0x40

FILE_MODE_TRUNCATE

#define FILE_MODE_TRUNCATE 0x80

File

typedef struct _File File;