\HeaderA{writeCdf}{Creates a binary CDF file}{writeCdf}
\keyword{file}{writeCdf}
\keyword{IO}{writeCdf}
\keyword{internal}{writeCdf}
\begin{Description}\relax
This function creates a binary CDF file given a valid CDF structure
containing all necessary elements.

\emph{Warning: The API for this function is likely to be changed
in future versions.}
\end{Description}
\begin{Usage}
\begin{verbatim}
  writeCdf(fname, cdfheader, cdf, cdfqc, overwrite=FALSE, verbose=0)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{fname}] name of the CDF file.
\item[\code{cdfheader}] A list with a structure equal to the output of \code{readCdfHeader}.
\item[\code{cdf}] A list with a structure equal to the output of
\code{readCdf}.
\item[\code{cdfqc}] A list with a structure equal to the output of \code{readCdfQc}.
\item[\code{overwrite}] Overwrite existing file?
\item[\code{verbose}] how verbose should the output be. 0 means no output,
with higher numbers being more verbose.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function has been validated mainly by reading in various 
ASCII or binary CDF files which are written back as new CDF 
files, and compared element by element with the original files.
\end{Details}
\begin{Value}
This function is used for its byproduct: creating a CDF file.
\end{Value}
\begin{Author}\relax
Kasper Daniel Hansen, \email{khansen@stat.berkeley.edu}
\end{Author}
\begin{SeeAlso}\relax
To read the CDF "regular" and QC units with all necessary fields 
and values for writing a CDF file, see \code{\LinkA{readCdf}{readCdf}},
\code{\LinkA{readCdfQc}{readCdfQc}}() and \code{\LinkA{readCdfHeader}{readCdfHeader}}.
To compare two CDF files, see \code{\LinkA{compareCdfs}{compareCdfs}}.
\end{SeeAlso}

