LabWindows/CVI

Content Type
Programming Language
Current manual

GetFileTime

int GetFileTime (char fileName[], int *hours, int *minutes, int *seconds);

Purpose

Gets the time that the file was last modified.

Caution  The Windows SDK also contains a function with the same name. Include windows.h before including utility.h to ensure that there are no compilation errors as a result of this naming conflict. Define the SDK_CONFLICT_PRIORITYSDK_CONFLICT_PRIORITY macro to force LabWindows/CVI to use the Windows SDK implementation of this function.

Example Code

/* Get the time of WAVEFORM.DAT. */
int hours, minutes, seconds;
GetFileTime ("WAVEFORM.DAT", &hours, &minutes, &seconds);

Parameters

Input
Name Type Description
fileName char [] The pathname of the file for which to get the time.

If you specify an empty string "", GetFileTime gets the time of the file found by the most recent call to GetFirstFile or GetNextFile.
Output
Name Type Description
hours int The hours component of the time.

Values: 0 to 23
minutes int The minutes component of the time.

Values: 0 to 59
seconds int The seconds component of the time.

Odd values are rounded down.

Values: 0 to 59

Return Value

Name Type Description
result int The result of the call.

Code Description
0 Success.
-1 File not found or directory in path not found.
-3 General I/O error occurred.
-4 Insufficient memory to complete the operation.
-5 Invalid path; for example, c:filename.
-6 Access denied.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Was this information helpful?

Log in to get a better experience

Help us improve your future ni.com experience.

What are you trying to do?

Submit