REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.31 KB
Close
//proc/thread-self/root/proc/self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc/xterm.py
Text
Base64
# Run an xterm on current process or a forked process # Adapted from pty.py in Python 1.5.2 distribution. # The pty.fork() couldnt be used because it didn't return # the pty name needed by xterm # I couldnt import pty.py to use master_open because it didn't find termios. import os import sys import fcntl # We couldnt find termios STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO = 0, 1, 2 # Open pty master. Returns (master_fd, tty_name). SGI and Linux/BSD version. # Copied from pty.py from Python 1.5.2. /SN def master_open(): try: import sgi except ImportError: pass else: try: tty_name, master_fd = sgi._getpty(fcntl.O_RDWR, 0o666, 0) except IOError as msg: raise os.error(msg) return master_fd, tty_name for x in 'pqrstuvwxyzPQRST': for y in '0123456789abcdef': pty_name = '/dev/pty' + x + y try: fd = os.open(pty_name, fcntl.O_RDWR) except os.error: continue return (fd, '/dev/tty' + x + y) raise os.error('out of pty devices') # Open the pty slave. Acquire the controlling terminal. # Returns file descriptor. Linux version. (Should be universal? --Guido) # Copied from pty.py from Python 1.5.2. /SN def slave_open(tty_name): return os.open(tty_name, fcntl.O_RDWR) def xterm(prog=None, options=''): master_fd, tty_name = master_open() pid = os.fork() if pid: # Acquire controlling terminal. slave_fd = slave_open(tty_name) # Slave becomes stdin/stdout/stderr of child. os.dup2(slave_fd, STDIN_FILENO) os.dup2(slave_fd, STDOUT_FILENO) os.dup2(slave_fd, STDERR_FILENO) if (slave_fd > STDERR_FILENO): os.close(slave_fd) os.close(master_fd) sys.stdin.readline() # Throw away an init string from xterm if prog is not None: prog() else: os.setsid() cmd = 'xterm %s -S%s%d' % (options, tty_name[-2:], master_fd) os.system(cmd) #os.waitpid(pid, 0) return pid def forkxterm(prog=None, options=''): pid = os.fork() if pid: return pid else: os.setsid() pid = xterm(prog, options) if not pid: os._exit(0) def hello(): print('hello') while 1: pass
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 17
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-02-06 08:01:57
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Cat.py
3.99 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cmd.py
14.72 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Code.py
1.03 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Descriptor.py
903 B
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
etc.py
1.66 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FSA.py
7.20 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Glue.py
13.68 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Help.py
6.71 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
IterPermute.py
2.22 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
KanExtension.py
20.71 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
KnuthBendix.py
8.81 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RE.py
23.59 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RE_Rect.py
10.39 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
textView.py
3.07 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tkcursors.py
2.13 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
xterm.py
2.31 KB
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
87 B
lrw-r--r--
2026-01-20 13:01:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).