[This is preliminary documentation and subject to change.]
The Managed Object Format (MOF) compiler parses a file containing MOF statements and adds the classes and instances defined in the file to the CIMOM repository.
mofcomp
[-check]
[-N: <namespace path>]
[-class:updateonly | -class:createonly]
[-instance:updateonly | -instance:createonly]
[-B:<filename>]
[-WMI]
[-P:<Password>]
[-U:<UserName>]
[-A:<Authority>]
[-L:<FLAGS>]
<MOF file>
Authentication value | Description |
---|---|
0 | Default authentication |
1 | Windows NT LAN Manager (NTLM) authentication |
2 | WBEM authentication |
For a thorough description of the authentication schemes supported by WBEM, see WBEM Security.
As its first operation, the MOF compiler performs a syntax check on the MOF file. If it finds any errors, an error message is printed and the process terminates. The following values can be returned:
Return value | Description |
---|---|
0 | MOF compilation was successful. |
1 | MOF compiler could not connect with the CIMOM server possibly due to a semantic error such as an incompatibility with the existing repository or an actual error such as the failure of the CIMOM server to start. |
2 | One or more command line switches were invalid. |
3 | MOF syntax error. |
A file can be compiled with the following simple command line entries:
mofcomp <MOF filename>
When special processing is required, one or more of the switches can be used. All of the switches are optional, and any combination is allowed. However, it does not make sense to use some of the switches in combination with others. For example, to combine the -class:updateonly and -class:createonly switches results in the compiler not performing any action.
A MOF file that is using the Unicode character set contains a signature as the first two bytes of the file. This signature is either U+FFFE or U+FEFF, depending on the byte ordering of the file.
When there are no errors in the parsing process, the MOF compiler connects to the CIMOM server running on the local machine unless the -check switch is specified. Classes and instances defined in the MOF file are added to the repository.
When there is an error in updating the repository, no attempt is made to bring it back to the state it was in before the compiler began processing.
For information about how to declare classes and instances using the MOF syntax, see Using the Managed Object Format (MOF) Language.