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 : 172.67.156.115 your ip : 172.70.127.118 H O M E |
Filename | /usr/lib/python2.7/dist-packages/twisted/test/process_tester.py |
Size | 744 |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:56 |
Last modified | 10-Nov-2005 03:00 |
Last accessed | 07-Jul-2025 00:07 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
"""Test program for processes."""
import sys, os
test_file_match = "process_test.log.*"
test_file = "process_test.log.%d" % os.getpid()
def main():
f = open(test_file, 'wb')
# stage 1
bytes = sys.stdin.read(4)
f.write("one: %r\n" % bytes)
# stage 2
sys.stdout.write(bytes)
sys.stdout.flush()
os.close(sys.stdout.fileno())
# and a one, and a two, and a...
bytes = sys.stdin.read(4)
f.write("two: %r\n" % bytes)
# stage 3
sys.stderr.write(bytes)
sys.stderr.flush()
os.close(sys.stderr.fileno())
# stage 4
bytes = sys.stdin.read(4)
f.write("three: %r\n" % bytes)
# exit with status code 23
sys.exit(23)
if __name__ == '__main__':
main()
import sys, os
test_file_match = "process_test.log.*"
test_file = "process_test.log.%d" % os.getpid()
def main():
f = open(test_file, 'wb')
# stage 1
bytes = sys.stdin.read(4)
f.write("one: %r\n" % bytes)
# stage 2
sys.stdout.write(bytes)
sys.stdout.flush()
os.close(sys.stdout.fileno())
# and a one, and a two, and a...
bytes = sys.stdin.read(4)
f.write("two: %r\n" % bytes)
# stage 3
sys.stderr.write(bytes)
sys.stderr.flush()
os.close(sys.stderr.fileno())
# stage 4
bytes = sys.stdin.read(4)
f.write("three: %r\n" % bytes)
# exit with status code 23
sys.exit(23)
if __name__ == '__main__':
main()