PRB: FtpFindFirstFile and InternetFindNextFile May Return Incorrect Date (306587)
The information in this article applies to:
- Microsoft Windows CE Operating System, Versions 2.12
- Microsoft Windows CE Operating System, Versions 2.11
- Microsoft Windows CE Operating System, Versions 2.0
- Microsoft Windows CE Operating System, Versions 1.0
- Microsoft Windows CE Operating System, Versions 3.0
This article was previously published under Q306587 SYMPTOMS
When you are using the WinInet API to access File Transfer Protocol (FTP) servers, the FtpFindFirstFile and InternetFindNextFile functions may return file dates that are in the future.
CAUSE
Some UNIX FTP servers (or Microsoft Internet Information Services FTP servers that are configured to run in UNIX folder listing style mode) omit the year part of the date that is sent along with a directory listing if the date is recent. In such cases, WinInet assumes the missing year is the current year and this is reflected in the WIN32_FIND_DATA structure that is returned. However, depending on how the FTP server was configured, in early months of the year WinInet may incorrectly assume the current year for a previous year's date. For example, if the file on the FTP server was created December 15, 2000, and an application that uses WinInet is executed on January 15, 2001, the WIN32_FIND_DATA information will contain a file creation date for the file of December 15, 2001.
RESOLUTION
One way to work around this problem would be to check if the returned date is in the future. If so, subtract "1" from the year, but keep in mind situations where the date could actually be in the future such as could arise from differences in time zones.
REFERENCES
See FtpFindFirstFile in the eMbedded Visual C++ documentation or online at:
Modification Type: | Minor | Last Reviewed: | 7/27/2004 |
---|
Keywords: | kbprb KB306587 |
---|
|