TDMS_CreateFileEx
- Updated2023-02-21
- 3 minute(s) read
int TDMS_CreateFileEx (char *filePath, TDMSFileFormat fileFormat, TDMSByteOrder byteOrder, unsigned int options, char *name, char *description, char *title, char *author, TDMSFileHandle *file);
Purpose
Creates a file handle for a new .tdms file. Pass the new file handle to other TDM Streaming Library functions to modify the file contents. Call TDMS_SaveFile to save the file to disk.
Call the TDMS_CloseFile function to close the file handle when you finish using the file.
Parameters
| Input | ||||||||||
| Name | Type | Description | ||||||||
| filePath | char * | The path to the file to create. If this value is not an absolute pathname, then the pathname is relative to the current working directory. | ||||||||
| fileFormat | TDMSFileFormat | The format of the file to be created. Use the highest version of the file format supported by your system unless you have a specific need for a previous version. Some functionality in this library is only available when you use newer versions of the file format. The 2.0 version of the TDM Streaming file format includes all features from version 1.0, as well as additional features. |
||||||||
| byteOrder | TDMSByteOrder | The byte order of the data as it will be stored in the .tdms file. You must pass one of the following values:
If you will be writing and reading .tdms files on systems with different byte orders, you can choose whether the byte order conversion happens while writing the file or reading the file by choosing the appropriate byte order. If the byte order of a system reading a .tdms file does not match the byte order of the file then the TDM Streaming library will convert the data being read, but will leave the file on disk unchanged. |
||||||||
| options | unsigned int | Pass TDMS_CreateFileDisableBuffering if you want the TDM Streaming Library to write to and read from this file without Windows system buffering. By disabling system buffering you can speed up data transfers in certain situations. If you have a small amount of data to transfer you might not notice a difference if you disable buffering. If the file is located on a Redundant Array of Independent Disks (RAID) you should consider accessing the file without buffering to speed up data transfers. The TDMS_CreateFileDisableBuffering option is only supported on Windows operating systems and when using version 2.0 or later of the TDM Streaming file format. Pass TDMS_CreateFileDoNotCreateIndexFile if you do not want the TDM Streaming Library to create an index file. An index file is a separate file with the same basename and a .tdms_index file extension that contains summary information from the .tdms file. In some situations an index file can speed up access to the .tdms file contents. To specify two or more flags, combine them with the bitwise OR operator as shown: TDMS_CreateFileDisableBuffering | TDMS_CreateFileDoNotCreateIndexFile To specify none of the flags, pass 0. |
||||||||
| name | char * | The value of the Name property of the file object. This property is stored in the file and can be accessed with the TDMS_SetFileProperty and TDMS_GetFileProperty functions. | ||||||||
| description | char * | The value of the Description property of the file object. This property is stored in the file and can be accessed with the TDMS_SetFileProperty and TDMS_GetFileProperty functions. | ||||||||
| title | char * | The value of the Title property of the file object. This property is stored in the file and can be accessed with the TDMS_SetFileProperty and TDMS_GetFileProperty functions. | ||||||||
| author | char * | The value of the Author property of the file object. This property is stored in the file and can be accessed with the TDMS_SetFileProperty and TDMS_GetFileProperty functions. | ||||||||
| Output | ||||||||||
| Name | Type | Description | ||||||||
| file | TDMSFileHandle | The handle for the TDM Streaming file. Pass this handle to TDM Streaming Library functions that require a file. Call TDMS_SaveFile to save the file to disk. Call TDMS_CloseFile to close the file handle when you finish using the file. | ||||||||
Return Value
| Name | Type | Description |
| status | int | Return value indicating whether the function was successful. Unless otherwise stated, zero represents successful execution and a negative number represents the error code. Error codes are defined in cvi\include\cvitdms.h. |
Additional Information
Library: TDM Streaming Library
Include file: cvitdms.h
LabWindows/CVI compatibility: LabWindows/CVI 2009 and later
© 2016 National Instruments. All rights reserved.