| Author |
Message |
|
|
Post subject: interesting 'find' utility query
Posted: Feb 22, 2008 - 09:42 AM
|
|
Active Member
Joined: Mar 09, 2007
Posts: 20
|
|
Hi,
Thanks for reading the post.
I use the 'find' utility from QNX to find files on the hard disk. I execute this using the 'spawnl()' with appropriate params.
I need to know that is there a way to find out if the execution of the 'find' utility is in progress or has hanged due to some error?
I mean can i make the 'find' utiltiy to report its status periodically so that
i can know if it is really searching for files or stuck/hanged due to some error?
I read the manual but didnt find much. Pls help. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: interesting
Posted: Feb 22, 2008 - 11:48 AM
|
|
Senior Member
Joined: Jul 22, 2004
Posts: 315
|
|
Generally find does not hang, it just exits abnormally.
So find returns a status, which you can ask for. (EXIT_SUCCESS and EXIT_FAILURE)
Docu:
The spawnl() function's return value depends on the mode argument:
mode - Return value
P_WAIT - The exit status of the child process.
P_NOWAIT - The process ID of the child process. To get the exit status for a P_NOWAIT process, you must use the waitpid() function, giving it this process ID.
P_NOWAITO - The process ID of the child process, or 0 if the process is being started on a remote node. You can't get the exit status of a P_NOWAITO process |
|
|
| |
|
|
|
 |
|
|
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group Credits |
|
|