Title: | 'Rcpp' Interface for Querying System Configuration Variables |
---|---|
Description: | The 'getconf' command-line tool provided by 'libc' allows querying of a large number of system variables. This package provides similar functionality. |
Authors: | Dirk Eddelbuettel [aut, cre] |
Maintainer: | Dirk Eddelbuettel <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.3.1 |
Built: | 2024-11-17 05:55:33 UTC |
Source: | https://github.com/eddelbuettel/rcppgetconf |
Retrieve all configuration settings
getAll(path = ".")
getAll(path = ".")
path |
An optional character object specifying a path. Default is the current directory. |
This functions returns all configuration settings which can be queried
in a data.frame object. The system-level functions sysconf
,
pathconf
and confstr
provide all the underlying information.
A data.frame with three colums for key, value and (source) type.
Not all keys return a value; in those cases an empty string is returned.
Type is one of path
, sys
and conf
and signals how the
value was obtained.
Dirk Eddelbuettel
if (Sys.info()[["sysname"]] != "SunOS") { head(getAll(), 30) subset(getAll(), type=="path") }
if (Sys.info()[["sysname"]] != "SunOS") { head(getAll(), 30) subset(getAll(), type=="path") }
Retrieve one configuration setting
getConfig(var, path = ".")
getConfig(var, path = ".")
var |
An character object specifying a value for which configuration is queried. |
path |
An optional character object specifying a path. Default is the current directory. |
This functions returns the configuration setting for a given input.
in a data.frame object. The system-level functions sysconf
,
pathconf
and confstr
provide the underlying information.
A result value corresponding to the requested setting. The return type can be either integer for a numeric value, character for text or NULL in case to value could be retrieved.
Dirk Eddelbuettel
if (Sys.info()[["sysname"]] != "SunOS") { getConfig("_NPROCESSORS_CONF") # number of processor getConfig("LEVEL1_ICACHE_SIZE") # leve1 cache size getConfig("GNU_LIBC_VERSION") # libc version }
if (Sys.info()[["sysname"]] != "SunOS") { getConfig("_NPROCESSORS_CONF") # number of processor getConfig("LEVEL1_ICACHE_SIZE") # leve1 cache size getConfig("GNU_LIBC_VERSION") # libc version }