% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paths.R
\name{paths}
\alias{paths}
\alias{get_path}
\alias{set_path}
\title{Set or Get the \code{path} Attribute to or from an Object}
\usage{
get_path(x, force = FALSE)

set_path(x, path, action = c(NA, "read", "write"), overwrite = FALSE)
}
\arguments{
\item{x}{An object.}

\item{force}{Force the retrieval, even if the path is not valid? Only meant
for unit testing, leave alone!}

\item{path}{The path to be set.}

\item{action}{Do we have a read or write process? Passed by
\code{\link{read_csv}} and \code{\link{write_csv}}. Leave alone otherwise.}

\item{overwrite}{Overwrite an existing \emph{path} attribute instead of
throwing an error?}
}
\value{
For \code{get_path} the value of \code{attr(x, "path")}.

For \code{set_path} the modified object.
}
\description{
We set paths on some objects, these are convenience wrappers to
\code{\link{attr}}.
}
\examples{
x <- 2
path <- tempfile()
touch(path)
x <- set_path(x, path)
get_path(x)
}
\seealso{
Other file utilities: 
\code{\link{clipboard_path}()},
\code{\link{delete_trailing_blank_lines}()},
\code{\link{delete_trailing_whitespace}()},
\code{\link{develop_test}()},
\code{\link{file_copy}()},
\code{\link{file_modified_last}()},
\code{\link{file_save}()},
\code{\link{find_files}()},
\code{\link{get_mtime}()},
\code{\link{get_unique_string}()},
\code{\link{is_files_current}()},
\code{\link{is_path}()},
\code{\link{search_files}()},
\code{\link{split_code_file}()},
\code{\link{touch}()}
}
\concept{file utilities}
