\HeaderA{writeLines}{Write Lines to a Connection}{writeLines}
\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 function calls
\code{\LinkA{file}{file}} to obtain a 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, CR on Classic MacOS).  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{\LinkA{writeChar}{writeChar}} on a binary connection.
\end{Details}
\begin{SeeAlso}\relax
\code{\LinkA{connections}{connections}}, \code{\LinkA{writeChar}{writeChar}}, \code{\LinkA{writeBin}{writeBin}},
\code{\LinkA{readLines}{readLines}}, \code{\LinkA{cat}{cat}}
\end{SeeAlso}

