Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
gb
*[]
.Array.Bounds
.Stat.Perm
.Stream.Lines
.Stream.Term
.Symbol
_BoxedString
Application
Args
Array
Boolean[]
Byte[]
Class
Classes
Collection
Component
Components
Date[]
Enum
Env
Error
File
BaseName
DefaultDirAuth
Dir
Err
Ext
In
IsHidden
IsRelative
Load
Name
Out
Read
RealPath
Resize
Save
SetBaseName
SetDir
SetExt
SetName
Write
Float[]
gb
Integer[]
Jit
Long[]
Object
Object[]
Observer
Param
Pointer[]
Process
Short[]
Single[]
Stat
Stream
String
String[]
System
Task
Timer
User
Variant[]
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.stock
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk.opengl
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.opengl
gb.gui.qt
gb.gui.qt.ext
gb.gui.qt.opengl
gb.gui.qt.webkit
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.jit
gb.libxml
gb.logging
gb.map
gb.markdown
gb.media
gb.media.form
gb.memcached
gb.mime
gb.mongodb
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webkit
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.scanner
gb.sdl
gb.sdl.sound
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

File (gb)

This class is used for representing a file opened with the OPEN instruction, accessing standard input, output and error streams, and 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
DefaultDirAuth   Return or set the default authorizations used when creating a new directory with MKDIR.
Err   Returns the standard error output stream.
In   Returns the standard input stream.
Out   Returns the standard output stream.

Static methods
BaseName   Returns the name of a file without its extension.
Dir   Returns the directory component of a file path.
Ext   Returns the extension of a file name.
IsHidden   Return if a file path is hidden.
IsRelative   Return True if Path is a relative path.
Load   Loads a file and returns its contents as a string.
Name   Returns the name component of a file path.
RealPath   Return the the canonicalized absolute pathname of a path, with no symbolic links inside.
Save   Saves the contents of a string into a file.
SetBaseName   Sets the base name of a path, and returns the modified path.
SetDir   Sets the directory part of a path, and returns the modified path.
SetExt   Sets the file extension of a path, and returns the modified path.
SetName   Sets the file name part of a path, and returns the modified path.

Inherited properties
Blocking   Returns or sets if the stream is blocking.
ByteOrder   Returns or sets the byte order used to read or write binary data to the stream.
EndOfFile   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.
EndOfLine   Return or set the newline separator used by this stream.
Eof   Return if a stream reached its end.
Handle   Returns the system file descriptor associated with this Stream.
IsTerm   Return if a stream is associated with a terminal.
Lines   Returns a virtual object that allows you to enumerate a stream line by line.
NoShare  
NullTerminatedString   Return or set if strings are null-terminated when they are serialized.
Tag   Returns or sets the tag associated with the stream.
Term   Return a virtual object that allows to manage the terminal associated with the stream.

Inherited methods
Begin   Start to buffer data written to the stream, so that everything will be sent when the Send method is called.
Close   Closes the stream.
Drop   Drop the data that has been buffered since the last call to the Begin method.
ReadLine   Read a line of text from the stream, like the LINE INPUT instruction.
Send   Send all the data, in one shot, since the last call to Begin.
Watch   Start or stop watching the stream file descriptor for reading or writing, after it has been opened.

Events
Read   This event is raised when there is something to read from the file.
Resize   This special event is raised by the File.In stream when the control terminal of the process is resized.
Write   This event is raised when writing to the file is possible.