potion  0.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
file.c File Reference

PNFile class for unbuffered blocking file descriptor IO. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#include <assert.h>
#include "potion.h"
#include "internal.h"
#include "table.h"
+ Include dependency graph for file.c:

Go to the source code of this file.

Typedefs

typedef struct PNFile *volatile pn_file
 

Functions

void potion_file_init (Potion *P)
 set Env global More...
 

Variables

char ** environ
 

Detailed Description

PNFile class for unbuffered blocking file descriptor IO.

Only raw and fast POSIX open,read,write,seek calls on fd. fgets (aka readline) is only supported on stdin via the "read" method.

See also
http://stackoverflow.com/questions/1658476/c-fopen-vs-open
the buffile library (PNBufFile) for buffered io via FILE* for fopen, fscanf, fprintf, fread, fgets see there.
the aio library (PNAio) for async non-blocking io, via libuv bindings.

(c) 2008 why the lucky stiff, the freelance professor

Definition in file file.c.

Typedef Documentation

typedef struct PNFile* volatile pn_file

Definition at line 32 of file file.c.

Function Documentation

void potion_file_init ( Potion P)

set Env global

Definition at line 189 of file file.c.

Variable Documentation

char** environ