\Header{writeLines}{Write Lines to a Connection}
\keyword{file}{writeLines}
\keyword{connection}{writeLines}
\begin{Description}\relax
Write text lines to a connection.\end{Description}
\begin{Usage}
\begin{verbatim}
writeLines(text, con = stdout(), sep = "\n")
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{text}] A character vector
\item[\code{con}] A connection object or a character string.
\item[\code{sep}] character. A string to be written to the connection after
each line of text.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If the \code{con} is a character string, the functions call
\code{\Link{file}} to obtain an file connection which is opened for
the duration of the function call.

If the connection is open it is written from its current position.
If it is not open, it is opened for the duration of the call and then
closed again.

Normally \code{writeLines} is used with a text connection, and the
default separator is converted to the normal separator for that
platform (LF on Unix/Linux, CRLF on Windows, LF on Macintosh).  For
more control, open a binary connection and specify the precise value
you want written to the file in \code{sep}.  For even more control,
use \code{\Link{writeChar}} on a binary connection.\end{Details}
\begin{SeeAlso}\relax
\code{\Link{connections}}, \code{\Link{writeChar}},
\code{\Link{readLines}}, \code{\Link{cat}}\end{SeeAlso}

