K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / lib / python2.7 / dist-packages / twisted / test /
server ip : 104.21.89.46

your ip : 172.71.254.99

H O M E


Filename/usr/lib/python2.7/dist-packages/twisted/test/process_fds.py
Size756
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified31-Jan-2004 11:18
Last accessed07-Jul-2025 00:14
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image

"""Write to a handful of file descriptors, to test the childFDs= argument of
reactor.spawnProcess()
"""

import os, sys

debug = 0

if debug: stderr = os.fdopen(2, "w")

if debug: print >>stderr, "this is stderr"

abcd = os.read(0, 4)
if debug: print >>stderr, "read(0):", abcd
if abcd != "abcd":
sys.exit(1)

if debug: print >>stderr, "os.write(1, righto)"

os.write(1, "righto")

efgh = os.read(3, 4)
if debug: print >>stderr, "read(3):", efgh
if efgh != "efgh":
sys.exit(2)

if debug: print >>stderr, "os.close(4)"
os.close(4)

eof = os.read(5, 4)
if debug: print >>stderr, "read(5):", eof
if eof != "":
sys.exit(3)

if debug: print >>stderr, "os.write(1, closed)"
os.write(1, "closed")

if debug: print >>stderr, "sys.exit(0)"
sys.exit(0)