OS
Provides common functionality related to the operating system.
Methods
os.args()
os.args()
Returns a list of command line arguments passed to a Ghost script. The first element [0]
is the script name.
os.clock()
os.clock()
Returns the number of nanoseconds elapsed since January 1, 1970 UTC.
January 1st, 1970 at 00:00:00 UTC is referred to as the Unix epoch. Early Unix engineers picked that date arbitrarily because they needed to set a uniform date for the start of time, and New Year's Day, 1970, seemed most convenient.
os.exit()
os.exit()
Causes the current program to exit with the given status code and optional message. Conventionally, code zero indicates success, non-zero an error. The program terminates immediately.
For portability, the status code should be in the range [0, 125]
.
Properties
os.name
os.name
Returns the name of the current operating system:
darwin
(macos)linux
windows
Last updated