Standard file I/O functions. More...
#include <kanzi/core/legacy/kzs_types.hpp>
Macros | |
#define | KZS_FILE_ERROR |
Result value indicating that an error occurred in the function. More... | |
#define | KZS_FILE_WRITEONLY |
File is opened in writeable text mode. More... | |
#define | KZS_FILE_WRITEONLY_BINARY |
File is opened in writeable binary mode. More... | |
#define | KZS_FILE_READONLY |
File is opened in read only text mode. More... | |
#define | KZS_FILE_READONLY_BINARY |
File is opened in read only binary mode. More... | |
Typedefs | |
typedef void | kzsFile |
File type. More... | |
Enumerations | |
enum | KzsFileOrigin { KZS_FILE_ORIGIN_SEEK_SET, KZS_FILE_ORIGIN_SEEK_CUR, KZS_FILE_ORIGIN_SEEK_END } |
Origin for kzsFseek. More... | |
Functions | |
kzsFile * | kzsFopen (kzString fileName, kzString mode) |
Opens a file. More... | |
kzInt | kzsFclose (kzsFile *file) |
Closes a file. More... | |
kzBool | kzsFeof (kzsFile *file) |
Checks if the end of a file has been reached. More... | |
kzInt | kzsFerror (kzsFile *file) |
Checks if there is an error in a file. More... | |
kzInt | kzsFseek (kzsFile *file, kzInt offset, enum KzsFileOrigin origin) |
Seeks to given position in a file. More... | |
kzInt | kzsFtell (kzsFile *file) |
Gets the current position in a file. More... | |
kzInt | kzsFflush (kzsFile *file) |
Flushes the stream. More... | |
kzInt | kzsFgetc (kzsFile *file) |
Gets a byte from a file. More... | |
kzInt | kzsFputc (kzInt character, kzsFile *file) |
Writes a byte to a file. More... | |
kzUint | kzsFread (void *buffer, kzUint elementSize, kzUint elementCount, kzsFile *file) |
Reads elements from a file. More... | |
kzUint | kzsFwrite (const void *buffer, kzUint elementSize, kzUint elementCount, kzsFile *file) |
Writes elements to a file. More... | |
kzInt | kzsFileno (const kzsFile *file) |
Gets file descriptor. More... | |
kzInt | kzsFileGetSize (kzsFile *file) |
Get the size of a file. More... | |
kzInt | kzsFileReadSkip (kzsFile *file, kzUint byteCount) |
Skips bytes in a file. More... | |
Standard file I/O functions.
Copyright 2008-2017 by Rightware. All rights reserved.
#define KZS_FILE_ERROR |
Result value indicating that an error occurred in the function.
#define KZS_FILE_WRITEONLY |
File is opened in writeable text mode.
#define KZS_FILE_WRITEONLY_BINARY |
File is opened in writeable binary mode.
#define KZS_FILE_READONLY |
File is opened in read only text mode.
#define KZS_FILE_READONLY_BINARY |
File is opened in read only binary mode.
typedef void kzsFile |
File type.
enum KzsFileOrigin |
kzInt kzsFseek | ( | kzsFile * | file, |
kzInt | offset, | ||
enum KzsFileOrigin | origin | ||
) |
Seeks to given position in a file.
Reads elements from a file.
Returns the number of elements read.
Writes elements to a file.
Returns the number of elements written.
Skips bytes in a file.
Returns the number of bytes skipped. Returns KZS_FILE_ERROR if an error occurred. This function is intended for skipping in a file only when reading it. To skip in a writable file, use kzsFseek with KZS_FILE_ORIGIN_SEEK_CUR as origin.