Browse Source

reslove_alias

master
boB Rudis 6 years ago
parent
commit
b2f9789981
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 1
      NAMESPACE
  2. 8
      R/RcppExports.R
  3. 22
      R/resolve-alias.R
  4. 1
      README.Rmd
  5. 1
      README.md
  6. BIN
      inst/modules/__pycache__/dsstore.cpython-37.pyc
  7. 17
      man/resolve_alias.Rd

1
NAMESPACE

@ -7,6 +7,7 @@ export(kernel_state)
export(logger)
export(read_dsstore)
export(read_plist)
export(resolve_alias)
export(software_update_history)
export(sw_vers)
export(system_profile)

8
R/RcppExports.R

@ -0,0 +1,8 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' @export
resolve_alias <- function(path) {
.Call('_mactheknife_resolve_alias', PACKAGE = 'mactheknife', path)
}

22
R/resolve-alias.R

@ -0,0 +1,22 @@
#' Resolve macOS Alias Files to POSIX path strings
#'
#' @md
#' @param path path to the target alias
#' @return character vector
#' @export
resolve_alias <- function(path) {
if (file.exists(path[1])) {
(applescript(sprintf('
set myPosix to POSIX file "%s"
tell application "Finder"
set myPath to original item of item myPosix
end tell
set myPOSIXPath to POSIX path of (myPath as text)
return myPOSIXPath
', path.expand(path[1]))))
} else {
NULL
}
}

1
README.Rmd

@ -20,6 +20,7 @@ The following functions are implemented:
- `airport_scan`: Scan for available wireless network (requires Wi-Fi enabled Mac)
- `applescript`: Execute AppleScript and Return Results
- `resolve_alias`: Resovle macOS binary alias files to their POSIX path strings
- `kernel_state`: Retrieve kernel state information
- `find_dsstore`: Find and optionally remove '.DS_Store' files on a locally-accessible filesystem
- `read_dsstore`: Read a '.DS_Store' from a file/URL

1
README.md

@ -21,6 +21,7 @@ The following functions are implemented:
- `airport_scan`: Scan for available wireless network (requires Wi-Fi
enabled Mac)
- `applescript`: Execute AppleScript and Return Results
- `resolve_alias`: Resovle macOS binary alias files to their POSIX path strings
- `kernel_state`: Retrieve kernel state information
- `find_dsstore`: Find and optionally remove ‘.DS\_Store’ files on a
locally-accessible filesystem

BIN
inst/modules/__pycache__/dsstore.cpython-37.pyc

Binary file not shown.

17
man/resolve_alias.Rd

@ -0,0 +1,17 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/resolve-alias.R
\name{resolve_alias}
\alias{resolve_alias}
\title{Resolve macOS Alias Files to POSIX path strings}
\usage{
resolve_alias(path)
}
\arguments{
\item{path}{path to the target alias}
}
\value{
character vector
}
\description{
Resolve macOS Alias Files to POSIX path strings
}
Loading…
Cancel
Save