% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{.rxWithSink}
\alias{.rxWithSink}
\alias{.rxWithSinkBoth}
\title{With one sink, then release}
\usage{
.rxWithSink(file, code)

.rxWithSinkBoth(file, code)
}
\arguments{
\item{file}{the path to the file sink while running the \code{code}}

\item{code}{The code to run during the sink}
}
\value{
Will return the results of the \code{code} section
}
\description{
With one sink, then release
}
\details{
\code{.rxWithSink} captures output from \code{cat}

\code{.rxWithSinkBoth} captures output from \code{cat} and \code{message}
}
\examples{

t <- tempfile()
.rxWithSink(t, cat("message\n"))
cat("cat2\n") # now you can see the cat2
lines <- readLines(t)
unlink(t)
}
\author{
Matthew Fidler
}
\keyword{internal}
