/* @(#)fileopen.c	1.8 00/12/03 Copyright 1986, 1995 J. Schilling */
/*
 *	Copyright (c) 1986, 1995 J. Schilling
 */
/*@@C@@*/

#include "io.h"

EXPORT FILE *
fileopen (name, mode)
	const char	*name;
	const char	*mode;
{
	int	ret;
	int	omode = 0;
	int	flag = 0;

	if (!_cvmod (mode, &omode, &flag))
		return (FILE *) NULL;

	if ((ret = _openfd(name, omode)) < 0)
		return (FILE *) NULL;

	return _fcons ((FILE *)0, ret, flag);
}
