GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
ffopen(3) FreeBSD Library Functions Manual ffopen(3)

#include <fcntl.h>
#include <xtend/fast-file.h>
-lxtend

ffile_t *ffopen(const char *filename, int flags)

filename    Absolute or relative path of the file to open
flags       Bit flags passed to open(3)

ffopen() initializes a ffile_t stream, much as fopen() does for a FILE stream. Unlike fopen(), ffopen() takes the same bit mask argument as open() to determine the open mode. See open(3) for details.

An optimally sized buffer for the underlying filesystem is allocated, along with additional space for limited ffungetc() operations.

The ffile_t system is simpler than and several times as fast as FILE on typical systems. It is intended for processing large files character-by-character, where low-level block I/O is not convenient, but FILE I/O causes a bottleneck.

A pointer to a ffile_t object on success, NULL on failure

ffile_t *stream;
char    *filename;
// Read only
stream = ffopen(filename, O_RDONLY);
// Overwrite
stream = ffopen(filename, O_WRONLY|O_CREAT|O_TRUNC);
// Append
stream = ffopen(filename, O_WRONLY|O_APPEND);

open(3), ffgetc(3), ffputc(3), ffungetc(3), ffclose(3)


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.