company logo

File operations

OSI supports implicit file or I/O operations, which can be called from any OSI functions. One way to read data from or write data to a file is the File object. In order to provide more specific support for special file types, more specific file classes are supported by OSI:

  • TextFile - for supporting text files (ASCII, UTF8)
  • BinaryFile - for supporting binary files
  • IniFile - for supporting ini- or configuration files (classical ini-file or XML configuration file)
  • ZipArchive - for accessing files in zip-archives
  • MP3File - Accessing MP3 files and its header information

One may create any number of local or global file objects.

Local file objects created within an OSI function are closed, when leaving the function. Nevertheless, it is suggested always closing file instances explicitly. Supported functions are listed in "Service Classes".

// local file object

VARIABLES

  TextFile              file;

PROCESS

  if ( !file.open('test.txt') )

    Message("File 'test.txt' could not be opened");

  else

    file.write("File opened successfully");

  file.close;

...