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
_xt_ff_raw_close(3) FreeBSD Library Functions Manual _xt_ff_raw_close(3)

_xt_ff_raw_close() - Close a stream created by _xt_ff_raw_open()

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

int     _xt_ff_raw_close(xt_ff_t *stream)

stream  Pointer to an xt_ff_t object opened by xt_ff_open(3)

_xt_ff_raw_close(3) closes a xt_ff_t stream opened by _xt_ff_raw_open(3). It writes out any remaining data in the output buffer, deallocates memory allocated by xt_ff_open(3), and closes the underlying file descriptor opened by open(3).

The xt_ff_t system is simpler than and much faster than traditional 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.

The return status of the underlying close(3) call

char    *infilename, *outfilename;
xt_ff_t *instream, *outstream;
int     ch;
if ( (instream = xt_ff_open(infilename, O_RDONLY)) == NULL )
{

fprintf(stderr, "Cannot open %s for reading: %s.n",
infilename, strerror(errno));
exit(EX_NOINPUT); } if ( (outstream = xt_ff_open(outfilename, O_WRONLY|O_CREAT|O_TRUNC)) == NULL ) {
fprintf(stderr, "Cannot open %s for writing: %s.n",
outfilename, strerror(errno));
exit(EX_NOINPUT); } while ( (ch = xt_ff_getc(stream)) != EOF )
xt_ff_putc(ch, outstream); xt_ff_close(instream); xt_ff_close(outstream);

xt_ff_open(3), xt_ff_getc(3), xt_ff_putc(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.