Lasso Soft Inc. > Home

[ file->openAppend ]


The [file->openAppend] method can be called on a [file] object to open a file for appending and reading the file. If a path is already stored in the [file] object, it can be called with no parameters. It can also be called with a string specifying the path to a file. If it is called with a path to a file, that new path becomes the path for the [file] object, overriding any previous path.

If [file->openAppend] is called with a file path, it can also take an optional boolean parameter that specifies whether or not to create the file if it doesn't already exist. The default is true which means the file will be created if it does not already exist.

  • Syntax
local(f) = file(...)

local(f) = file

local(f) = file
#f->openAppend('/path/to/file.txt', false)
  • Beginner

Add a line to the end of a file

The code below will add the line "Great Scott!" to the end of the file "test.txt"


local(my_file) = file
handle => {#my_file->close}
#my_file->writeString('\n"Great Scott!"')

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft