Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Objective-C Mach-O
Hello,
 
I wanted to get the dylib version. I've a dylib path for which I wanted to get the version number.
I've tried "otool -L" command and it's giving me the proper output but as per the requirements I can't use it, since I've 100 of dylib in a directory for which I wanted to get the version information and I can't run "otool" command for each dylib through NSTask and NSPipe.
 
I've also found the NSVersionOfLinkTimeLibrary() function to get the dylib version, but as per the documentation NSVersionOfLinkTimeLibrary returns the version number for linked libraries and not for other dylib.
 
Any help on this would be helpful.
 
Thanks.
Omkar
Posted 8-Feb-13 6:01am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You just want to run "otool -L" on a large number of files?
 
Open up a terminal window and go to the directory containing the files, then type this:
 
for f in *
do
   otool -L $f
done
 
OSX is a unix based system, and "terminal" is a unix shell that allows you to run unix scripts.
 
Google "Unix shell scripting" to find out more about shell scripting (also, do that if there is a problem with the syntax of my solution -- I didn't have a Unix machine to test it on).
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 330
1 Nirav Prabtani 242
2 Richard Deeming 240
3 CHill60 170
4 _Amy 145
0 OriginalGriff 8,104
1 Sergey Alexandrovich Kryukov 7,045
2 Maciej Los 4,039
3 Peter Leow 3,738
4 CHill60 2,912


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 19 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100