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
,
integer filename
,
boolean error
)
append
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
filename | .nul | string | The name of the file to open or create. |
error | .nul | integer |
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 | .false | boolean |
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
Property | Type | Description |
---|---|---|
_ | 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. |
filename | string | Contains the name of the file to which is being written. |
type | type | 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
Parameter | Default value | Type name | Description |
---|---|---|---|
blob | None | blob |
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
,
boolean length
)
lbo
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
integer | None | integer |
The integer value to be output. If this value is .nul or
.inf then no bytes will be written.
|
length | 1 | integer |
The number of bytes to write to the file. If this value is
.nul or .inf then no bytes
will be written.
|
lbo | .true | boolean |
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
,
integer string
,
boolean charsize
)
lbo
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
string | None | string |
The string value to be output. If this value is .nul or
.inf then no characters will be output.
|
charsize | 2 | integer |
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 | .true | boolean |
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.
|