Owning Palette: File I/O VIs and Functions
Requires: Base Development System. This topic might not match its corresponding palette in LabVIEW depending on your operating system, licensed product(s), and target.
Use the Advanced File VIs and functions to manipulate files, directories, and paths.
Palette Object | Description |
---|---|
Array of Strings to Path | Converts an array of strings into a relative or absolute path. |
Check if File or Folder Exists | Checks whether a file or folder exists on disk at a specified path. This VI works with standard files and folders as well as files in LLB files. |
Compare Two Paths | Compares Path 1 to Path 2 and returns a relative path between the two paths, the common path between the two paths, and a Boolean that indicates whether the paths are on the same path hierarchy level. |
Copy | Copies the file or directory that you specify in source path to the location that you specify in target path. If you copy a directory, this function copies all its contents recursively to the new location. You cannot use this function to copy files into or out of an LLB. |
Create Directory Recursive | Creates a directory and any parent directories it requires to exist. |
Create File and Containing Folders | Creates a file at a specified path and any folders within that path that do not exist. |
Create File with Incrementing Suffix | Creates a file and appends an incrementing number suffix to the filename if the file already exists at a specified path. If the file does not exist, this VI creates the file without appending an incrementing number suffix to the filename. |
Create Folder | Creates the appropriate folder specified by path. |
Delete | Deletes the file or directory specified by path. This function does not work for files inside an LLB. |
Deny Access | Reopens the instance of the file specified by refnum to temporarily change what read or write access is denied to other refnums, VIs, or applications. |
File Checksum | Computes the message digest on the contents of a file. You must manually select the polymorphic instance you want to use. |
File Dialog | Displays a dialog box with which you can specify the path to a file or directory. |
File/Directory Info | Returns information about the file or directory specified by path, including its size, its last modification date, whether it is a directory, whether it is a shortcut, and the resolved path if the file or directory is a shortcut. This function does not work for files inside an LLB. |
Flush File | Writes all buffers of the file identified by refnum to disk and updates the directory entry of the file associated with refnum. |
Generate Temporary File Path | Returns a unique file path to the temporary directory. This VI only returns a path. It does not create the temporary file. |
Get File Extension | Returns the file extension, without the period (.), of a file you specify. |
Get File Position | Returns the position of the current file mark of the file identified by refnum relative to the beginning of the file. |
Get File Size | Gets the file size of file. This function does not work for files inside an LLB. |
Get Permissions | Returns the owner, group, and permissions of the file or directory specified by path. This function does not work for files inside an LLB. |
Get Type and Creator | Reads the type and creator of the file specified by path. type and creator are four-character strings. This function does not work for files inside an LLB. |
Get Volume Info | Returns information about the volume containing the file or directory specified by path, including the total storage space provided by the volume and the amount free in bytes. |
Is Name Multiplatform | Checks if a filename is valid on different platforms. This VI checks filenames against only desktop platforms that support LabVIEW, which are Windows, macOS, and Linux. You can choose to check the filename against all possible platforms or against the current platform. |
List Folder | Returns two arrays of strings listing the names of all files and folders found in path, filtering both arrays based upon pattern and filtering the filenames array based upon the specified datalog type. |
Move | Moves the file or directory that you specify in source path to the location that you specify in target path. If you move a directory, this function moves all the contents of the directory recursively to the new location. You cannot use this function to move files into or out of an LLB. |
Path to Array of Strings | Converts a path into an array of strings and indicates whether the path is relative. |
Path To String | Converts path into a string describing a path in the standard format of the platform. |
Path Type | Returns the type of the specified path, indicating whether it is an absolute, relative, or <Not A Path>. |
Preallocated Read from Binary File | Reads binary data from a file and places the data into an array that you have already allocated without incurring a copy of the data. Unlike the Read from Binary File function, this function avoids run-time memory allocations. |
Recursive File List | Lists the contents of a folder or LLB. |
Refnum to Path | Returns the path associated with the specified refnum. |
Set File Position | Moves the position of the current file mark of the file identified by refnum to the position indicated by offset (in bytes) according to the mode in from. |
Set File Size | Sets the file size of file by setting the end-of-file marker to size bytes from the beginning of the file. This function does not work for files inside an LLB. |
Set Permissions | Sets the owner, group, and permissions of the file or directory specified by path. This function does not work for files inside an LLB. |
Set Type and Creator | Sets the type and creator of the file specified by path. type and creator are four-character strings. This function does not work for files inside an LLB.
Only macOS supports setting the type and creator of files. |
Show in File System | Opens a path to a file or directory in (Windows) Windows Explorer, (macOS) the Finder, or (Linux) a file system browser depending on the current platform. If you specify a path to a file that is inside an LLB or a packed project library, this VI opens the path to the LLB or the packed project library. |
String To Path | Converts a string, describing a path in the standard format for the current platform, to a path. |
Subpalette | Description |
---|---|
Datalog Functions | Use the Datalog functions to open and close datalog files, read from and write to datalog files, get and set datalog file positions, and get and set the number of datalog records. |
Packed Library VIs | Use the Packed Library VIs to get and return data from a packed project library. |
Write Filters VIs | Use the Write Filters VIs to protect volumes from unwanted modifications. You can enable, disable, and configure write filters for touch panel devices. |