Trying to understand the locking of a file

Hi again

I'm trying to understand how I can check if a file is locked or not and have
been using this code in order to check the FInfo info for a file

#!perl -w
use Mac::Files;
my($file, $fileCat, $fileInfo);

$file     = 'Central:Desktop';
$fileCat  = FSpGetCatInfo($file)     or die('Bl��');
$fileInfo = $fileCat->ioFlFndrInfo() or die('Bl��');


print $fileCat->ioNamePtr() . 
    " flag: " . $fileInfo->fdFlags() . 
    " type: " . $fileInfo->fdType() .
    " crea: " . $fileInfo->fdCreator() . "\n";

This works fine if I check the invisible flag, then it looks like this if a file
is invisible or not flag: 256 type: TEXT crea: R*ch flag: 16640 type: TEXT crea: R*ch

Checking the Mac documentation the invisible flag is bit 14 so this seems to
work. However, when try to see a difference between a locked and a unlocked file
I get the same result in both cases flag: 256 type: TEXT crea: R*ch flag: 256 type: TEXT crea: R*ch

The docs says 'nameLocked' is bit 12 which made me expected that the flag value
would be 256 or 4352 ... but there seems to be no change.

Disclaimer time: I'm no Mac programmer and I'm trying to learn the inner parts
of MacPerl so I might be missing something obvious but what?

Jan Erik Mostr�m                   
Free Elektron            
2/27/2001 3:51:21 PM
perl.macperl 876 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 59
Get it on Google Play
Get it on Apple App Store