Lasso Soft Inc. > Home

[ file->writeBytes ]


The [file->writeBytes] method takes in a [bytes] object and writes those bytes to the file referenced in the [file] object's path.

There are two optional parameters that can be passed to the method, the first is the position in the [bytes] object to start writing from and the second is the number of bytes to write. The default values for these parameters are to start at the beginning of the byte stream (1) and write all the bytes ([bytes->size]).

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

Duplicate a file

The code below will create a copy of the file "logo.png" with the name "logo2.png" and make sure both files are properly closed.


local(my_file)  = file('/rhino/logo.png')
local(new_file) = file('/rhino/logo2.png')
#my_file->doWithClose => {
    handle => { #new_file->close }

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