.th C_CREAT II 6/79
.sh NAME
c_creat - create a new contiguous file and allocate its storage.
.sh SYNOPSIS
.nf
	(c_creat =   )
	sys c_creat; name; mode; nfiles; nchunks
	(file descriptor in r0)
	c_creat(name, mode, nfiles, nchunks)
	char *name;
	int mode, nfiles, nchunks;
.fi
.sh DESCRIPTION
	File creation, with the difference that the amount of storage
allocated to a file is specified at creation time, is guaranteed to
be on physically contiguous storage, and has fixed size for the life of
the file.  The call acts like creat(II) but the number of files and size
of each file must also be specified.
.s2
	From C, if nfiles > 1, name will be incremented.  If name = 
"name", a string of digits of sufficient length
is appended to the end
so that "name000", "name001", ... are created.
.s2
	The files that are created have the properties that:  1. within
each file, all storage allocated is physically contiguous; 2. if nfiles
> 1, "name000" immediately precedes in physical storage "name001", ... .
3. If nchunks >= boundsize, each created file satisfies 
.s2
.nf
((address of start of file) mod boundsize = 0), 
.fi
.s2
i.e. each file starts at the beginning of a cfs boundary.
.s2
	The first file that is created is opened for reading and writing,
no other files are opened.  All files, if they previously
existed, have their previous contents truncated.
.sh "SEE ALSO"
creat(II), stat(II), cfs(V)
.sh DIAGNOSTICS
	The error bit (c-bit) may be set for any of the same reasons
as creat(II), or if not a large enough contiguous region was available.
From C, a -1 return indicates an error.
.sh AUTHOR
Mitchell Gart, University of California, Berkeley and Ampex Corporation,
Redwood City
.sh BUGS
	There should ba a more general name incrementation scheme.
.s2
	Lots of files can be wiped out, and lots of storage space allocated,
with one system call.
