Files
swift-mirror/stdlib/core/Process.swift
Dmitri Hrybenko 0791041eb4 Revert the API change of r5893
This commit merges EnvironmentVariables and CommandLineArguments into a single
swift.Process global variable.  POSIX-dependent parts are available as
extension with "import POSIX".

Original message:

stdlib: split the Process class into a POSIX-dependent (EnvironmentVariables)
and POSIX-independent (CommandLineArguments) parts


Swift SVN r6331
2013-07-17 17:55:24 +00:00

18 lines
451 B
Swift

struct _Process {
// This variable gets (re-)initialized on-demand to reflect the actual argument vector
var _arguments : String[]
var arguments : String[] {
// FIXME: this is not thread-safe. rdar://14193840
if _arguments.length == 0 {
_arguments = new String[Int(C_ARGC)]
for i in 0..Int(C_ARGC) {
_arguments[i] = String.fromCString(C_ARGV[i])
}
}
return _arguments
}
}
var Process : _Process