Table Of Contents

Open/Create/Replace File (G Dataflow)

Last Modified: January 9, 2017

Obtains a reference to a file. You can read from or modify this file using other File and Dialog nodes.

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 file path.

datatype_icon

file path

Absolute path to the file you want to open.

If you do not wire a value to file path, this node displays a file browser from which you can select a file. If you specify an empty or relative path, this function 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 VI 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.

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 that specifies whether the user cancelled the file browser or did not select a replacement in an advisory dialog box.

TRUE The user cancelled the file browser or did not select a replacement in an advisory dialog box.
FALSE The user specified a path for file path or did not cancel the file browser that appeared.
datatype_icon

error out

Error information. The node produces this output according to standard error behavior.

This node can return the following error codes.

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

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

Where This Node Can Run:

Desktop OS: Windows

FPGA: All devices (only within an Optimized FPGA VI)


Recently Viewed Topics