Machine global object
A Machine global object is created for you and is only this object can exist in the application. It is named Machine and is globally accessible.
none.
global name space
ECMerge 2.1
The Machine global object gives a few information about the computer on which the script is executed.
Property | Description |
system_name | String. Read-Only. Name of the system on which the script is executed. |
system_major_version | Integer. Read-Only. Major version of the system. |
system_minor_version | Integer. Read-Only. Minor version of the system. |
Logs the version information for the current machine:
log (Machine.system_name + ' ' +
Machine.system_major_version + ' ' +
Machine.system_minor_version);
none.
function Machine.escape_for_command_line (argument)
returns String
argument. String. A text expected to be passed as argument to the command line of a program
Machine object.
ECMerge 2.1
This method escapes appropriately the text of argument so that you can concatenate it to a command line string.
This sample creates a converter which needs redirected
I/O and sets the arguments of the built-in 'stdioconv'
converter using escape_for_command_line:
converter = new UserProcessFilter;
converter.application_path = ec_get_stdio_converter();
converter.arguments =
Machine.escape_for_command_line(path) + " no \"\" yes $(output)
" + arguments
UserProcessFilter object
function which (filename)
returns String or undefined
filename. String. Name of file to be searched
Machine object.
ECMerge 2.1
This function searches a file which given filename in the directories given by the PATH variable, as would do the "which" command of Unix. The operating system does a similar operation when you enter a program filename to execute on the command line.
The following example searches the path for the GUI version
of merge:
var path=Machine.which("ecmerge" +
ec_get_default_app_extension())
none.