OS.Constants contains Operating System-specific constants. This module is largely a companion to js-ctypes.
OS.Constants for use in the main thread, add the following snippet to your code:
Components.classes["@mozilla.org/net/osfileconstantsservice;1"]. getService(Components.interfaces.nsIOSFileConstantsService). init();
No initialization is required. Module
OS.Constants is always available for chrome workers.
Constants related to system configuration.
|The name of the operating system (e.g. "Darwin").
|Set to true on debug build configurations, non-existent otherwise.
Paths of well-known files and directories.
|The path to the current profile.
|The path to the user's home directory.
|The path to the user's roaming application data directory.
|The path to the user's local application data directory.
|The path to the programs subdirectory in the user's start menu.
|The path to the user's Library directory.
|The path to the local Applications directory.
Constants for interacting with libc. Useful mostly for using js-ctypes to interact with the following platforms:
OS.Constants.libc is available on all platforms, although some constants are not defined everywhere. Before using a constant, you should check that it is defined.
|Resource temporarily unavailable
|Bad file descriptor
|File too large
|Is a directory
(Not always available under Windows) Too many levels of symbolic links.
|Too many open files in the process
|Name too long
|Too many open files on the system
|No such file or directory
|Cannot allocate memory
|No space on device
|Is not a directory
|Device no configured or does not support operation
|(Not always available under Windows) Operation not supported.
|(Not always available under Windows) Value too large to be stored in datatype.
|Operation not permitted
|Result too large
|(Not always available under Windows) Operation timed out.
|(Not always available under Windows) Operation would block.
Defined on all platforms but meaningful only on Unix.
|Current User can Read, Write, eXecute the file. Equivalent to
S_IRUSR | S_IWUSR | S_IXUSR.
|Current User can Read the file.
|Current User can Write (modify) the file.
|Current User can eXecute the file.
|Current GRouP of the current user can Read, Write, eXecute the file. Equivalent to
S_IRGRP | S_IWGRP | S_IXGRP.
|Current GRouP of the current user can Read the file.
|Current GRouP of the current user can Write (modify) the file.
|Current GRouP of the current user can eXecute the file.
|All Other users can Read, Write, eXecute the file. Equivalent to
S_IROTH | S_IWOTH | S_IXOTH.
|All Other users can Read the file.
|All Other users can Write (modify) the file.
|All Other users can eXecute the file.
|Open the file for appending.
|Create the file if it does not exist yet.
|(Linux only) Succeed only of the file is a directory.
|Descriptor requested for event notifications only.
|Raise an error if O_CREAT is set and the file exists.
|Atomically obtain an exclusive lock.
|Do not follow symbolic links.
|Do not block on open or for data to become available.
|Open the file for read only.
|Open the file for read and write.
|Atomically obtain a shared lock.
|Allow opening of symbolic links.
|(Linux only) Open for purely synchronous access.
|Truncate the file.
|Open the file for write only.
Constants for interacting with the Windows API.
undefined on non-Windows platforms. Useful mostly in conjunction with js-ctypes.