文件操作 - _fork_pty.cpython-310.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/ptyprocess/__pycache__/_fork_pty.cpython-310.pyc
编辑文件内容
o 5��_: � @ sL d Z ddlZddlZddlmZmZmZmZ ddlm Z dd� Z dd � ZdS ) z<Substitute for the forkpty system call, to support Solaris. � N)�STDIN_FILENO� STDOUT_FILENO� STDERR_FILENO�CHILD� )�PtyProcessErrorc C s� t �� \} }| dk s|dk rtd��t �� }|tkr9t �| � t|� t �|t� t �|t � t �|t � || fS t �|� || fS )a� This implements a substitute for the forkpty system call. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. Modified 10.06.05 by Geoff Marshall: Implemented __fork_pty() method to resolve the issue with Python's pty.fork() not supporting Solaris, particularly ssh. Based on patch to posixmodule.c authored by Noah Spurrier:: http://mail.python.org/pipermail/python-dev/2003-May/035281.html r zos.openpty() failed)�os�openpty�OSError�forkr �close�pty_make_controlling_tty�dup2r r r )� parent_fd�child_fd�pid� r �6/usr/lib/python3/dist-packages/ptyprocess/_fork_pty.py�fork_pty s �r c C s� t �| �}zt �dt jt jB �}t �|� W n ty/ } z |jtjkr%� W Y d}~nd}~ww t � � zt �dt jt jB �}t �|� t d�� ty` } z |jtjkrV� W Y d}~nd}~ww t �|t j�}t �|� t �dt j�}t �|� dS )z�This makes the pseudo-terminal the controlling tty. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. z/dev/ttyNz(OSError of errno.ENXIO should be raised.)r �ttyname�open�O_RDWR�O_NOCTTYr r �errno�ENXIO�setsidr �O_WRONLY)�tty_fd� child_name�fd�errr r r r + s2 ��� ��� r )�__doc__r r �ptyr r r r �utilr r r r r r r �<module> s "
修改文件时间
将文件时间修改为当前时间的前一年
删除文件