<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <dfn>Desknet's</dfn> は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">グループウェア</anchor>です。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite>研究上、やむを得ず身に付いていくIT関連技術</cite>
( (<time>2010-11-02 10:21:26 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.cbrc.jp/~tominaga/tips/">http://www.cbrc.jp/~tominaga/tips/</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;1</anchor-internal> の i2d (<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">iCal</anchor> → <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Desknet's</anchor>) だと微妙にうまく動かなかったので差分:<pre class="code">--- i2d.orig    2004-02-12 20:01:59.000000000 +0900
+++ i2d.pl      2005-09-10 20:33:52.000000000 +0900
@@ -1,5 +1,6 @@
 #!/usr/local/bin/perl
-$iCalCalendar = &quot;Library/Calendars/official.ics&quot;; # $HOME 以下の場所
+my $iCalCalendar = shift;
+#$iCalCalendar = &quot;Library/Calendars/official.ics&quot;; # $HOME 以下の場所
 #
 # iCal (by Apple, Sep. 2002) の出力(vCalendar形式)をNeoJapanのDesknet'sが使う
 # CSVの形式に変換するフィルタ
@@ -71,6 +72,8 @@
 # とりあえず全部読み込んで、Unicode にして配列 @reserved に入れておく
 # 1行目は各フィールドの説明、2行目にだけユーザーIDとユーザー名が書いてある

+=pod
+
 $dnetCalendar = $ARGV[0]; # 第一引数で指定されていなければならない。

 if (open(DNET, $dnetCalendar)) {
@@ -88,13 +91,15 @@
   chop($UserSystemID); chop($UserName);
 }

+=cut
+
 # iCal Calendar からのイベント情報抽出と整形 ##################################
 # イベント抽出、イベント整形を1セットにして繰り返す
 # 抽出したイベント情報は、desknet's の形式にして1イベント1行にまとめて、
 # @events に入れる

 # iCal のカレンダーファイルをまずオープン。ここから読みとる。
-$iCalCalendar = $ENV{'HOME'} . &quot;/&quot; . $iCalCalendar;
+#$iCalCalendar = $ENV{'HOME'} . &quot;/&quot; . $iCalCalendar;
 open(ICAL, $iCalCalendar) || die(&quot;iCal calendar? -&gt;&quot; . $iCalCalendar . &quot;\n&quot;);

 while (&lt;ICAL&gt;) {
@@ -102,7 +107,7 @@
     $content = $sdate = $edate = $comment = &quot;&quot;;
     # まずイベント抽出(イベントの内容を変数に格納する)
     while (&lt;ICAL&gt;) {
-      s|\n$||;                       # 入力行の行末の改行を削除
+      tr|\x0D\x0A||d;                       # 入力行の行末の改行を削除

       # 入力行のチェック
       if (/^END:VEVENT/) { last; }   # イベント定義終了、次のイベント定義を探す
@@ -135,7 +140,7 @@
     $sdate =~ /^[0-9]{4}([0-9]{2})/; $m = $1;  # 月の抽出 20020920 -&gt; 09
     $sdate =~ /^[0-9]{6}([0-9]{2})/; $d = $1;  # 日の抽出 20020920 -&gt; 20
     # 時刻の指定があった場合
-    if ($sdate =~ /T([0-9]{2})([0-9]{2})..$/) { $stime = $1.&quot;:&quot;.$2; }
+    if ($sdate =~ /T([0-9]{2})([0-9])[0-9]..$/) { $stime = $1.&quot;:&quot;.$2.&quot;0&quot;; }
     else                                      { $stime = &quot;&quot;; }
     $sdate = $y . &quot;/&quot; . $m . &quot;/&quot; . $d;          # -&gt; 2002/09/20

@@ -143,7 +148,7 @@
     $edate =~ /^([0-9]{4})/;         $y = $1;
     $edate =~ /^[0-9]{4}([0-9]{2})/; $m = $1;
     $edate =~ /^[0-9]{6}([0-9]{2})/; $d = $1;
-    if ($edate =~ /T([0-9]{2})([0-9]{2})..$/) { $etime = $1.&quot;:&quot;.$2; }
+    if ($edate =~ /T([0-9]{2})([0-9]{2})..$/) { $etime = $1.&quot;:&quot;.sprintf(&quot;%02d&quot;,
int($2 * 0.1)*10); }
     else                                      { $etime = &quot;&quot;; }
     # 終日イベントの処理
     if ($stime eq &quot;&quot;) { $edate = $sdate; }     # 時刻の指定がないとき
@@ -242,6 +247,7 @@
   $comstr = &quot;&quot;;
   @clist = split(m|\\n|, $comment);  # 文字列 \n で分割
   foreach (@clist) {
+    tr/\x0D\x0A//d;
     s|\n$||;                         # 行末の改行を削除
     if (/^$/)  { next; }             # 元々空行のところだったらスキップ
     s|\\&quot;|&quot;|g;                       # \&quot; をただの &quot; に置き換え</pre></p></body></html>