Gambas Documentation - /comp/gb/file

/comp/gb/file

# File (gb)

This class is used for:

- Representing a file opened with the OPEN instruction.

- Accessing standard input, output and error streams.

- Manipulating file paths, with its static methods.

You cannot create this class directly. You must use the OPEN instruction.

This class inherits Stream.
This class is not creatable.

Static properties | Static methods
--- | ---

Returns the standard error output stream.
Err
Returns the standard input stream.
In
Returns the standard output stream.
Out

Returns the name of a file without its extension.
BaseName
Returns the directory component of a file path.
Dir
Returns the extension of a file name.
Ext
Loads a file and returns its contents as a string.
Load
Returns the name component of a file path.
Name
Saves the contents of a string into a file.
Save
Sets the base name of a path, and returns the modified path.
SetBaseName
Sets the directory part of a path, and returns the modified path.
SetDir
Sets the file extension of a path, and returns the modified path.
SetExt
Sets the file name part of a path, and returns the modified path.
SetName

Properties | Methods | Events
--- | --- | ---

Returns or sets if the stream is blocking.
Blocking
Returns or sets the byte order used to read or write binary data to the stream.
ByteOrder
This property signals whether the last use of LINE INPUT reached the end of file, instead of reading a full line with an end-of-line character.
EndOfFile
Returns or sets the newline separator used by this stream.
EndOfLine
Returns the system file descriptor associated with this Stream.
Handle
Returns a virtual object that allows you to enumerate a stream line by line.
Lines
Returns or sets the tag associated with the stream.
Tag

Start to buffer data written to the stream, so that everything will be sent when the Send method is called.
Begin
Closes the stream.
Close
Drop the data that has been buffered since the last call to the Begin method.
Drop
Read a line of text from the stream, like the LINE INPUT instruction.
ReadLine
Send all the data, in one shot, since the last call to Begin.
Send

This event is raised when there is something to read from the file.
Read
This event is raised when writing to the file is possible.
Write