Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
[2.4.2/Linux] Getting Python to fork?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jon Ribbens, post: 3430375"] This should work I believe: if os.fork(): os._exit(0) os.setsid() os.chdir("/") fd = os.open("/dev/null", os.O_RDWR) os.dup2(fd, 0) os.dup2(fd, 1) os.dup2(fd, 2) if fd > 2: os.close(fd) # do stuff Although bear in mind it's pretty UNIX-y. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
[2.4.2/Linux] Getting Python to fork?
Top