• 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: Determining a file's "kind"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining a file's "kind"


  • Subject: Re: Determining a file's "kind"
  • From: Mark de Jong <email@hidden>
  • Date: Sat, 15 Jun 2002 00:29:15 -0700

Steven,

If you:

#import <Foundation/NSHFSFileTypes.h>

you get the following functions:

=====
/* Given an HFS file type code, this function returns a string that encodes
** the file type as described above. The string will have been autoreleased.
*/
NSString *NSFileTypeForHFSTypeCode(OSType hfsFileTypeCode);

/* Given a string of the sort encoded by NSFileTypeForHFSTypeCode(),
** this function returns the corresponding HFS file type code. It returns
** zero otherwise.
*/
OSType NSHFSTypeCodeFromFileType(NSString *fileTypeString);

/* Given the full absolute path of a file, this function returns a string that
** encodes the file's HFS file type as described above, or nil if the operation
** was not successful. The string will have been autoreleased.
*/
NSString *NSHFSTypeOfFile(NSString *fullFilePath);
=====

. Hopefully, they'll do what you want.

-- Mark


On Friday, June 14, 2002, at 05:46 PM, Steven Frank wrote:

Given a path to a file, how do I get the string that the Finder displays in the "Kind" field of the "Show Info" window?

Seems like this should be an NSFileManager thing (fileAttributesAtPath?), but it's not mentioned in the docs.

Thanks,

Steven
_______________________________________________
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.
_______________________________________________
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: 
 >Determining a file's "kind" (From: Steven Frank <email@hidden>)

  • Prev by Date: Re: Can't open server socket port
  • Next by Date: Re: Can't open server socket port
  • Previous by thread: Determining a file's "kind"
  • Next by thread: Re: Determining a file's "kind"
  • Index(es):
    • Date
    • Thread