ack/modules/src/system/create.c

29 lines
505 B
C
Raw Normal View History

1987-03-09 15:15:03 +00:00
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
1987-01-06 11:41:50 +00:00
/* $Header$ */
#include <system.h>
extern File *_get_entry();
int
sys_create(filep, path, mode)
File **filep;
char *path;
int mode;
{
register fd;
register File *fp;
if ((fp = _get_entry()) == (File *)0)
return 0;
if ((fd = creat(path, mode)) < 0)
return 0;
fp->o_fd = fd;
fp->o_flags = OP_WRITE;
*filep = fp;
return 1;
}