| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/paths.R |
| 3 |
\name{is_abs_path} |
| 4 |
\alias{is_abs_path} |
| 5 |
\alias{is_rel_path} |
| 6 |
\title{Test if paths are relative or absolute} |
| 7 |
\usage{ |
| 8 |
is_abs_path(x) |
| 9 |
|
| 10 |
is_rel_path(x) |
| 11 |
} |
| 12 |
\arguments{ |
| 13 |
\item{x}{A vector of paths.} |
| 14 |
} |
| 15 |
\value{ |
| 16 |
A logical vector. |
| 17 |
} |
| 18 |
\description{ |
| 19 |
On Unix, check if the paths start with \file{/} or \file{~} (if they do, they |
| 20 |
are absolute paths). On Windows, check if a path remains the same (via |
| 21 |
\code{\link[=same_path]{same_path()}}) if it is prepended with \file{./} (if it does, it is a |
| 22 |
relative path). |
| 23 |
} |
| 24 |
\examples{ |
| 25 |
xfun::is_abs_path(c("C:/foo", "foo.txt", "/Users/john/", tempdir())) |
| 26 |
xfun::is_rel_path(c("C:/foo", "foo.txt", "/Users/john/", tempdir())) |
| 27 |
} |