71 baciol(
int mode,
long int start,
int size,
long int no,
72 long int *nactual,
int *fdes,
const char *fname,
void *datary)
88 *fdes = open(fname, O_RDONLY , S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP);
92 *fdes = open(fname, O_WRONLY | O_CREAT , S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP);
96 *fdes = open(fname, O_WRONLY | O_CREAT | O_TRUNC , S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP);
100 *fdes = open(fname, O_WRONLY | O_CREAT | O_APPEND , S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP);
104 *fdes = open(fname, O_RDWR | O_CREAT , S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP);
122 if (lseek(*fdes, start, SEEK_SET) == -1)
127 printf(
"Massive catastrophe -- datary pointer is NULL\n");
130 *nactual = read(*fdes, (
void *)datary, (
size_t)no);
141 if (lseek(*fdes, start, SEEK_SET) == -1)
146 printf(
"Massive catastrophe -- datary pointer is NULL\n");
149 *nactual = write(*fdes, (
void *) datary, (
size_t)no);
154 if (close(*fdes) != 0)