Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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

1 solution

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).
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900