-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathfile_chmod.Rd
46 lines (40 loc) · 1.18 KB
/
file_chmod.Rd
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/file.R
\name{file_chmod}
\alias{file_chmod}
\title{Change file permissions}
\usage{
file_chmod(path, mode)
}
\arguments{
\item{path}{A character vector of one or more paths.}
\item{mode}{A character representation of the mode, in either hexidecimal or symbolic format.}
}
\description{
Change file permissions
}
\details{
\strong{Cross-compatibility warning:} File permissions differ on Windows
from POSIX systems. Windows does not use an executable bit, so attempting
to change this will have no effect. Windows also does not have user
groups, so only the user permissions (\code{u}) are relevant.
}
\examples{
\dontshow{.old_wd <- setwd(tempdir())}
file_create("foo", mode = "000")
file_chmod("foo", "777")
file_info("foo")$permissions
file_chmod("foo", "u-x")
file_info("foo")$permissions
file_chmod("foo", "a-wrx")
file_info("foo")$permissions
file_chmod("foo", "u+wr")
file_info("foo")$permissions
# It is also vectorized
files <- c("foo", file_create("bar", mode = "000"))
file_chmod(files, "a+rwx")
file_info(files)$permissions
file_chmod(files, c("644", "600"))
file_info(files)$permissions
\dontshow{setwd(.old_wd)}
}