1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/pty/README.jp

90 lines
2.7 KiB
Text
Raw Normal View History

pty <20><>ĥ<EFBFBD><EFBFBD><EFBFBD><E5A1BC> version 0.3 by A.ito
1. <20>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>γ<EFBFBD>ĥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>tty (pty) <20><><EFBFBD>̤<EFBFBD><CCA4><EFBFBD>Ŭ<EFBFBD><C5AC><EFBFBD>ʥ<EFBFBD><CAA5>ޥ<EFBFBD><DEA5>ɤ<EFBFBD>
<EFBFBD>¹Ԥ<EFBFBD><EFBFBD>뵡ǽ<EFBFBD><EFBFBD> ruby <20><><EFBFBD>󶡤<EFBFBD><F3B6A1A4>ޤ<EFBFBD><DEA4><EFBFBD>
2. <20><><EFBFBD>󥹥ȡ<F3A5B9A5><C8A1><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD>ˤ<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD>󥹥ȡ<EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
(1) ruby extconf.rb
<20><><EFBFBD>¹Ԥ<C2B9><D4A4><EFBFBD><EFBFBD><EFBFBD> Makefile <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
(2) make; make install <20><><EFBFBD>¹Ԥ<C2B9><D4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
3. <20><><EFBFBD><EFBFBD><E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FBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˻Ȥ<CBBB><C8A4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>
PTY.spawn("command_foo") do |r,w|
...
...
PTY.protect_signal do
system "some other commands"
end
...
end
<20><><EFBFBD>Τ<CEA4>ʵ<EFBFBD><CAB5>Ҥˤ<D2A4><CBA4>ꡤ"some other commands" <20><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD>
<20><EFBFBD><E3B3B0>ȯ<EFBFBD><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>ɤ<EFBFBD><C9A4>ޤ<EFBFBD><DEA4><EFBFBD>
reset_signal
PTY <20>λҥץ<D2A5><D7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ư<EFBFBD><C6B0><EFBFBD>Ƥ<EFBFBD><C6A4>Ƥ⡤<C6A4><E2A1A4><EFBFBD>Υץ<CEA5><D7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E3B3B0>ȯ<EFBFBD><C8AF>
<20><><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>ˤ<EFBFBD><CBA4>ޤ<EFBFBD><DEA4><EFBFBD>
4. <20><><EFBFBD>ѤˤĤ<CBA4><C4A4><EFBFBD>
<EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD>§<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͭ<EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD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