Microsoft KB Archive/78072

= QuickBasic Can Get Date/Time of Mac File's Last Modification =

Article ID: 78072

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0
 * Microsoft QuickBasic Compiler for Macintosh 1.0
 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



This article was previously published under Q78072



SUMMARY
You can use the GetFileInfo and Secs2Date Toolbox Library routines (stored as MBLC resources in QuickBasic for Macintosh) to obtain the date and time of a file's last modification.

This information applies to Microsoft QuickBasic versions 1.0, 1.0a, and 1.0b for Apple Macintosh.



MORE INFORMATION
The following is a program example that demonstrates using GetFileInfo and Secs2Date to obtain the date and time of the last modification of a file on a Macintosh disk: DIM fileInfo%(39), dtRec%(6) GetFileInfo &quot;filename&quot;, fileInfo%(0) sec& = PEEKL(VARPTR(fileInfo%(38))     'Read two integers as one long secs2Date sec&, dtRec%(0) PRINT &quot;Year  = &quot;; dtRec%(0) PRINT &quot;Month = &quot;; dtRec%(1) PRINT &quot;Day   = &quot;; dtRec%(2) PRINT &quot;Day of the week = &quot;; dtRec%(6) PRINT PRINT &quot;Hour   = &quot;; dtRec%(3) PRINT &quot;Minute = &quot;; dtRec%(4) PRINT &quot;Second = &quot;; dtRec%(5) For more information on the fileInfo data structure, query on the following words:

HFSDispatch AND record AND structure

