TDMS_OpenFile
- Updated2023-02-21
- 2 minute(s) read
int TDMS_OpenFile (const char *filePath, int readOnly, TDMSFileHandle *file);
Purpose
![]() |
Note This function has been superseded by TDMS_OpenFileEx. The new function takes an additional parameter for options. Calling TDMS_OpenFile is equivalent to calling TDMS_OpenFileEx with 0 for the options parameter. |
Opens a file handle for an existing TDM Streaming file. Pass the file handle to other TDM Streaming Library functions to read or modify the file contents. Call TDMS_SaveFile to save file modifications to disk.
Call the TDMS_CloseFile function to close the file handle when you finish using the file.
Parameters
| Input | ||
| Name | Type | Description |
| filePath | const char * | The path to the file that will be opened. If this value is not an absolute pathname, then the pathname is relative to the current working directory. |
| readOnly | int | Specify a nonzero value or select True in the function panel to allow only read access to the file. Specify 0 or select False in the function panel to allow read and write access to the file. If the current user does not have write privileges for the file or if the file is marked read-only, pass a nonzero value for this parameter. |
| 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 8.1 and later
© 2016 National Instruments. All rights reserved.
Example
Refer to TDM Streaming\tdmsReader.cws for an example of using the TDMS_OpenFile function.
