[futurebasic] Re: [FB] Determine where App running from(2)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1999 : Group Archive : Group : All Groups

From: "Michael Evans" <mikonic@...>
Date: Thu, 05 Aug 1999 10:46:02 -0400
I adapted the previous fn as follows:

CLEAR LOCAL
LOCAL FN isVolLocked%(theWDrefNum%)
  DIM isLocked%, volPath$, count%, pathSize%, theChar$
  DIM pbBlk.128, 63 vName$, srcVName$, osErr%
  DIM hardLock%, softLock%, message$

  volPath$  = FN convertWDRef$("",theWDrefNum%)
  pathSize% = LEN(volPath$)
  FOR count% = 1 TO pathSize%
    theChar$ = MID$(volPath$, count%, 1)
    LONG IF theChar$ <> ":"
      srcVName$ = srcVName$ + theChar$
    XELSE
      count% = pathSize%
    END IF
  NEXT count%

  pbBlk.ioCompletion&   = 0                       'no iocompletion
  pbBlk.ioNamePtr&      = @srcVName$              'pointer to volume name
  pbBlk.ioVRefNum%      = theWDrefNum%            'vol ref num
  pbBlk.ioVolIndex%     = 0                       'no volume index

  osErr% = FN HGETVINFO (@pbBlk)                  'get original volume info
  LONG IF osErr% = _noErr
    hardLock% = pbBlk.ioVAtrb% AND _hardLockFlag
    softLock% = pbBlk.ioVAtrb% AND _softLockFlag
    LONG IF (hardLock% <> 0) OR (softLock% <> 0)
      isLocked% = _true
    XELSE
      isLocked% = _false
    END IF
  END IF

END FN = isLocked%


----------------------------------------------------------
Michael Evans
Manager of Software Development * Photo Systems, Inc.
3301 Wood Valley Road, NW * Atlanta, GA, 30327-1515
Voice: (404) 846-9386
Fax: (404) 240-0878 * Cell: (404) 229-3930
E-mail: evans@... * michael_evans@...
----------------------------------------------------------