get_windows_drive

0th

Percentile

On Windows, return the drive of the path

On a Windows system, this returns the drive letter of the path followed by a colon. On other systems, it returns a single forward slash.

Usage
get_windows_drive(x = getwd())
get_drive(x = getwd())
Arguments
x
A character vector of file paths. Defaults to the current directory.
Value

A character vector of drive paths on Windows systems, or forward slashes on Unix-based systems.

See Also

is_windows_drive

Aliases
  • get_drive
  • get_windows_drive
Examples
 # often takes > 5s to run
get_windows_drive(c(".", "~", r_home(), temp_dir(), "\\\\foo/bar"))

Documentation reproduced from package pathological, version 0.1-1, License: Unlimited

Community examples

Looks like there are no examples yet.