ftp.nice.ch/pub/next/unix/developer/pcn.2.0.s.tar.gz#/src/compiler/ptn_trans/co_fileio.c

This is co_fileio.c in view mode; [Download] [Up]

#ifdef TARGET1

#include "pcn_types.h"

#ifdef SYSV
#include <fcntl.h>
#else  /* SYSV */
#include <sys/file.h>
#endif /* SYSV */


open_file(F,D)
char *F;
int_t *D;
{
    *D = (int_t) open(F,(O_TRUNC | O_WRONLY | O_CREAT),0666);
}

write_char(F,C)
int_t *F;
u_int_t *C;
{
    unsigned char c = (unsigned char)(*C);
    if(write((int) *F, &c, 1) != 1)
	printf("Error: writing to binary file\n");
}

close_file(F)
int_t *F;
{
    if(close((int) *F) != 0)
	printf("Error: when closing binary file\n");
}

#endif TARGET1

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.