ae.sys.cmd

Simple execution of shell commands, and wrappers for common utilities.

Members

Aliases

NULL_FILE
deprecated alias NULL_FILE = nullFileName
Undocumented in source.

Functions

expandWindowsEnvVars
string expandWindowsEnvVars(string s)

Expand Windows-like variable placeholders ("%VAR%") in the given string.

getCurrentThreadID
ulong getCurrentThreadID()

Like thisProcessID, but for threads.

getTempFileName
string getTempFileName(string extension)

Returns a very unique name for a temporary file.

iconv
ubyte[] iconv(void[] data, string inputEncoding, string outputEncoding)
string iconv(void[] data, string inputEncoding)

Wrapper for the iconv program.

pipe
T[] pipe(T[] input, string[] args, Params params)

std.process helper. Run a command, feed it the given input, and collect its output. Throw if it exited with non-zero status. Return output.

pipe
deprecated T[] pipe(string[] args, T[] input, Params params)
Undocumented in source. Be warned that the author may not have intended to support it.
query
string query(string[] args, Params params)

std.process helper. Run a command and collect its output. Throw if it exited with a non-zero status.

run
void run(string[] args, Params params)

std.process helper. Run a command, and throw if it exited with a non-zero status.

setEnvironment
void setEnvironment(string[string] env)

Reverse of std.process.environment.toAA

sha1sum
string sha1sum(void[] data)

Wrapper for the sha1sum program.

waitAsync
void waitAsync(Pid pid, void delegate(int) callback)

Wait for process to exit asynchronously. Call callback when it exits. WARNING: the callback will be invoked in another thread!

waitTimeout
int waitTimeout(Pid pid, Duration time)

Like std.process.wait, but with a timeout. If the timeout is exceeded, the program is killed.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>