Table Of Contents

Open/Create/Replace File (G Dataflow)

Version:
    Last Modified: April 3, 2017

    Obtains a reference to a file.

    Programming Patterns
    connector_pane_image
    datatype_icon

    prompt

    Custom message in the title bar of the file dialog box that appears when you do not wire a value to the input path.

    datatype_icon

    file path

    Absolute path to the file you want to open. If you do not wire a value to path, this node displays a dialog box from which you can select a file or folder. If you specify an empty or relative path, this node returns an error

    datatype_icon

    operation

    Action that this node is allowed to perform on the specified file.

    Name Description
    open

    Opens an existing file.

    replace

    Replaces an existing file by opening the file and setting its end of file to 0.

    create

    Creates a new file.

    open or create

    Opens an existing file or creates a new file if one does not exist.

    replace or create

    Creates a new file or replaces a file if it exists. This node replaces a file by opening the file and setting its end of file to 0.

    replace or create with confirmation

    Creates a new file or replaces a file if it exists and you give permission. This node replaces a file by opening the file and setting its end of file to 0.

    Default: open

    datatype_icon

    access

    Allowable ways to access the returned file.

    Name Description
    read/write

    Allows you to read or write to the returned file.

    read-only

    Allows you to read from the returned file.

    write-only

    Allows you to write to the returned file.

    Default: read/write

    datatype_icon

    error in

    Error conditions that occur before this node runs.

    The node responds to this input according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    Default: No error

    datatype_icon

    disable buffering

    A Boolean that specifies whether the file opens without buffering, which, for large amounts of data, may increase the rate of data transfer to the file.

    True The file opens without buffering.
    False The file opens with buffering.

    Default: False

    datatype_icon

    refnum out

    Reference to the open file.

    If the file cannot be opened, the value of this output is Not A Refnum.

    datatype_icon

    cancelled?

    A Boolean value that indicates whether the user cancelled the dialog box that appears if no input file was wired to this node.

    True The dialog box was cancelled.
    False The dialog box was not cancelled, or the dialog box did not appear.
    datatype_icon

    error out

    The node produces this output according to standard error behavior.

    This node can return the following error codes.

    7 The user attempted to open or replace a file that cannot be found.
    10 The user attempted to create a file that already exists.
    43 The user cancelled the dialog box.
    spd-note-note
    Note  

    This is not a comprehensive list of errors this node can return.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics