Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNIX System Call Return Code

Status
Not open for further replies.

dayankoven

Programmer
Oct 28, 2002
17
MY
Hi there fellow experts,

I've got a C++ module which invokes a UNIX system call (i.e cp). Say for example, when i perform the copy function, and the specified directory ran out of space, the copy function will fail. The requirement is for the C++ module to catch this error. My question would then be, how do i get the actual return code from UNIX command($? just gives either 0 or 1). I would like to know the actual return code so that i would be able to distinguish this error from any other error and generate the error log accordingly. A return code of non-zero doesn't help very much when we are looking for specifics. Really appreciate your time and help. Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top