From: Hidetoshi NAGAI Date: 2003-08-06T13:33:06+09:00 Subject: Re: I was doing pretty well until... Hi, From: Dave Thomas Subject: I was doing pretty well until... Date: Wed, 6 Aug 2003 12:37:28 +0900 Message-ID: <3F3077F4.8090203@pragprog.com> > The reason? p_uid_change_privilege (copied below for your reading > pleasure). I don't think I've ever seen this many 'if' statements > grouped together before :) Please see [ruby-talk:76218]. The purpose of this method is "portable control of user-ID". To control the ID, many functions are impremented on the system. However, the functions depends on each system. Even if two sysytems have a same name function, effects are not always same. That is a trouble for portability of a script. Many 'if' satetements are to overcome the differnce. If you use the method, you can change to the new privilege and cannot back to the old one whatever system you use. If you fail it (include being able to back to the old), you will get an exception. Each of other methods on Process::UID has same purpose. If you use only the methods on Process::UID/GID to control IDs, your script will have portability on any system running Ruby. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)