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

Retrieve a pathname file


CLEAR LOCAL ' Thanks to whoever posted this routine
  DIM pBlock.128
  DIM 63 dirName$
  DIM 255 pathName$
LOCAL FN GetPathname$ (fName$, vRefNum% ,WantFile%)
  DIM osErr%
  IF WantFile% = _True THEN pathName$ = fName$'put filename in pathname
  pBlock.ioNamePtr& = @dirName$'put pointer to dirName$
  pBlock.ioVRefNum% = vRefNum%'set vRefNun
  pBlock.ioDrParID& = [_curDirStore]'get currect directory ID
  pBlock.ioFDirIndex% = -1'get info on folder
  DO
    osErr% = FN GETCATINFO (@pBlock)'get catalog info
    LONG IF osErr% = _noErr'no error then...
      pathName$ = dirName$ + ":" + pathName$'add dirName to path
      pBlock.ioDrDirID& = pBlock.ioDrParID&'get folder's parent ID
    END IF
  UNTIL pBlock.ioDirID& = _fsRtParID OR osErr% <> _noErr
'volume root ID
END FN = pathName$