MCPcopy Create free account
hub / github.com/apache/arrow / SetEnvVar

Function SetEnvVar

cpp/src/arrow/util/io_util.cc:1836–1850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1834}
1835
1836Status SetEnvVar(std::string_view name, std::string_view value) {
1837#ifdef _WIN32
1838 if (SetEnvironmentVariableA(name.data(), value.data())) {
1839 return Status::OK();
1840 } else {
1841 return Status::Invalid("failed setting environment variable");
1842 }
1843#else
1844 if (setenv(name.data(), value.data(), 1) == 0) {
1845 return Status::OK();
1846 } else {
1847 return Status::Invalid("failed setting environment variable");
1848 }
1849#endif
1850}
1851
1852Status DelEnvVar(std::string_view name) {
1853#ifdef _WIN32

Callers 4

SetUpMethod · 0.85
EnvVarGuardMethod · 0.85
~EnvVarGuardMethod · 0.85
TESTFunction · 0.85

Calls 3

OKFunction · 0.50
InvalidFunction · 0.50
dataMethod · 0.45

Tested by 4

SetUpMethod · 0.68
EnvVarGuardMethod · 0.68
~EnvVarGuardMethod · 0.68
TESTFunction · 0.68