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 will result 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 unix:cmd/1
; on a Unix platform they are equivalent.
Examples:
LsOut = os:cmd("ls"), % on unix platform DirOut = os:cmd("dir"),