os

os

Module

os

Module summary

Operating system-specific functions.

Description

The functions in this module are operating system-specific. Careless use of these functions results in programs that will only run on a specific platform. On the other hand, with careful use, these functions can be of help in enabling a program to run on most platforms.

Exports

cmd(Command) -> string()

Types:

Command = atom() | io_lib:chars()

Executes Command in a command shell of the target OS, captures the standard output of the command, and returns this result as a string. This function is a replacement of the previous function unix:cmd/1; they are equivalent on a Unix platform.

Examples:

LsOut = os:cmd("ls"), % on unix platform