home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.uni-stuttgart.de/pub/systems/acorn/
/
Acorn.tar
/
Acorn
/
acornet
/
dev
/
c
/
debug
/
mnemosyn.spk
/
!Mnemosyne
/
sys
/
H
/
File
< prev
next >
Wrap
Text File
|
1991-04-24
|
2KB
|
53 lines
#ifndef _H_FILE
#include <stdio.h> /* For FILE * */
#define _H_FILE 1
#define O_RAW 1
#define O_BINARY 1
#define O_NEW 2
#define O_CREAT 4
#define O_RDWR 8
#define O_RDONLY 16
#define O_TRUNC 32
#define O_EXCL 64
/* Maybe these S_*'s should be in sys/stat.h */
#define S_IRDWR 0
#define S_IFCHR 1 /* For f2c */
/*
* Warning!!! this module by GToal isn't up to the
* standard of Paul's library -- I've just put in
* enough of each procedure to get the particular
* program I've been hacking to work.
* Notably, the fileno/casts to FILE * in file.c
* should understand that 0 == stdin, 1 == stdout,
* and 2 == stderr.
* Also, there are places where we need to turn
* an opened fd back into a filename -- this is
* difficult, unless we remember each filename when
* the file is open()ed or creat()ed. (And of course
* we'd discard this info when it is close()ed)
* Fortunately, the programs I've hacked which
* need this feature always call one of the relevant
* routines immediately after the open, so I've
* bodged it by just remembering the last filename
* (and it's fd, to be sure we've found the right one)
* If you extend this code, please post me back
* your improvements. <gtoal@ed.ac.uk>
*/
extern int chmod(char *f, int mode);
extern int chown(char *f, int owner, int group);
extern int creat(char *f, int mode);
extern int unlink(char *f);
extern long lseek(int fd, long where, int whence);
extern int write(int fd, char *buf, unsigned int bytes);
extern int read(int fd, char *buf, int bytes);
extern int open(char *fname, int mode, ...);
extern int fdopen(int fd, char *mode);
extern int close(int fd);
extern int fileno(FILE *f);
#endif /* _H_FILE */