유닉스 환경에서 c로 유틸을 만들었습니다. 이 유틸은 소스가 공개되면 안되는 문제여서, 다른 소스에서 실행파일을 실행해야 합니다.
그런데, 유틸에서 리턴값을 받고 싶은데, 어떤방법으로 프로그램을 작성 해야 하는지요?
$ ./myutils $ echo $?
exit status 로 확인하실거면 fork(), execl() or execve(), wait() 의 man page 를 살펴보세욤.. 도중에 출력값을 찍거나 하는 경우라면, popen() 으로 실행해서 결과를 읽어들이면 될겁니다..
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
$ ./myutils $ echo $?
음..
exit status 로 확인하실거면 fork(), execl() or execve(), wait() 의 man page 를 살펴보세욤..
도중에 출력값을 찍거나 하는 경우라면, popen() 으로 실행해서 결과를 읽어들이면 될겁니다..
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』