• 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: Jesus De Meyer <email@hidden>
  • Date: Sat, 14 Jun 2003 23:53:50 +0200

> The icon file is actually named "Icon\r" (i.e., there's a return at
> the end of the name). It should be marked as invisible by the OS,
> meaning the "invisible" file flag is set (You can query that using the
> Carbon call GetFInfo(), if all else fails, but there should be a Cocoa
> file attribute equivalent to this).
>
> ".DS_Store" isn't marked as invisible, but checking whether the first
> character is a period is the criterion you should go by for files that
> don't have the invisible flag set. If that doesn't work for you, it
> might help to see some of your code.

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;
}
_______________________________________________
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.

  • Follow-Ups:
    • Re: Invisible files (was Re: Small problem)
      • From: Nathan Day <email@hidden>
    • Re: Invisible files (was Re: Small problem)
      • From: "Clark S. Cox III" <email@hidden>
    • Re: Invisible files (was Re: Small problem)
      • From: Matt Gough <email@hidden>
    • Re: Invisible files (was Re: Small problem)
      • From: David Sinclair <email@hidden>
References: 
 >Re: Invisible files (was Re: Small problem) (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: [ANN] QSW_UUID framework 1.1
  • Next by Date: Re: Invisible files (was Re: Small problem)
  • Previous by thread: Re: Invisible files (was Re: Small problem)
  • Next by thread: Re: Invisible files (was Re: Small problem)
  • Index(es):
    • Date
    • Thread