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.
get_windows_drive(x = getwd())get_drive(x = getwd())
- A character vector of file paths. Defaults to the current directory.
A character vector of drive paths on Windows systems, or forward
slashes on Unix-based systems.
# often takes > 5s to run get_windows_drive(c(".", "~", r_home(), temp_dir(), "\\\\foo/bar"))
Looks like there are no examples yet.