Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invisible dir in Finder but not kIsInvisible



On 08-05-28, at 03:39, Olivier Tristan wrote:

static bool isHiddenFile (const String& path) {
FSRef ref;
OSStatus err = FSPathMakeRefWithOptions((const UInt8*) path.toUTF8(), kFSPathMakeRefDoNotFollowLeafSymlink, &ref, 0);

fprintf( stderr, "FSPathMakeRef:: %d\n", (int)err );

What shows up with fprintf?

On my system (10.5.2), it's -35


Indeed it is, sir.
Still I don't know what this Volume not found error is about....

Me neither, and there's the additional oddity in AppleScript with the visibility of /net. The following is the script translated to Carbon. It's not the correct solution. Just one that works with /dev.


OSStatus IsFileVisible( CFStringRef theFilePath, Boolean *outIsHidden ) {

OSStatus err = paramErr;

if( theFilePath != NULL && outIsHidden != NULL ) {

ComponentInstance inst = NULL;

err = OpenADefaultComponent( 'osa ', 'ascr', &inst );
if( err == noErr ) {

CFStringRef command = CFStringCreateWithFormat( kCFAllocatorDefault, NULL, CFSTR( "visible of (info for POSIX file \"%@\")" ), theFilePath );

err = errAECorruptData;
if( command != NULL ) {

CFDataRef data = CFStringCreateExternalRepresentation( kCFAllocatorDefault, command, kCFStringEncodingUTF8, 0 );

err = coreFoundationUnknownErr;
if( data != NULL ) {

AEDesc desc = {typeNull, NULL};

err = AECreateDesc( typeUTF8Text, CFDataGetBytePtr( data ), CFDataGetLength( data ), &desc );
if( err == noErr ) {

AEDesc rslt = {typeNull, NULL};

err = OSADoScript( inst, &desc, kOSANullScript, typeBoolean, kOSAModeNull, &rslt );
if( err == noErr ) {
err = AEGetDescData( &rslt, outIsHidden, sizeof( Boolean ) );
}
(void)AEDisposeDesc( &rslt );
}
(void)AEDisposeDesc( &desc );
CFRelease( data );
}
CFRelease( command );
}
(void)CloseComponent( inst );
}
}

return err;
}




Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Invisible dir in Finder but not kIsInvisible (From: Olivier Tristan <email@hidden>)
 >Re: Invisible dir in Finder but not kIsInvisible (From: Jesper Papmehl-Dufay <email@hidden>)
 >Re: Invisible dir in Finder but not kIsInvisible (From: "Olivier Tristan" <email@hidden>)
 >Re: Invisible dir in Finder but not kIsInvisible (From: Philip Aker <email@hidden>)
 >Re: Invisible dir in Finder but not kIsInvisible (From: Olivier Tristan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.