Open/Create/Replace File Function
- Updated2025-07-30
- 4 minute(s) read
Opens an existing file, creates a new file, or replaces an existing file, programmatically or interactively using a file dialog box. This function does not work for files inside an LLB.

Inputs/Outputs
prompt
—
prompt is the message that appears above the list of files and directories or folder in the file dialog box.
file path (use dialog)
—
file path is the absolute path to the file. If you do not wire file path, the function displays a dialog box from which you can select a file. If you specify an empty or relative path, this function returns an error. If file path is the path to a directory that does not exist, this function returns an error. Use the Create Folder function to create a directory.
operation (0:open)
—
operation is the operation to perform. Error 43 occurs if you cancel the dialog box.
access (0:read/write)
—
access specifies how you plan to access the file. The default is read/write.
error in
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
disable buffering (F)
—
disable buffering specifies if the file opens without buffering. The default is FALSE. If you want to read or write a data file to a Redundant Array of Independent Disks (RAID), consider opening the file without buffering to speed up data transfers. To disable buffering, wire a TRUE value to the disable buffering input. Note If you have a small amount of data to transfer, you might not notice a difference if you disable buffering.
(macOS and Linux) LabVIEW ignores this input.
refnum out
—
refnum out is the reference number of the open file. The value is Not A Refnum if the file cannot be opened.
cancelled
—
cancelled is TRUE if you cancel the file dialog box or if you do not select the replacement in an advisory dialog box.
error out
—
error out contains error information. This output provides standard error out functionality. |
You can optionally specify a dialog prompt or default filename. Use this function with the intermediate Write File or Read File functions. Use the Close File function to close the reference to the file.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\File IO\Spreadsheet\Tab-Delimited Data\Tab-Delimited Data.lvproj
prompt
—
file path (use dialog)
—
operation (0:open)
—
error in
—
disable buffering (F)
—
refnum out
—
cancelled
—
error out
—