Chapter 8 Utility Library
© National Instruments Corporation 8-27 LabWindows/CVI Standard Libraries
Return Codes
0 Success.
-1 File not found or directory in path not found.
-3 General I/O error occurred.
-4 Insufficient memory to complete operation.
-5 Invalid path (for example, c:filename in Windows).
-6 Access denied.
Parameter Discussion
fileName may be the empty string (""), in which case the time of the file found by the most
recent call to GetFirstFile or GetNextFile is returned (Windows only).
Example
/* get the time of WAVEFORM.DAT */
int hours,minutes,seconds;
GetFileTime ("waveform.dat",&hours,&minutes,&seconds);
GetFirstFile
int result = GetFirstFile (char searchPath[], int normal, int read-only, int system,
int hidden, int archive, int directory, char fileName[]);
Purpose
Starts a search for files with specified attributes and returns the first matching file. If you select
multiple attributes, a match occurs on the first file for which one or more of the specified
attributes are set and which matches the pattern in the searchPath parameter. The search
attributes are:
• Normal
• Read-only
• System
• Hidden
• Archive
• Directory
Under UNIX, only the directory attribute is honored. If you pass 1 for the directory attribute,
only directories match. If you pass 0 for the directory attribute, only non-directories match.