System object

ATTN: methods of this object are not always available to the script - they depend on feature parameters of VM creation.

Constants
IS_READONLY - int, scanFiles callback/attributes, file/dir is readonly.
IS_DIR - int, scanFiles callback/attributes, file is directory(folder).
IS_HIDDEN - int, scanFiles callback/attributes, file/dir is marked as hidden.
IS_SYSTEM - int, scanFiles callback/attributes, file/dir is marked as internal for the system.
Methods
scanFiles

( path:string [, callback:function] ) :integer

Function calls callback function for each entry found in directory defined by the path. Path can contain wildcards like ? or *. Function returns number of entries scanned.

If callback is ommited then function just returns number of items satisfying path condition. In this form the scan can be used for testing of some file existence as an example.

Callback function shall accept two parameters:

function callback( filename: string, attributes: integer ): bool

where filename is an name of the file and attributes is an integer - OR-ed combination of IS_*** flags. Callback function shall return true if further scanning needed and false to stop enumeration.

home
([relpath:string]) : string

Returns home folder of the application - folder where sciter started from. If relpath is some string then it will be appended to the return value. Use this if you need to find fully qualified file name residing in sciter folder or subfolder.

path
(#std-path [,relpath:string]) : string

Returns path of one of system folders. If relpath is some string then it will be appended to the return value. Use this if you need to find fully qualified file name residing in one of system folders.

#std-path is a symbol, one of:

#SYSTEM Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables. A typical path is C:/WINNT on Windows.
#SYSTEM_BIN System folder. A typical path is C:/WINNT/SYSTEM32 on Windows.
#PROGRAM_FILES Program Files folder. A typical path is C:/Program Files on Windows.
#USER_APPDATA File system directory that serves as a common repository for application-specific data. A typical path is C:/Documents and Settings/username/Application Data on Windows.
#COMMON_APPDATA Application data for all users. A typical path is C:/Documents and Settings/All Users/Application Data on Windows.
#USER_DOCUMENTS File system directory that serves as a common repository for documents. A typical path is C:/Documents and Settings/username/My Documents on Windows.
#COMMON_DOCUMENTS File system directory that contains documents that are common to all users. Typical paths are C:/Documents and Settings/All Users/Documents on Windows.