• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Invisible files (was Re: Small problem)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invisible files (was Re: Small problem)


  • Subject: Re: Invisible files (was Re: Small problem)
  • From: Nathan Day <email@hidden>
  • Date: Wed, 18 Jun 2003 02:24:04 +0930

An easier way to test the invisible flag is to use launch services, ckeck out either of these functions

LSCopyItemInfoForURL( CFURLRef inURL, LSRequestedInfo inWhichInfo, LSItemInfoRecord * outItemInfo)
LSCopyItemInfoForRef( const FSRef * inItemRef, LSRequestedInfo inWhichInfo, LSItemInfoRecord * outItemInfo)

you can use the function

FSPathMakeRef( [theString UTF8String], aFSRef, NULL )

to get a FSRef or you can just create a NSURL from you NSSring and cast it to a CFURLRef

On Sunday, June 15, 2003, at 07:23 AM, Jesus De Meyer wrote:

That's exactly what I did and it still shows up. Here's the code to
check for invisble files:

- (BOOL)fileVisible:(NSString *)filePath {
FSRef fsRef;
OSStatus status;
FSSpec fsSpec;

status = FSPathMakeRef([filePath fileSystemRepresentation], &fsRef,
NULL);
status = FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL,
&fsSpec, NULL);

FInfo fInfo;

OSStatus err = FSpGetFInfo(&fsSpec, &fInfo);

if(err)
return NO;

BOOL invisibleFlag = fInfo.fdFlags & kIsInvisible;
BOOL invisibleName = [[filePath lastPathComponent] hasPrefix:@"."];
BOOL fileVisible = !(invisibleFlag && invisibleName);

return fileVisible;
}

Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Invisible files (was Re: Small problem) (From: Jesus De Meyer <email@hidden>)

  • Prev by Date: (no subject)
  • Next by Date: GLUT.framework Test Project?
  • Previous by thread: Re: Invisible files (was Re: Small problem)
  • Next by thread: NS(Mutable)Array question
  • Index(es):
    • Date
    • Thread