How to set folder icon by filesystems-c?

46 views
Skip to first unread message

Dot Wu

unread,
Jun 23, 2020, 9:49:39 PM6/23/20
to OSXFUSE
Hi guys,
           Is there a solution to set folder icon by filesystems-c?  
We can set folder icon by fuse filesystems-objc API - (NSDictionary)resourceAttributesAtPath:(NSString *)path error:(NSError **error); use the key kGMUserFileSystemCustomIconDataKey.
I can't find a way to set folder icon by c. 

alexand...@gmail.com

unread,
Jun 26, 2020, 10:46:53 AM6/26/20
to OSXFUSE
First the API you mention above will not set the folder icon.  Its returning a dictionary with the current icon in the kGMUserFileSystemCustomIconDataKey key.  

Second if you include the cocoa libraries and link against the cocoa library you should be able to call the function from C with out any issues.  If thats not what you want, then I am at a loss to help.  Try search carbon headers and hope that apple has not deprecated with no replacement functions.

Dot Wu

unread,
Jul 8, 2020, 11:43:28 PM7/8/20
to OSXFUSE
Thanks for your help. I used [NSWorkspace sharedWorkspace] setIconforFileoptions:; and transfer to a c method in .a library and extern "C" in .h, so c++ can used this method. 
Reply all
Reply to author
Forward
0 new messages