Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 952835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:57:26+00:00 2026-05-15T23:57:26+00:00

Is there a unix tool to which I can pass a file and have

  • 0

Is there a unix tool to which I can pass a file and have it tell me where the icon for the file is coming from?

What I am looking for is something like this:

$WhoProvidedIcon /Path/To/file.myex

UTI: com.myapplication.document

PLIST: /path/to/myapplication.app/Contents/Info.plist

ICON: /path/to/myapplication.app/Contents/Resources/BaseDoc.icns

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:57:26+00:00Added an answer on May 15, 2026 at 11:57 pm

    There are at least three different place from which the OS will provide the icon.

    In one situation, NSWorkspace can be used to help identify the location:

    NSString* uti = [ws typeOfFile:@"/Users/egorr/Desktop/file.vwx" error:&error];
    NSLog( @"UTI: %@", uti );
    NSLog( @"UTI localized description: %@", [ws localizedDescriptionForType:uti] );
    NSLog( @"UTI error description: %@",[error localizedDescription] );
    NSURL* utiDeclarationURL = (NSURL*)UTTypeCopyDeclaringBundleURL( (CFStringRef)uti );
    NSLog( @"UTI declaration URL: %@", utiDeclarationURL );
    NSDictionary* utiDeclaration = (NSDictionary*)UTTypeCopyDeclaration( (CFStringRef)uti );
    NSLog( @"UTI declaration: %@", utiDeclaration );
    

    This won’t quite get the path to the icon, but it will get one the application from which the declaration came for the UTI.

    An icon might also be supplied from a Quick Look plugin and output from qlmanage can be used to determine if this is the case.

    A user can, in Finder’s Get Info window, set the application they prefer for all files of a given “type”. One can set text file types to always open in TextMate, for example. TextMate the app provides custom file icons for all the file types it can save in. After making this change in Finder’s get info windows, all files of that type will have an icon that has been provided by TextMate and registered with a UTI. To determine whether this is the case, one would need to look at the launch services database – lsregister -dump

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

INFORMIX-SQL 4.1 - There's this ASCII UNIX file called passwd in /usr/informix/etc which holds
How I can get hardware information from a Linux / Unix machine. Is there
Is there any validation tool for shell scripting on unix platform. like after the
I can grap a specific line from a file using sed . Is there
Is there any analogue for unix command substitution shell expansion? Like > cmd1 `cmd2
Are there any alternatives to stat (which is found on most Unix systems) which
Is there any java library that is similar to unix's command file ? ie:
Is there any (unix) command that can locate a given directory? So for instance,
Is there a Unix command to prepend some string data to a text file?
I'd like to sort a file content with a Unix script depending on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.