Defining function objects  Defining production objects

Chapter 3: Using MSG-IDE

Defining I/O file objects

An Input/Output (I/O) file object provides the ability to access disk files and to create, edit, and delete these files. The I/O file object references the actual file on the disk and defines access permissions for the file. After you create the file object within MSG-IDE, use methods to create or delete the file and to manipulate its contents.

I/O file objects also give you the ability to read the contents of a directory. In this case, the I/O file object references the directory rather than a specific file. You can then use openDir() and readDir() to create an internal list of the files that exist within the directory and to access each file in the list. See the e-Biz Impact ODL Guide for more information on the file object methods.

StepsDefining an I/O file object

  1. Select Tools | IO File from the MSG-IDE menu bar. The I/O File Object window appears and I/O File now appears in the Classes list.

  2. Select I/O File and click Add.

  3. Click in the Object Name field and type a name for your I/O file object. The name cannot contain a period (.) or a space.

  4. Click in the Associated File field and type the file name.

  5. Choose one of the following I/O Options:

  6. Select from the following Write Options:

    Use these options to specify how the I/O file object writes to the file. These options are not available when Read Only is selected in the I/O Options box.

    You can select only one option, or you can select Create with either the Append or Truncate option. In the latter case, the I/O file object creates the file only if it does not currently exist.

  7. Select from the following Create Permissions options:

    These options are used only when the I/O file object creates a file; they do not affect the permissions set on existing files.

  8. Click the Binary I/O check box to open or transfer the I/O file object associated file in binary rather than text mode.

    This option is useful only on Windows platforms.

  9. Click the Non Blocking I/O check box to never block on a read or write when the file has an enforcement lock.

    When another user has an enforcement lock (rather than an advisory lock) set on a file, if you try to read or write to that file, your application blocks on the read or write call until the other user unlocks the file.

    This does not affect blocking on a lockFile() or lockSeg() method.

  10. Click OK to build the I/O file object and return to the Browse dialog box.





Copyright © 2005. Sybase Inc. All rights reserved. Defining production objects

View this book as PDF