File: file_move.Rd

package info (click to toggle)
r-cran-fs 1.6.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 744 kB
  • sloc: cpp: 1,288; ansic: 530; sh: 13; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 875 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/file.R
\name{file_move}
\alias{file_move}
\title{Move or rename files}
\usage{
file_move(path, new_path)
}
\arguments{
\item{path}{A character vector of one or more paths.}

\item{new_path}{New file path. If \code{new_path} is existing directory, the file
will be moved into that directory; otherwise it will be moved/renamed to
the full path.

Should either be the same length as \code{path}, or a single directory.}
}
\value{
The new path (invisibly).
}
\description{
Compared to \link{file.rename} \code{file_move()} always fails if it is unable to move
a file, rather than signaling a Warning and returning an error code.
}
\examples{
\dontshow{.old_wd <- setwd(tempdir())}
file_create("foo")
file_move("foo", "bar")
file_exists(c("foo", "bar"))
file_delete("bar")
\dontshow{setwd(.old_wd)}
}