[#12543] Ruby Conference 0.3 — greentea@...2.so-net.ne.jp (Tomoyuki Kosimizu)

こんにちは、こしみずです。

21 messages 1999/03/04
[#12570] Re: Ruby Conference 0.3 — matz@... (Yukihiro Matsumoto) 1999/03/05

まつもと ゆきひろです

[#12571] Re: Ruby Conference 0.3 — Takaaki Higuchi - Technology Marketing <Takaaki.Higuchi@...> 1999/03/05

> | >18日あたり東京でRuby Conference 0.3(単なる宴会)を開きましょうか?

[#12577] Re: Ruby Conference 0.3 — matz@... (Yukihiro Matsumoto) 1999/03/05

まつもと ゆきひろです

[#12645] Re: Ruby Conference 0.3 — KIMURA Koichi <kimura@...> 1999/03/08

[#12546] [閑話] Ruby Conference 0.3 参加したいぃ — Atsuko Yoshida <atsuko@...>

こんにちは。あつこです。

17 messages 1999/03/05
[#12548] Re: [ 閑話] Ruby Conference 0.3 参加したいぃ — KIMURA Koichi <kimura@...> 1999/03/05

[#12573] alternative name of iterator — Shugo Maeda <shugo@...>

前田です。

49 messages 1999/03/05
[#12584] Re: alternative name of iterator — matz@... (Yukihiro Matsumoto) 1999/03/05

まつもと ゆきひろです

[#12641] Re: alternative name of iterator — moochan <moochan@...> 1999/03/08

moochan です.

[#12642] Re: alternative name of iterator — matz@... (Yukihiro Matsumoto) 1999/03/08

まつもと ゆきひろです

[#12643] Re: alternative name of iterator — moochan <moochan@...> 1999/03/08

moochan です.

[#12644] Re: alternative name of iterator — matz@... (Yukihiro Matsumoto) 1999/03/08

まつもと ゆきひろです

[#12661] Re: alternative name of iterator — moochan <moochan@...> 1999/03/09

moochan です.

[#12662] Re: alternative name of iterator — matz@... (Yukihiro Matsumoto) 1999/03/09

まつもと ゆきひろです

[#12666] Re: alternative name of iterator — moochan <moochan@...> 1999/03/09

moochan です.

[#12590] kconv SJIS — Kikutani Makoto <kikutani@...>

=?ISO-2022-JP?B? ではじまるBエンコードされたサブジェクトは

20 messages 1999/03/06

[#12695] 第 2 回 OMG 分散コンピューティング・セミナー: CORBA3.0 の詳説と CORBA 活用の実際 — Junichi Suzuki <jun-sk@...>

各位.

19 messages 1999/03/10
[#12911] HORB for Ruby? — Shugo Maeda <shugo@...> 1999/03/16

前田です。

[#12707] Re: operater bind order ? — Inaba Hiroto <inaba@...>

稲葉です.

16 messages 1999/03/10
[#12709] Re: operater bind order ? — KIMURA Koichi <kimura@...> 1999/03/10

[#12727] Making of Interval class. — moochan <moochan@...>

moochan です.

40 messages 1999/03/10
[#12742] Re: Making of Interval class. — Shugo Maeda <shugo@...> 1999/03/11

前田です。

[#12746] Re: Making of Interval class. — moochan <moochan@...> 1999/03/11

moochan です.

[#12728] Time + 1M — Wakou Aoyama <wakou@...>

青山です。

30 messages 1999/03/10
[#12731] Re: Time + 1M — Tadayoshi Funaba <tadf@...> 1999/03/10

ふなばです。

[#12772] Re: Time + 1M — IKARASHI Akira <ikarashi@...> 1999/03/11

五十嵐です。

[#12774] Re: Time + 1M — Tadayoshi Funaba <tadf@...> 1999/03/11

ふなばです。

[#12775] Re: Time + 1M — IKARASHI Akira <ikarashi@...> 1999/03/11

五十嵐です。

[#12850] Ruby Conference 0.3 where ? when ? — ISII takesi <isii@...>

石井です。

89 messages 1999/03/15
[#12852] Re: Ruby Conference 0.3 where ? when ? — matz@... (Yukihiro Matsumoto) 1999/03/15

まつもと ゆきひろです

[#12859] Re: Ruby Conference 0.3 where ? when ? — hisanori@... 1999/03/15

松尾です。

[#12860] Re: Ruby Conference 0.3 where ? when ? — matz@... (Yukihiro Matsumoto) 1999/03/15

まつもと ゆきひろです

[#12861] Re: Ruby Conference 0.3 where ? when ? — hisanori@... 1999/03/15

松尾です。

[#12862] Re: Ruby Conference 0.3 where ? when ? — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/15

なひです.

[#12864] Re: Ruby Conference 0.3 where ? when ? — matz@... (Yukihiro Matsumoto) 1999/03/15

まつもと ゆきひろです

[#12870] Re: Ruby Conference 0.3 where ? when ? — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/15

なひです.

[#12872] Re: Ruby Conference 0.3 where ? when ? — matz@... (Yukihiro Matsumoto) 1999/03/15

まつもと ゆきひろです

[#12888] signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/15

なひです.

[#12896] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — matz@... (Yukihiro Matsumoto) 1999/03/16

まつもと ゆきひろです

[#12960] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/17

なひです.

[#12962] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — 中村暁史 <anakamur@...> 1999/03/17

[#12993] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/18

なひです.

[#12995] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — 中村暁史 <anakamur@...> 1999/03/18

[#13009] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/19

なひです.

[#13012] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — 中村暁史 <anakamur@...> 1999/03/19

[#13037] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — keiju@... (石塚圭樹 ) 1999/03/20

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

[#13010] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/19

なひです.

[#13011] Re: signal handler in Ruby ( was Re: Ruby Conference 0.3 where ? when ? ) — KIMURA Koichi <kimura@...> 1999/03/19

[#13013] Re: signal handler in Ruby( was Re: Ruby Conference 0.3 where ? when ? ) — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/19

なひです.

[#13016] Re: signal handler in Ruby( was Re: Ruby Conference 0.3 where ? when ? ) — 中村暁史 <anakamur@...> 1999/03/19

[#13023] Re: signal handler in Ruby( was Re: Ruby Conference 0.3 where ? when ? ) — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/03/19

なひです.

[#12918] Sieve of Eratosthenes (Re: [ruby-dev:6094]) — Shin-ichiro Hara <sinara@...>

原です。

29 messages 1999/03/16
[#12924] delete during each (Re: Sieve of Eratosthenes) — matz@... (Yukihiro Matsumoto) 1999/03/17

まつもと ゆきひろです

[#12930] Re: delete during each (Re: Sieve of Eratosthenes) — Shin-ichiro Hara <sinara@...> 1999/03/17

原です。

[#12932] Re: delete during each (Re: Sieve of Eratosthenes) — matz@... (Yukihiro Matsumoto) 1999/03/17

まつもと ゆきひろです

[#12934] Re: delete during each (Re: Sieve of Eratosthenes) — Shin-ichiro Hara <sinara@...> 1999/03/17

原です。

[#13091] FAQ for /:|) — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

17 messages 1999/03/23

[#13121] 全角文字列の分割方法について — goto@...

初めまして、後藤@横河工事(橋梁技術者)です。

17 messages 1999/03/24
[#13122] Re: 全角文字列の分割方法について — matz@... (Yukihiro Matsumoto) 1999/03/24

まつもと ゆきひろです

[#13123] Re: 全角文字列の分割方法について — goto@... 1999/03/24

後藤@横河工事(橋梁技術者)です。お世話になります。

[#13134] ロックでアドバイスをいただきたいのですが — Keisuke Minami <keisuke@...>

はじめまして。三並と申します。

30 messages 1999/03/24
[#13136] Re: ロックでアドバイスをいただきたいのですが — hisanori@... 1999/03/24

松尾です。

[#13139] Re: ロックでアドバイスをいただきたいのですが — 中村暁史 <anakamur@...> 1999/03/24

[#13188] CGI (Re: ロックでアドバイスをいただきたいのですが) — Shugo Maeda <shugo@...> 1999/03/25

前田です。

[#13190] Re: CGI (Re: ロックでアドバイスをいただきたいのですが) — hisanori@... 1999/03/25

松尾です。

[#13140] Ruby Conference 0.3 — hisanori@...

松尾です。

25 messages 1999/03/24

[ruby-list:12715] ftpmirror 改

From: 民斗 <tommy@...>
Date: 1999-03-10 05:07:31 UTC
List: ruby-list #12715
民斗です。

私は ftpmirror を次のように変更して使ってます。
全部とはいいませんが、いくつか取り込みません? > 前田さん(かな?)

・引数で指定することで、転送対象のディレクトリまたはファイルを指定できる。
  (一部のディレクトリ、ファイルだけを転送可能)
・ディレクトリを再帰しないオプション -l
・コンフィグレーションファイルは -f オプションで指定する。
・TEXTFILE_EXT に nil を指定した場合は全部バイナリモードで転送する。
・ディレクトリでも IGNORE_FILE_REGEXP にマッチしたら無視する。
・ファイルの日付の比較は ctime ではなく mtime で行う。(ローカルファイル
  の日付を意図的に変更して、転送を制御できるようにするため)
・リモート側にシンボリックリンクがあった時のために、ftp.list 時に -lL フ
  ラグを指定する。(こんなやり方でいいのか一抹の不安が…(^^;)

どんなもんでしょう?
--
民斗 <tommy@valley.ne.jp>


--- /tmp/ftpmirror/ftpmirror	Thu Jan  7 13:41:10 1999
+++ ./ftpmirror	Wed Mar 10 13:29:58 1999
@@ -1,3 +1,3 @@
-#!/usr/bin/ruby
+#!/usr/local/bin/ruby
 
 ## ftpmirror version 1.2.1
@@ -5,4 +5,5 @@
 
 require "ftplib"
+require "getopts"
 
 class FTPMirror
@@ -17,5 +18,5 @@
   end
   
-  def initialize(config_file)
+  def initialize(config_file, not_recursive)
     load(config_file)
     check_config("Config")
@@ -26,6 +27,10 @@
     check_config("Config::LOCAL_DIR")
     if defined? Config::TEXTFILE_EXT
-      @textfile_regexp =
-	Regexp.new("\\.(" + Config::TEXTFILE_EXT.join("|") + ")$")
+      if Config::TEXTFILE_EXT
+	@textfile_regexp =
+	  Regexp.new("\\.(" + Config::TEXTFILE_EXT.join("|") + ")$")
+      else
+	@textfile_regexp = nil
+      end
     else
       @textfile_regexp = /\.(txt|html|shtml)$/
@@ -41,4 +46,5 @@
       @leave_file_regexp = nil
     end
+    @not_recursive = not_recursive
   end
   
@@ -49,5 +55,5 @@
   end
   
-  def start
+  def start(path)
     begin
       @ftp = FTP.new
@@ -59,5 +65,11 @@
 	@ftp.chdir(Config::REMOTE_DIR)
 	Dir.chdir(File.expand_path(Config::LOCAL_DIR))
-	updatedir(".")
+	if path.empty?
+	  update(".")
+	else
+	  path.each do |p|
+	    update(p)
+	  end
+	end
       ensure
 	@ftp.quit
@@ -68,4 +80,23 @@
   end
   
+  def update(path)
+    if path =~ /^\//
+      $stderr.print "#{path}: assumed .#{path}\n"
+      $stderr.flush
+      path[0,1] = ""
+    end
+    path[0,0] = "./" if path != "."
+    if not FileTest.exist? path
+      $stderr.print "#{path}: not found\n"
+      $stderr.flush
+      return
+    end
+    if FileTest.directory? path
+      updatedir(path)
+    else
+      updatefile(path)
+    end
+  end
+
   def updatedir(directory)
     print directory.sub(/^./, Config::REMOTE_DIR), ":\n"
@@ -77,12 +108,15 @@
       if file != "." && file != ".."
 	if File.ftype(longname) == "directory"
+	  if longname =~ @ignore_file_regexp
+	    next
+	  end
 	  unless remote_dirs.include?(file)
 	    makedir(longname)
 	  end
-	  updatedir(longname)
+	  updatedir(longname) unless @not_recursive
 	else
 	  if not longname =~ @ignore_file_regexp and
 	      (not remote_filetimes.has_key?(file) or
-	       remote_filetimes[file] < File.ctime(longname))
+	       remote_filetimes[file] < File.mtime(longname))
 	    updatefile(longname)
 	  end
@@ -101,5 +135,5 @@
   
   def check_remote_files(directory, dirs, filetimes)
-    @ftp.list(directory) do |line|
+    @ftp.list("-lL "+directory) do |line|
       unless line =~ /^total/
 	if line[0] == ?d
@@ -168,13 +202,13 @@
 end
 
-if ARGV.length == 0
-  config_file = File.expand_path("~/.ftpmirror")
-elsif ARGV[0] == "--version"
+if not getopts("l", "f:~/.ftpmirror", "version")
+  usage()
+end
+
+if $OPT_version
   FTPMirror.print_version
   exit
-else
-  config_file = ARGV.shift
 end
 
-ftpmirror = FTPMirror.new(config_file)
-ftpmirror.start
+ftpmirror = FTPMirror.new(File.expand_path($OPT_f), $OPT_l)
+ftpmirror.start ARGV

In This Thread

Prev Next