Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
For something that specific I would probably just use system() to either call those directly or call a shell script that you package with your app to do those things. Others may chime in with API calls to handle that, but I'm not sure if they exist or not.

-Lee
 
I was afraid of that as I know to many outside calls can slow a program down.
 
If passing commands to the shell means you can get your tool/app done sooner and with less problems or bugs then I would say go for it. It might not be the prettiest way but so what. I doubt it will slow your app down noticeably and speed for these sort of tools is subjective anyway.

b e n
 
There are not Cocoa wrappers to all system/command line functionality. System calling will be fine: it's really not all that expensive at all.
 
Code:
system("lpadmin -p ARC-ATLAB-BWQ -v lpd://at-regulus.ad.ufl.edu/ARC-ATLAB-BWQ -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4250.gz");
system("cupsenable ARC-ATLAB-BWQ");
system("accept ARC-ATLAB-BWQ");

seems to throw warnings out is there a char that I put in it (IE: Perl has the "\" to make chars that that mean something in it act literally) to make it behave correctly?

and can I call a method or function fro a .sh file the same way I would a .m file?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.