I need to get the usertags for a file in c program. I am aware of "mdls -name kMDItemUserTags FILENAME" command to get this details. But i need to do it in c code. Is there any way from which i can get the values directly instead of running this command and parsing.
OSX Mavericks get tags of a file in c program
261 Views Asked by user12345 At
1
There are 1 best solutions below
Related Questions in C++
- C++ using std::vector across boundaries
- Linked list without struct
- Connecting Signal QML to C++ (Qt5)
- how to get the reference of struct soap inherited in C++ Proxy/Service class
- Why we can't assign value to pointer
- Conversion of objects in c++
- shared_ptr: "is not a type" error
- C++ template using pointer and non pointer arguments in a QVector
- C++ SFML 2.2 vectors
- Lifetime of temporary objects
- I want to be able to use 4 different variables in a select statement in c ++
- segmentation fault: 11, extracting data in vector
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- How can I print all the values in this linked list inside a hash table?
- Configured TTL for A record(s) backing CNAME records
Related Questions in C
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in OSX-MAVERICKS
- What is the difference between "echo" and "echo -n"?
- PortAudio for MAC Mavericks
- Unable to install RStudio on Mac OSX 10.10
- Formatting a MicroSD card within OSX
- Maven in OSX Keeps Compiling with Java 1.5
- Recording App Video Previews with QuickTime
- How should be the launchd file be if I don't want the deamon to load and/or start automatically?
- What could be the cause of this if condition getting skipped even the condition inside is True?
- OS X Mavericks JNI CallStaticVoidMethod results in SIGSEGV/SIGBUS (Java 8)
- how to presentViewControllerAsSheet on OSX Mavericks?
- How to compile PHP with OpenSSL on OS X 10.9?
- Unmount USB device in sandboxed Mavericks application
- Enable spectacle keybindings with sublime text 2 on OSX Mavericks
- phppgadmin not found? (mac os x)
- Trouble matching the vibrant background of a Yosemite NSMenuItem containing a custom view
Related Questions in TAGGING
- Is there a way to associate data with a file in a folder hierarchy?
- Rails Delete Post with Tags or Comments
- How does StackOverflow's tag suggestions work?
- Customised tokens annotation in R
- Rails 5 - Acts as Taggable On - is this gem deprecated?
- Labeling / Marking a group of files in Git
- How can I determine which user is the top one in the specific tag?
- cq:tags error "com.day.cq.tagging.impl.TagValidatingEventListener invalid/duplicated tags detected at content/"
- Google API for tags extraction from youtube videos
- Get last git tag matching string
- How to create GeoTagging image / location tagging application for android with google maps using eclipse with ADT
- Tag, Send messages and post messages in LinkedIn - programatically
- Searching objects by multiple tags in minimal time
- Add item to input programmatically
- nltk pos tagger looks to incorporate '.'
Related Questions in XATTR
- xattr/extended attributes not settable for file in /tmp while in $home on same mount works fine
- xattr -w Writing metadata to a file - syntax issue
- where are extended attributes stored?
- Understanding output of xattr -p com.apple.quarantine
- How to query target of all Finder aliases?
- Opening a text file with no xattr gives "Operation not permitted" under macOS Catalina and Python 2
- Linux setxattr: possible to use Unicode string?
- Could not build wheels for xattr, which is required to install pyproject.toml-based projects
- How is attribute com.apple.quarantine represented in AppleDouble files?
- How to write Finder comment from Swift
- Can I modify a disk image while it is open, but not "save changes"?
- Using multiple keywords in xattr via _kMDItemUserTags or kMDItemOMUserTags
- Linux capabilities over FUSE file system
- Python Module xattr has no attribute list
- Sharing a dmg file without recipient having to do xattr -d
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can do it via the
NSURLResource KeyNSURLLabelColorKeywhich uses anNSColorto specify the colour.Therefore it cannot be done in C per se, however you can write an Objective-C implementation file with a C function entry point so it can be called from C (as noted by @Alex MDC in the comments you can use
CoreFoundationand do it in C directly, but I would always favourFoundationwhere possible as it's easier to use when using ARC).Given
NSColoris used to specify the colour, you'll need to create astructto hold the RGB values and translate between thatstructandNSColoryourself.Something like (untested):
OSXFileLabelColour.h:
OSXFileLabelColour.m: