FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

DISK I/O

Get the modification date of a file


the following is an fn that gets called litterally thousands of times while my batch processor is running.

I check to see if the folder mod date is older than a user-set period of seconds.

'==================================
CLEAR LOCAL
LOCAL FN myGetFolderModDate&(theAlias%)

'==================================
  DIM ioErr%
  DIM ParamBlock.128
  DIM myFolderPath$
  DIM modDate$, modTime$
  DIM fSpec;0, fVrefNum%, fParID&, 63 fileName$
  DIM WDRefNum%, ParWDRefNum%, pbPtr&, modDate&

'This function finds the folder mod date from an
'alias of a folder stored on the resource fork of the application

  ioErr% = FN useAlias(theAlias%,fSpec)

  LONG IF ioErr% = _noErr
    pbPtr& = @ParamBlock
    pbPtr&.ioNamePtr& = @fileName$
    pbPtr&.ioVrefnum% = fRefNum% '(Use value from FSSpec)
    pbPtr&.ioDirId& = fParID&

    ioErr% = FN GETCATINFO (@ParamBlock)

    LONG IF ioErr% = 0
      modDate& = pbPtr&.ioFlmddat&
    XELSE
      modDate& = 0
    END IF

  END IF

END FN = modDate&

Michael Evans and Rick