Advanced File Functions下載 PDF選擇的小節所選的小節與子小節完整手冊已更新2025-07-30閱讀時間為 5 分鐘LabVIEWAPI 參考LabVIEW G Use the Advanced File VIs and functions to manipulate files, directories, and paths. Get File Position FunctionReturns the position of the current file mark of the file identified by refnum relative to the beginning of the file.Get File Size FunctionGets the file size of file. This function does not work for files inside an LLB.Get Permissions FunctionReturns 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 FunctionReads 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.Preallocated Read from Binary File FunctionReads 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.File DialogDisplays a dialog box with which you can specify the path to a file or directory.Set File Position FunctionMoves 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 FunctionSets 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 FunctionSets 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 FunctionSets 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 VIOpens 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.Is Name Multiplatform VIChecks 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.Create File with Incrementing Suffix VICreates 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.Move FunctionMoves 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.Copy FunctionCopies 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.Delete FunctionDeletes the file or directory specified by path. This function does not work for files inside an LLB.Flush File FunctionWrites all buffers of the file identified by refnum to disk and updates the directory entry of the file associated with refnum.Deny Access FunctionReopens 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/Directory Info FunctionReturns 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.Get Volume Info FunctionReturns 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.Create Folder FunctionCreates the appropriate folder specified by path.List Folder FunctionReturns 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.Check if File or Folder Exists VIChecks 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.Recursive File List VILists the contents of a folder or LLB.Refnum to Path FunctionReturns the path associated with the specified refnum.Path Type FunctionReturns the type of the specified path, indicating whether it is an absolute, relative, or <Not A Path>.Compare Two Paths VICompares 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.Get File Extension VIReturns the file extension, without the period (.), of a file you specify.File Checksum VIComputes the message digest on the contents of a file. You must manually select the polymorphic instance you want to use.Generate Temporary File Path VIReturns a unique file path to the temporary directory. This VI only returns a path. It does not create the temporary file.DatalogUse 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 LibraryUse the Packed Library VIs to get and return data from a packed project library.Create Directory Recursive VICreates a directory and any parent directories it requires to exist.Create File and Containing Folders VICreates a file at a specified path and any folders within that path that do not exist.Path To String FunctionConverts path into a string describing a path in the standard format of the platform.String To Path FunctionConverts a string, describing a path in the standard format for the current platform, to a path.Path to Array of Strings FunctionConverts a path into an array of strings and indicates whether the path is relative.Array of Strings to Path FunctionConverts an array of strings into a relative or absolute path.Parent topic: File I/O
Use the Advanced File VIs and functions to manipulate files, directories, and paths. Get File Position FunctionReturns the position of the current file mark of the file identified by refnum relative to the beginning of the file.Get File Size FunctionGets the file size of file. This function does not work for files inside an LLB.Get Permissions FunctionReturns 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 FunctionReads 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.Preallocated Read from Binary File FunctionReads 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.File DialogDisplays a dialog box with which you can specify the path to a file or directory.Set File Position FunctionMoves 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 FunctionSets 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 FunctionSets 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 FunctionSets 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 VIOpens 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.Is Name Multiplatform VIChecks 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.Create File with Incrementing Suffix VICreates 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.Move FunctionMoves 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.Copy FunctionCopies 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.Delete FunctionDeletes the file or directory specified by path. This function does not work for files inside an LLB.Flush File FunctionWrites all buffers of the file identified by refnum to disk and updates the directory entry of the file associated with refnum.Deny Access FunctionReopens 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/Directory Info FunctionReturns 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.Get Volume Info FunctionReturns 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.Create Folder FunctionCreates the appropriate folder specified by path.List Folder FunctionReturns 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.Check if File or Folder Exists VIChecks 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.Recursive File List VILists the contents of a folder or LLB.Refnum to Path FunctionReturns the path associated with the specified refnum.Path Type FunctionReturns the type of the specified path, indicating whether it is an absolute, relative, or <Not A Path>.Compare Two Paths VICompares 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.Get File Extension VIReturns the file extension, without the period (.), of a file you specify.File Checksum VIComputes the message digest on the contents of a file. You must manually select the polymorphic instance you want to use.Generate Temporary File Path VIReturns a unique file path to the temporary directory. This VI only returns a path. It does not create the temporary file.DatalogUse 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 LibraryUse the Packed Library VIs to get and return data from a packed project library.Create Directory Recursive VICreates a directory and any parent directories it requires to exist.Create File and Containing Folders VICreates a file at a specified path and any folders within that path that do not exist.Path To String FunctionConverts path into a string describing a path in the standard format of the platform.String To Path FunctionConverts a string, describing a path in the standard format for the current platform, to a path.Path to Array of Strings FunctionConverts a path into an array of strings and indicates whether the path is relative.Array of Strings to Path FunctionConverts an array of strings into a relative or absolute path.Parent topic: File I/O
Use the Advanced File VIs and functions to manipulate files, directories, and paths. Get File Position FunctionReturns the position of the current file mark of the file identified by refnum relative to the beginning of the file.Get File Size FunctionGets the file size of file. This function does not work for files inside an LLB.Get Permissions FunctionReturns 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 FunctionReads 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.Preallocated Read from Binary File FunctionReads 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.File DialogDisplays a dialog box with which you can specify the path to a file or directory.Set File Position FunctionMoves 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 FunctionSets 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 FunctionSets 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 FunctionSets 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 VIOpens 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.Is Name Multiplatform VIChecks 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.Create File with Incrementing Suffix VICreates 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.Move FunctionMoves 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.Copy FunctionCopies 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.Delete FunctionDeletes the file or directory specified by path. This function does not work for files inside an LLB.Flush File FunctionWrites all buffers of the file identified by refnum to disk and updates the directory entry of the file associated with refnum.Deny Access FunctionReopens 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/Directory Info FunctionReturns 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.Get Volume Info FunctionReturns 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.Create Folder FunctionCreates the appropriate folder specified by path.List Folder FunctionReturns 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.Check if File or Folder Exists VIChecks 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.Recursive File List VILists the contents of a folder or LLB.Refnum to Path FunctionReturns the path associated with the specified refnum.Path Type FunctionReturns the type of the specified path, indicating whether it is an absolute, relative, or <Not A Path>.Compare Two Paths VICompares 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.Get File Extension VIReturns the file extension, without the period (.), of a file you specify.File Checksum VIComputes the message digest on the contents of a file. You must manually select the polymorphic instance you want to use.Generate Temporary File Path VIReturns a unique file path to the temporary directory. This VI only returns a path. It does not create the temporary file.DatalogUse 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 LibraryUse the Packed Library VIs to get and return data from a packed project library.Create Directory Recursive VICreates a directory and any parent directories it requires to exist.Create File and Containing Folders VICreates a file at a specified path and any folders within that path that do not exist.Path To String FunctionConverts path into a string describing a path in the standard format of the platform.String To Path FunctionConverts a string, describing a path in the standard format for the current platform, to a path.Path to Array of Strings FunctionConverts a path into an array of strings and indicates whether the path is relative.Array of Strings to Path FunctionConverts an array of strings into a relative or absolute path.Parent topic: File I/O