Lasso Soft Inc. > Home

[File->Open]

Opens a new connection to a file. Requires the name and path to a file as a parameter. Optional parameters may include an open mode and read mode, as in the [File] tag. The open mode and read mode set in the initial [File] tag call are used by default.

  • Syntax
  • Parameters
[File Variable->(Open: '/folder/file.txt')]
Required Parameters
'File path' The name and path to a file.
Optional Parameters
Open Mode The open mode defines the purpose and permissions of the file connection, and may be one of the following values:
  • File_OpenRead – Sets the file connection to read-only.
  • File_OpenWrite – Sets the file connection to write-only.
  • File_OpenReadWrite – Sets the file connection to read and write.
  • File_OpenWriteAppend – Sets the file connection to write and append data.
  • File_OpenWriteTruncate – Sets the file connection to write and truncate data.
  • Read Mode The read mode defines whether the file will be initially read by line or by character, and may be one of the following values:
  • File_ModeChar – Reads a file character by character.
  • File_ModeLine – Reads a character line by line.
  • Examples

    To open a new file:

    Use the [File->Open] tag. The following example closes the connection to the myfile.txt file, and opens a new connection to a file named otherfile.txt.

    [Var:'File'=(File: 'myfile.txt', File_OpenRead, File_ModeChar)]
    [$File->(Open: 'otherfile.txt', File_OpenReadWrite)]
    Tag Link [File->Open] Category File
    Type Member Data Source Any
    Support Preferred Version 7.0
    Output Type None Security File
    Implementation Sets Lasso 7.0

    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