나는 메신저 프로그램을 만드는 데 도움을 찾고 있습니다. 다음과 같이 는 내가 * .sh로 파일을 만듭니다코코아 : UNIX 기반 명령을 사용하여 파일 쓰기
SVN_StatGenAppDelegate.h :
NSWindow *window;
NSTask *touch;
NSArray *touchArguments;
NSString *svnURLStr;
NSString *SVNStatStr;
NSString *destDirStr;
SVN_StatGenApplDelegate.m이 작동
NSString *locationStr = [NSString stringWithFormat:@"%@/exec.sh", destDirStr];
NSLog(@"%@", locationStr);
touch = [[NSTask alloc] init];
[touch setLaunchPath:@"/usr/bin/touch"];
touchArguments = [NSArray arrayWithObjects:locationStr, nil];
[touch setArguments:touchArguments];
[touch launch];
, 나는 exec.sh이라는에서 만든 파일을 가져 destDirStr을 사용하여 위치를 찾습니다. 이제 나의 다음 질문은, 내가 가득 해당 파일을 얻을 필요가 다음
svn co http://repo.com/svn/test C:\users\twan\desktop\pres\_temp
cd C:\users\twan\desktop\pres\_temp
svn log -v --xml > logfile.log
copy C:\users\twan\desktop\statsvn.jar C:\users\twan\desktop\pres\_temp
cd ..
java -jar _temp\statsvn.jar C:\users\twan\desktop\pres\_temp/logfile.log C:\users\twan\desktop\pres\_temp
rmdir /s /Q _temp
실제 생각이 스크립트는 SH 파일에 기록되며, 모든 _temp과 다른 위치에 의해 대체된다는 것입니다 vars 내가 textfields 등에서 얻을
그래서 c : \ users \ twan \ desktop \ pres_temp는 내가 inputfields에서 얻을 tempDirStr라는 var 될 것입니다.
(내가이 cmomands을 알고 위치를 기반으로 창이다, 메신저 친구와 함께이 일을하고 그 응용 프로그램의 .NET 대응을했다
너희들이 나를 도울 수있다 :.? D 사전에 감사합니다!
왜 당신은 그냥'사용할 수 없습니다 - [있는 NSString writeToFile :! 원자 : 인코딩 : 오류 : ]'? –
네, NSTask는 필요 없습니다. 이 모든. –
나는 그 writeToFile 메소드를 linto로 가져 갔다. 아마도 그것은 내가 찾고있는 것이다. 나는 코코아 (그리고 객관적인 - C)에 너무 새로운 ... 그래서 그냥 물건을 뽑으려고하고있어 메신저 답장을 보내 주셔서 감사합니다, 나는 그것을 밖으로 체크 아웃거야 – Craimasjien