Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   libexpect    ( 3 )

библиотека программных диалогов с интерактивными программами (programmed dialogue library with interactive programs)

  Name  |  Description  |  Synopsis  |    If you want to allocate your own pty    |  Expect processing  |  Running in the background  |  Multiplexing  |  Slave control  |  Error  |  Signals  |  Logging  |  Debugging  |  Caveat  |  Bugs  |  See also  |

IF YOU WANT TO ALLOCATE YOUR OWN PTY

extern int exp_autoallocpty;
       extern int exp_pty[2];

The spawn functions use a pty to communicate with the process. By default, a pty is automatically allocated each time a process is spawned. If you want to allocate ptys yourself, before calling one of the spawn functions, set exp_autoallocpty to 0, exp_pty[0] to the master pty file descriptor and exp_pty[1] to the slave pty file descriptor. The expect library will not do any pty initializations (e.g., exp_stty_init will not be used). The slave pty file descriptor will be automatically closed when the process is spawned. After the process is started, all further communication takes place with the master pty file descriptor.

exp_spawnl and exp_spawnv duplicate the shell's actions in searching for an executable file in a list of directories. The directory list is obtained from the environment.