QuickBasic Can Get Date/Time of Mac File's Last Modification (78072)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0a
  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0b

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 "filename", fileInfo%(0)
sec& = PEEKL(VARPTR(fileInfo%(38))      'Read two integers as one long
secs2Date sec&, dtRec%(0)
PRINT "Year  = "; dtRec%(0)
PRINT "Month = "; dtRec%(1)
PRINT "Day   = "; dtRec%(2)
PRINT "Day of the week = "; dtRec%(6)
PRINT
PRINT "Hour   = "; dtRec%(3)
PRINT "Minute = "; dtRec%(4)
PRINT "Second = "; dtRec%(5)
				
For more information on the fileInfo data structure, query on the following words:

HFSDispatch AND record AND structure

REFERENCES

"Microsoft QuickBASIC for Apple Macintosh: Language Reference," version 1.0, pages 482, 493

"Inside Macintosh" volume II, Apple Computer Inc., Addison-Wesley, 1985

Modification Type:MajorLast Reviewed:10/20/2003
Keywords:KB78072