Cocoaããã³ãã³ãã©ã¤ã³åã®ããã°ã©ã ãå®è¡ãããæã¯ãNSTaskã使ãã¾ããNSTaskã使ãã¨ãããªãç°¡åã«å¤é¨ã®ããã°ã©ã ãå®è¡ãããã¨ãã§ãã¾ããåã«å®è¡ããã ããªãã°ããããããªãã¡ã¬ã³ã¹ãè¦ãã ãã§ãã使ãæ¹ããããã¨æãã¾ãã®ã§ãåºåãèªã¿åãæ¹æ³ã説æãã¾ãã åã«èªã¿åãå ´åã次ã®ããã«ãã¾ãã NSTask *task = [[NSTask alloc] init]; NSPipe *pipe = [[NSPipe alloc] init]; [task setLaunchPath:@"/bin/ls"]; [task setStandardOutput:pipe]; [task launch]; NSFileHandle *handle = [pipe fileHandleForReading]; NSData *data = [handle readDataT
NSTaskã§å¤é¨ã³ãã³ããå®è¡ããå ´åãå¤é¨ã³ãã³ãããã«ãã¹ã§æå®ããªãã¨ãããªããããããã·ã³ç°å¢ã«ãã£ã¦ã³ãã³ãã¯ãã·ã³ã«ãã£ã¦"/opt/local/bin"ã ã£ãã"/usr/local/bin"ã ã£ããããã®ã§ããã«ãã¹ã§ã³ãã³ããæå®ããã¨åããªãã£ããããã®ã§ã"/bin/sh -c"ãçµç±ããã¦ã³ãã³ãã®å®è¡ãã¹ã解決ããã¨å¹¸ãã«ãªããã¿ããã§ãã #import <Foundation/Foundation.h> int main(void) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSTask *task = [[NSTask alloc] init]; NSPipe *pipe = [[NSPipe alloc] init]; [task setLaunchPath: @"/bin
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}