home *** CD-ROM | disk | FTP | other *** search
- DefInt A-Z
- '==========================================================================
- ' This VB program demonstrates how to get a files date/time stamp and file
- ' size directly from within Visual Basic and not resorting to a shell to
- ' the DOS "DIR" command.
- '==========================================================================
-
- '=== Structure used to save returned values from OpenFile
- '=== NOTE: note the normal 4 byte "reserved" field in the OFSTRUCT
- '=== needs to be changed to two byte fields r1 and r2.
-
- Type OFSTRUCT '************************************
- cBytes As String * 1 '* NOTE: This type definition *
- fFixedDisk As String * 1 '* must appear before the API *
- nErrCode As Integer '* declaration because lpReOpenBuff *
- r1 As Integer '* is defined "As OFSTRUCT" in the *
- r2 As Integer '* OpenFile API function declaration*
- szPathName As String * 128 '************************************
- End Type
-
- '=== API function to open files
-
- Declare Function OpenFile Lib "Kernel" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Integer) As Integer
-
- '=== OF_EXIST paramter simply causes a test for a files existence.
- '=== OpenFile will return the file handle if it exists
- '=== or OpenFile returns -1 if the file does not exist.
-
- Global Const OF_EXIST = &H4000
-
-