Ken Shmidheiser wrote:
> the following may help.
That doesn't compile. Here's a rewrite that does.
'---------------
include "Tlbx MoreFilesX.incl"
local fn FSCheckLock( ref as ^FSRef ) as OSErr
'~'1
dim as OSErr result
dim as FSCatalogInfo catalogInfo
dim as FSVolumeInfo volumeInfo
// Get nodeFlags and FSVolumeRefNum
result = fn FSGetCatalogInfo( #ref, _kFSCatInfoNodeFlags + _kFSCatInfoVolume, @catalogInfo, 0, 0, 0 )
if ( result ) then exit fn
long if ( catalogInfo.nodeFlags and _kFSNodeLockedMask )
result = _fLckdErr // File is locked
exit fn
end if
// File isn't locked, but is volume locked? Check volume flags.
result = fn FSGetVolumeInfo( catalogInfo.volume, 0, 0, _kFSVolInfoFlags, @volumeInfo, 0, 0 )
if ( result ) then exit fn
long if ( volumeInfo.flags and _kFSVolFlagHardwareLockedMask )
result = _wPrErr // Volume locked by hardware.
exit fn
end if
long if ( volumeInfo.flags and _kFSVolFlagSoftwareLockedMask )
result = _vLckdErr // Volume locked by software.
end if
end fn = result
'---------------
Robert P.