[#16211] pstore.rb and sync.rb — Kazuhiro NISHIYAMA <zn@...>

西山和広です。

19 messages 2002/03/04
[#16245] Re: pstore.rb and sync.rb — keiju@... (石塚圭樹) 2002/03/07

けいじゅ@日本ラショナルソフトウェアです.

[#16240] [Oni Guruma] look behind — nobu.nakada@...

なかだです。

14 messages 2002/03/07

[#16283] ライブラリ拡大計画 — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

124 messages 2002/03/08
[#16307] Re: ライブラリ拡大計画 — TAKAHASHI Masayoshi <maki@...> 2002/03/10

高橋征義です。

[#16317] Re: ライブラリ拡大計画 — matz@... (Yukihiro Matsumoto) 2002/03/11

まつもと ゆきひろです

[#16318] Re: ライブラリ拡大計画 — Tanaka Akira <akr@...17n.org> 2002/03/11

In article <1015827556.101112.6552.nullmailer@ev.netlab.jp>,

[#16320] Re: ライブラリ拡大計画 — matz@... (Yukihiro Matsumoto) 2002/03/11

まつもと ゆきひろです

[#16347] Re: ライブラリ拡大計画 — Minero Aoki <aamine@...> 2002/03/12

あおきです。

[#16308] Re: ライブラリ拡大計画 — WATANABE Hirofumi <eban@...> 2002/03/11

わたなべです。

[#16626] Re: ライブラリ拡大計画 — matz@... (Yukihiro Matsumoto) 2002/03/27

まつもと ゆきひろです

[#16628] Re: ライブラリ拡大計画 — Takaaki Tateishi <ttate@...> 2002/03/27

At Wed, 27 Mar 2002 18:56:03 +0900,

[#16629] Re: ライブラリ拡大計画 — matz@... (Yukihiro Matsumoto) 2002/03/27

まつもと ゆきひろです

[#16647] Re: ライブラリ拡大計画 — Takaaki Tateishi <ttate@...> 2002/03/28

At Thu, 28 Mar 2002 00:12:49 +0900,

[#16674] Re: ライブラリ拡大計画 — Takaaki Tateishi <ttate@...> 2002/03/29

At Thu, 28 Mar 2002 23:45:49 +0900,

[#16675] Re: ライブラリ拡大計画 — matz@... (Yukihiro Matsumoto) 2002/03/29

まつもと ゆきひろです

[#16680] Re: ライブラリ拡大計画 — nobu.nakada@... 2002/03/29

なかだです。

[#16681] Re: ライブラリ拡大計画 — matz@... (Yukihiro Matsumoto) 2002/03/29

まつもと ゆきひろです

[#16683] Re: ライブラリ拡大計画 — nobu.nakada@... 2002/03/29

なかだです。

[#16687] Re: ライブラリ拡大計画 — Takaaki Tateishi <ttate@...> 2002/03/30

At Fri, 29 Mar 2002 20:32:17 +0900,

[#16718] Re: ライブラリ拡大計画 — Takaaki Tateishi <ttate@...> 2002/04/02

At Sun, 31 Mar 2002 02:20:04 +0900,

[#16371] Re: ライブラリ拡大計画 — Takaaki Tateishi <ttate@...> 2002/03/13

At Fri, 8 Mar 2002 18:05:01 +0900,

[#16373] Re: ライブラリ拡大計画 — matz@... (Yukihiro Matsumoto) 2002/03/14

まつもと ゆきひろです

[#16397] Re: ライブラリ拡大計画 — nobu.nakada@... 2002/03/14

なかだです。

[#16404] Re: ライブラリ拡大計画 — Tanaka Akira <akr@...17n.org> 2002/03/14

In article <20020314133401.3918E10F3@sharui.nakada.kanuma.tochigi.jp>,

[#16406] Re: ライブラリ拡大計画 — nobu.nakada@... 2002/03/15

なかだです。

[#16290] IO#gets improvement — nobu.nakada@...

なかだです。

27 messages 2002/03/08
[#16291] Re: IO#gets improvement — Tanaka Akira <akr@...17n.org> 2002/03/08

In article <20020308131426.8C36123B9@sharui.nakada.kanuma.tochigi.jp>,

[#16294] Re: IO#gets improvement — nobu.nakada@... 2002/03/09

なかだです。

[#16549] Re: IO#gets improvement — nobu.nakada@... 2002/03/23

なかだです。

[#16486] mswin32 configuration — nobu.nakada@...

なかだです。

20 messages 2002/03/19
[#16488] Re: mswin32 configuration — "U.Nakamura" <usa@...> 2002/03/19

こんにちは、なかむら(う)です。

[#16489] Re: mswin32 configuration — nobu.nakada@... 2002/03/19

なかだです。

[#16490] Re: mswin32 configuration — "U.Nakamura" <usa@...> 2002/03/19

こんにちは、なかむら(う)です。

[#16545] BigFloat — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

51 messages 2002/03/23
[#16547] Re: BigFloat — "Akinori MUSHA" <knu@...> 2002/03/23

At Sat, 23 Mar 2002 22:55:45 +0900,

[#16548] Re: BigFloat — "Akinori MUSHA" <knu@...> 2002/03/23

At Sun, 24 Mar 2002 02:20:26 +0900,

[#16550] Re: BigFloat — Tanaka Akira <akr@...17n.org> 2002/03/23

In article <867ko3yyik.wl@archon.local.idaemons.org>,

[#16551] Re: BigFloat — "Akinori MUSHA" <knu@...> 2002/03/23

At Sun, 24 Mar 2002 04:21:59 +0900,

[#16552] Re: BigFloat — Tanaka Akira <akr@...17n.org> 2002/03/23

In article <864rj7yljs.wl@archon.local.idaemons.org>,

[#16553] Re: BigFloat — "Akinori MUSHA" <knu@...> 2002/03/23

At Sun, 24 Mar 2002 07:44:15 +0900,

[#16560] Re: BigFloat — Tanaka Akira <akr@...17n.org> 2002/03/24

In article <861yeazvtg.wl@archon.local.idaemons.org>,

[#16565] Re: BigFloat — "Akinori MUSHA" <knu@...> 2002/03/24

At Sun, 24 Mar 2002 15:41:18 +0900,

[#16575] Re: if Re: BigFloat — keiju@... (石塚圭樹) 2002/03/24

けいじゅ@日本ラショナルソフトウェアです.

[#16715] Re: if Re: BigFloat — keiju@... (石塚圭樹) 2002/04/02

けいじゅ@日本ラショナルソフトウェアです.

[#16725] Re: if Re: BigFloat — "Akinori MUSHA" <knu@...> 2002/04/02

At Tue, 2 Apr 2002 16:16:04 +0900,

[#16789] Re: if Re: BigFloat — "Shigeo Kobayashi" <shigeo@...> 2002/04/08

[#16805] Re: if Re: BigFloat — Shin-ichiro HARA <sinara@...> 2002/04/09

原です。

[#16811] Re: if Re: BigFloat — "Shigeo Kobayashi" <shigeo@...> 2002/04/09

[#16555] File.fnmatch (Re: [rubyist:1286] Re: ARGV の機能) — Koji Arai <JCA02266@...>

新井です。

11 messages 2002/03/24

[#16593] Oniguruma and multibyte character literal — TAKAHASHI Masayoshi <maki@...>

高橋征義です。

15 messages 2002/03/25
[#16594] Re: Oniguruma and multibyte character literal — matz@... (Yukihiro Matsumoto) 2002/03/25

まつもと ゆきひろです

[#16652] [OniGuruma] nested repeat operator — "K.Kosako" <kosako@...>

[ruby-talk:36959]で指摘された

31 messages 2002/03/29
[#16669] Re: [OniGuruma] nested repeat operator — Tanaka Akira <akr@...17n.org> 2002/03/29

In article <20020329022810.68F9E17@helium.ruby-lang.org>,

[#16676] Re: [OniGuruma] nested repeat operator — "K.Kosako" <kosako@...> 2002/03/29

Tanaka Akiraさんの<hvohemzoku6.fsf@coulee.a02.aist.go.jp>から

[ruby-dev:16289] win32/registry.rb and resolv.rb patch for win32 platform

From: Tietew <tietew-ml-ruby-dev@...>
Date: 2002-03-08 11:58:48 UTC
List: ruby-dev #16289
Tietew です。

遅くなりましたが,win32/registry.rb の最新版+日本語ドキュメント
と resolv.rb へのパッチ (一カ所修正漏れがあったのを追加) です。

VMWare3.0 を導入したんですけどファイル共有がおかしくて Win9x で
のテストがまだです…


—[ Tietew ]——————————————————————————
 メ : tietew@tietew.net / tietew@raug.net / tietew@masuclub.net
ホペ: http://www.tietew.net/     Tietew Windows Lab.
      http://www.masuclub.net/   鱒倶楽部
指紋: 26CB 71BB B595 09C4 0153  81C4 773C 963A D51B 8CAA

Attachments (2)

resolv.rb.diff (3.86 KB, text/x-diff)
Index: lib/resolv.rb
===================================================================
RCS file: /src/ruby/lib/resolv.rb,v
retrieving revision 1.8
diff -u -2 -r1.8 resolv.rb
--- lib/resolv.rb	2002/03/08 03:19:44	1.8
+++ lib/resolv.rb	2002/03/08 11:02:45
@@ -263,5 +263,14 @@
 
   class Hosts
-    DefaultFileName = '/etc/hosts'
+    if /cygwin|mingw|mswin32/ =~ RUBY_PLATFORM
+      require 'win32/registry'
+      Win32::Registry::HKEY_LOCAL_MACHINE.open(
+          'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters') do |reg|
+        path = reg.read_s_expand('DataBasePath')
+        DefaultFileName = File.join(path.gsub(/\\/, '/'), 'hosts')
+      end
+    else
+      DefaultFileName = '/etc/hosts'
+    end
 
     def initialize(filename = DefaultFileName)
@@ -511,5 +520,5 @@
           super()
           @sock = UDPSocket.new
-          @sock.fcntl(Fcntl::F_SETFD, 1)
+          @sock.fcntl(Fcntl::F_SETFD, 1) if Fcntl.const_defined? :F_SETFD
           @id = {}
           @id.default = -1
@@ -566,5 +575,5 @@
           @sock = UDPSocket.new
           @sock.connect(host, port)
-          @sock.fcntl(Fcntl::F_SETFD, 1)
+          @sock.fcntl(Fcntl::F_SETFD, 1) if Fcntl.const_defined? :F_SETFD
           @id = -1
           @thread = Thread.new {
@@ -617,5 +626,5 @@
           @sock = TCPSocket.new
           @sock.connect(host, port)
-          @sock.fcntl(Fcntl::F_SETFD, 1)
+          @sock.fcntl(Fcntl::F_SETFD, 1) if Fcntl.const_defined? :F_SETFD
           @id = -1
           @senders = {}
@@ -698,4 +707,7 @@
               }
             rescue Errno::ENOENT
+	      if /cygwin|mingw|mswin32/ =~ RUBY_PLATFORM
+		initialize_win32
+	      end
             end
 
@@ -712,4 +724,69 @@
           end
         }
+      end
+      
+      def initialize_win32
+        require 'win32/registry'
+
+        Win32::Registry::HKEY_LOCAL_MACHINE.open(
+            'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters') do |reg|
+          begin
+            slist = reg.read_s('SearchList')
+            @search = slist.split(/,\s*/) unless slist.empty?
+          rescue Win32::Registry::Error
+          end
+          
+          if add_search = @search.nil?
+            @search = []
+            begin
+              nvdom = reg.read_s('NV Domain')
+              unless nvdom.empty?
+                @search = [ nvdom ]
+                if reg.read_i('UseDomainNameDevolution') != 0
+                  if /^[\w\d]+\./ =~ nvdom
+                    devo = $'
+                  end
+                end
+              end
+            rescue Win32::Registry::Error
+            end
+          end
+          
+          reg.open('Interfaces') do |reg|
+            reg.each_key do |iface,|
+              reg.open(iface) do |regif|
+                begin
+                  [ 'NameServer', 'DhcpNameServer' ].each do |key|
+                    ns = regif.read_s(key)
+                    unless ns.empty?
+                      ns.split(/,\s*/).each do |ns|
+                        @nameserver << ns unless @nameserver.include? ns
+                      end
+                      break
+                    end
+                  end
+                rescue Win32::Registry::Error
+                end
+                
+                if add_search
+                  begin
+                    [ 'Domain', 'DhcpDomain' ].each do |key|
+                      dom = regif.read_s(key)
+                      unless dom.empty?
+                        dom.split(/,\s*/).each do |dom|
+                          @search << dom unless @search.include? dom
+                        end
+                        break
+                      end
+                    end
+                  rescue Win32::Registry::Error
+                  end
+                end
+              end
+            end
+          end
+          @search << devo if add_search and devo
+        end
+        @search = nil if @search.empty?
       end
 

win32-registry.tar.gz (7.7 KB, Archive)

In This Thread

Prev Next