IT Community - Software Programming, Web Development and Technical Support

Ruby BuiltIn functions

This is a discussion on Ruby BuiltIn functions within the Ruby forums, part of the Web Development category; uid= Process.uid= anInteger -> aNumeric Sets the (integer) user id for this process. Not available on all platforms. wait ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Ruby

Register FAQ Members List Calendar Mark Forums Read
  #51  
Old 04-22-2008, 07:59 PM
shaalini shaalini is offline
D-Web Architect
 
Join Date: Apr 2007
Posts: 633
shaalini is on a distinguished road
Default Re: Ruby BuiltIn functions

uid=
Process.uid= anInteger -> aNumeric
Sets the (integer) user id for this process. Not available on all platforms.

wait

Process.wait -> aFixnum

Waits for any child process to exit and returns the process id of that child. Raises a SystemError if there are no child processes. Not available on all platforms.

Process.fork { exit 1; } » 1500
Process.wait » 1500
__________________
Shaalini.S
Be the Best of Whatever you are...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #52  
Old 04-22-2008, 08:01 PM
shaalini shaalini is offline
D-Web Architect
 
Join Date: Apr 2007
Posts: 633
shaalini is on a distinguished road
Default Re: Ruby BuiltIn functions

wait2
Process.wait2 -> anArray
Waits for any child process to exit and returns an array containing the process id and the exit status of that child. Raises a SystemError if there are no child processes.
Process.fork { exit 1 } » 1503
Process.wait2 » [1503, 256]

waitpid

Process.waitpid( aPid, anInteger=0 ) -> aPid
Waits for the given child process to exit. anInteger may be a logical or of the flag value Process::WNOHANG (do not block if no child available) or Process::WUNTRACED (return stopped children that haven't been reported). Not all flags are available on all platforms, but a flag value of zero will work on all platforms.

include Process
pid = fork { sleep 3 } » 1506
Time.now » Sun Jun 09 00:20:09 CDT 2002
waitpid(pid, Process::WNOHANG) » nil
Time.now » Sun Jun 09 00:20:09 CDT 2002
waitpid(pid, 0) » 1506
Time.now » Sun Jun 09 00:20:12 CDT 2002
__________________
Shaalini.S
Be the Best of Whatever you are...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #53  
Old 04-22-2008, 08:01 PM
shaalini shaalini is offline
D-Web Architect
 
Join Date: Apr 2007
Posts: 633
shaalini is on a distinguished road
Default Re: Ruby BuiltIn functions

waitpid2
Process.waitpid2( aPid, anInteger=0 ) -> anArray


Waits for the given child process to exit, returning that child's process id and exit status. anInteger may be a logical or of the flag value Process::WNOHANG (do not block if no child available) or Process::WUNTRACED (return stopped children that haven't been reported). Not all flags are available on all platforms, but a flag value of zero will work on all platforms.
__________________
Shaalini.S
Be the Best of Whatever you are...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What Is RUBY? theseokit Ruby 12 10-21-2008 11:07 PM
PHP vs Ruby suman PHP Programming 2 10-02-2008 12:59 AM
Is Ruby for Web? S.Vinothkumar Ruby 6 11-20-2007 01:25 AM
Ruby within .NET? econwriter5 Ruby 0 03-07-2007 05:02 PM
Ruby IDE drecko Ruby 0 02-16-2007 12:11 AM


All times are GMT -7. The time now is 06:19 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0