OpenQNX :: The QNX Community Portal

May 13, 2008 - 12:34 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 60 unlogged users and 1 registered user online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
qnxdevelop
Post subject: interesting 'find' utility query  PostPosted: 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.
 
 View user's profile Send private message  
Reply with quote Back to top
micro
Post subject: RE: interesting  PostPosted: 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
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.