SIMPOL Documentation

fsfileoutputstream

Description

Provides an interface to open a file in a file system for sequential writing. If the file already exists then all existing contents are deleted unless the append parameter is set to .true.

Type Tags

None

Object Value

The value of an object of type fsfileoutputstream is undefined and it is an error to attempt to get or to set it.

fsfileoutputstream.new()

Description

Opens the specified file system file for writing and creates a new object.

Prototype

fsfileoutputstream.new ( string filename, integer error, boolean append )

Parameters

ParameterDefault valueType nameDescription
filename.nulstring The name of the file to open or create.
error.nulinteger Specifies an object that is used to output any error code generated during the execution of the method. This parameter must be an object, not an integer value. If error is not specified or is .nul then any error that occurs during object creation will halt the program. If an error object is specified and an error occurs during execution then the error code is output into that object and the method returns .nul.
append.falseboolean A boolean value, the default of which is .false, that indicates whether or not to start output at the end of existing data, or to truncate and start at the new beginning.

Properties

PropertyTypeDescription
_type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided.
__type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property.
filenamestring Contains the name of the file to which is being written.
typetype Specifies the fsfileoutputstream type object.

Methods

putblob()

Description

Outputs a blob to the file and returns the number of bytes actually written to the file.

Prototype

fsfileoutputstreamvar.putblob ( blob blob )

Parameters
ParameterDefault valueType nameDescription
blobNoneblob The blob to be output. If this value is .nul or .inf then no bytes will be written.

putinteger()

Description

Writes an integer to a file and returns the number of bytes written.

Prototype

fsfileoutputstreamvar.putinteger ( integer integer, integer length, boolean lbo )

Parameters
ParameterDefault valueType nameDescription
integerNoneinteger The integer value to be output. If this value is .nul or .inf then no bytes will be written.
length1integer The number of bytes to write to the file. If this value is .nul or .inf then no bytes will be written.
lbo.trueboolean Indicates whether integers are to be stored with the least significant byte first (.true) or with the most significant byte first (.false). If this value is .nul or .inf then no bytes will be written.

putstring()

Description

Outputs a string to the file and returns the number of bytes actually written to the file.

Prototype

fsfileoutputstreamvar.putstring ( string string, integer charsize, boolean lbo )

Parameters
ParameterDefault valueType nameDescription
stringNonestring The string value to be output. If this value is .nul or .inf then no characters will be output.
charsize2integer The number of bytes per character, which must be greater than 0. If this value is .nul or .inf then no characters will be written.
lbo.trueboolean Indicates whether characters are to be stored with the least significant byte first (.true) or with the most significant byte first (.false). If this value is .nul or .inf then no characters will be written.