Microsoft KB Archive/932541

= The SetFileTime function behaves incorrectly on Macintosh volumes in Visual C++ .NET 2005 =

Article ID: 932541

Article Last Modified on 3/29/2007

-

APPLIES TO


 * Microsoft Visual C++ 2005 Express Edition

-



SYMPTOMS
In Microsoft Visual C++ .NET 2005, when a backup program calls the SetFileTime function that uses &quot;-1, -1&quot; values for the FileTime parameter on a Macintosh volume, the function behaves incorrectly. Additionally, the last access date is modified every time that the backup program opens the file. Typically, the SetFileTime function does not modify the last access date when you open a file.



CAUSE
This problem occurs because of a problem with the AppleTalk Filing Protocol (AFP) service. The AFP service registers the file change notifications for every AFP directory and for the subdirectories of every AFP directory. When the backup program accesses the file, the AFP service is also notified. The AFP service keeps an index of all the files. The AFP service opens the file. Then, the AFP service updates the indexing information about the file. Although the backup program calls the SetFileTime function that uses a -1 value for the FileTime parameter, the AFP service does not call the function that uses a -1 value. Therefore, the AFP service updates the file access time every time the service opens the file.



WORKAROUND
To work around this problem, run the backup operation every two to three hours. If you run backup operations sequentially, the first backup operation changes the access date. The later backup operations do not change the access date.

If the backup program opens the file after two to three hours, the date changes again. Because the AFP service does not update the file for two to three hours after the first update, the SetFileTime function works correctly for two to three hours. After two to three hours, the AFP flushes the information. Then, the file access date changes.



STATUS
This behavior is by design.



MORE INFORMATION
For more information about Services for Macintosh, click the following article number to view the article in the Microsoft Knowledge Base:

842335 How Services for Macintosh uses system resources in Windows Server 2003

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.

Keywords: kbtshoot kbprb KB932541

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.