;; -*- Mode: text ; Coding: iso-2022-jp -*-

; English document follows after Japanese document.


    File Inspect and Broking End Resolver  -- fiber --

             Copyright (C) 1997-2004  Shuichi Kitaguchi <kit@meadowy.org>


COPYRIGHT
---------

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either versions 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with fiber, see the file COPYING.  If not, write to the Free
Software Foundation Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.


======================== JAPANESE DOCUMENT ========================

$B$3$l$O2?$r$9$k$b$N(B?
-------------------

  fiber $B$OBg$-$/$o$1$F(B 2 $B$D$N5!G=$r;}$C$F$$$^$9(B

 o $B%U%!%$%k$NCf?H$rD4$Y$F$=$N<oN`$r7hDj$9$k(B
 o Windows $B$N!V4XO"IU$1!W$rMQ$$$F%U%!%$%k$r<B9T$9$k(B

  $BNc$($P!"(Bfoo_file $B$H$$$&Cf?H$,(B JPEG $B$N%U%!%$%k$,$"$C$?$H$7$^$9!#(B

  > fiber foo_file

  $B$H$9$k$H!"(Bfiber $B$O(B foo_file $B$r(B foo_file.jpg $B$K%3%T!<$7$?8e!"(B
  foo_file.jpg $B$K4XO"IU$1$i$l$?%"%W%j%1!<%7%g%s$r<B9T$7$^$9(B($B8e$K$O(B
  foo_file.jpg $B$H$$$&%U%!%$%k$,;D$j$^$9(B)$B!#(B

  $B$D$^$j3HD%;R$,IU$$$F$$$J$$!"$b$7$/$O2?$J$N$+$o$+$i$J$$%U%!%$%k$b(B 
  fiber $B$r;H$($PE,@Z$J%"%W%j%1!<%7%g%s$G<B9T$G$-$k$o$1$G$9!#$b$A$m$s(B
  fiber $B$bK|G=$G$O$J$$$N$G!"BP1~$G$-$F$$$J$$%U%!%$%k7A<0$O;3$[$I$"$j$^(B
  $B$9$,(B($B8B$i$l$?$b$N$7$+BP1~$7$F$J$$$H$b8@$&(B)$B!#(B


$B;H$$J}(B
------

   > fiber [$B%*%W%7%g%s(B] <$B%U%!%$%k(B>

  $B%*%W%7%g%s(B:
      -e ext                  $B3HD%;R$r(B "ext" $B$@$H$_$J$9(B
      -s                      $BF14|%b!<%I(B
      -a ext=ident(,offset)   $B3HD%;R%G!<%?$r%l%8%9%H%j$KDI2C(B
      -l                      $B@_Dj$H3HD%;R$N0lMwI=<((B
      -r num                  $B3HD%;R%G!<%?$r%l%8%9%H%j$+$i:o=|(B
      -i                      $B%l%8%9%H%j$N%G!<%?$r=i4|CM$KLa$9(B
      -o Option={num,yes/no}  $B@_Dj%*%W%7%g%s(B
 
      $B@_Dj%*%W%7%g%s(B    |  $B@bL@(B ($B=i4|CM(B)
     -------------------+----------------------------------------------------
      ExtNum            |  fiber $B$,%5%]!<%H$9$k3HD%;R$N:GBgCM(B (64)
      ExecuteUnknownExt |  $B%l%8%9%H%j$KEPO?$5$l$F$J$$3HD%;R$r<B9T$9$k(B (yes)
      ExecuteURL        |  URL(ftp:,http:,...)$B$r<B9T$9$k(B (yes)
      TrustExt          |  fiber $B$,H=CG$7$?$b$N$H%U%!%$%kL>$N3HD%;R$,0[$J$C$F(B
                        |  $B$$$?>l9g!"%U%!%$%kL>$N3HD%;R$r?.MQ$9$k(B (yes)
      OverrideExt       |  fiber $B$,CN$i$J$$3HD%;R$G$"$C$?>l9g!"(Bfiber $B$,H=CG(B
                        |  $B$7$?3HD%;R$G>e=q$-$7$F<B9T$9$k(B (no)

  $B%U%!%$%k(B:
        $B!&3HD%;R$J$7%U%!%$%kL>(B
        $B!&(BWindows $B$G4XO"IU$1$i$l$F$$$k!"3HD%;RIU$-%U%!%$%kL>(B
        $B!&(BURL(http://..., ftp://...)
 

$B<B9TNc(B
------

1. $B3HD%;R$N;XDj(B (-e)

    > fiber -e jpg foo.dat

  $B$H$9$k$H!"(Bfiber $B$O(B foo.dat $B$,(B JPEG $B%U%!%$%k$G$"$k$H9M$(!"(Bfoo.dat $B$r(B 
  foo.dat.jpg $B$K%3%T!<$7$?8e!"(Bfoo.dat.jpg $B$r<B9T$7$^$9(B


2. $BF14|%b!<%I(B (-s)

  ($BNc(B1) $BDL>o$N>l9g(B

    > fiber foo.jpg

    $B$9$0$K%W%m%s%W%H$KLa$C$F$-$^$9(B

  ($BNc(B2) -s $B%*%W%7%g%sIU$-$N>l9g(B

    > fiber -s foo

     foo $B$r(B foo.ext $B$K%3%T!<$7$?8e!"<B9T$7$F$$$k%"%W%j%1!<%7%g%s$N=*N;(B
     $B$rBT$C$F$+$i%W%m%s%W%H$KLa$C$F$-$^$9!#$^$?$3$N>l9g$O!"(Bfoo.ext $B$O(B
     $B;D$i$:$K>C5n$5$l$^$9!#(B


3. $B3HD%;R%G!<%?$NDI2C(B (-a)

   fiber $B$,<1JL$G$-$k3HD%;R$O!"%f!<%6$,<+M3$KDI2C$9$k$3$H$,$G$-$^$9!#(B
   $BDI2C$9$k$K$O!"(B

     > fiber -a $B3HD%;RL>(B=$B<1JL;R(B(,$B%*%U%;%C%HCM(B)

   $B$N$h$&$K@_Dj$7$^$9!#%*%U%;%C%HCM$r;XDj$7$J$+$C$?>l9g$O(B 0 $B$K$J$j$^$9!#(B


   ($BNc(B1) ".mid" $B$rDI2C$7$?$$>l9g(B

     .mid $B%U%!%$%k$N%U%)!<%^%C%H$O!"(B

       $B%U%!%$%k$N@hF,(B
           |
           V
           0   1   2   3   4   5   6   7  ($B%P%$%H(B)
         +---+---+---+---+---+---+---+---
         | M | T | h | d | ? | ? | ? | ?  ...
         +---+---+---+---+---+---+---+---

    $B$H$J$C$F$$$k$N$G!"(B

      > fiber -a mid=MThd

    $B$b$7$/$O(B

      > fiber -a mid=MThd,0

    $B$H@_Dj$7$^$9(B


   ($BNc(B2) ".wav" $B$rDI2C$7$?$$>l9g(B

    .wav $B%U%!%$%k$N%U%)!<%^%C%H$O!"(B

       $B%U%!%$%k$N@hF,(B
           |
           V
           0   1   2   3   4   5   6   7   8   9   10  11  12  ($B%P%$%H(B)
         +---+---+---+---+---+---+---+---+---+---+---+---+---
         | ? | ? | ? | ? | ? | ? | ? | ? | W | A | V | E | ? ...
         +---+---+---+---+---+---+---+---+---+---+---+---+---

    $B$H$J$C$F$$$k$N$G!"(B

      > fiber -a wav=WAVE,8

    $B$H;XDj$7$^$9(B


4. $B@_Dj%*%W%7%g%s$NJQ99(B (-o)

   ($BNc(B1) $B%5%]!<%H$9$k3HD%;R?t$r(B 128 $B$K$9$k(B

     > fiber -o ExtNum=128

   ($BNc(B2) fiber $B$,CN$i$J$$3HD%;R$N%U%!%$%k$r<B9T$7$J$$$h$&$K$9$k(B

     > fiber -o ExecuteUnknownExt=no


$B$=$NB>(B
------

   o $B%l%8%9%H%j%-!<$N(B "HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Fiber" $B$,B8:_$7$J$1$l$P!"(B
     $B<+F0E*$K%-!<$,:n@.$5$l$F=i4|CM$,=q$-9~$^$l$^$9(B

   o $B$b$C$HBt;3$N>pJs$,F@$?$$$J$i!"(Bfiber.c $B$r8+$^$7$g$&(B(^^;


======================== ENGLISH DOCUMENT ========================

WHATS THIS?
-----------

  Fiber has the following two facilities.

1. Inspect the specified file and decide its file type.
2. Execute a file by `File Association' provided by Windows.

  For example, provided that "foo_file" is a JPEG file, this invocation:

  > fiber foo_file

  at first copies foo_file to foo_file.jpg, then executes a proper
  application that is associated with the extention `jpg'
  (foo_file.jpg remains as an aftereffect).

  Thus fiber can execute a file which has no extensions.  Of course,
  not all files can be executed by fiber because there are lots of
  file formats that fiber still can not handle. ;-)


USAGE
-----

   > fiber [option] <file>

  option:
          -e ext                  assume that the extention is "ext".
          -s                      synchronous mode.
          -a ext=ident(,offset)   add ext to database.
          -l                      list options and database.
          -r num                  remove ext indentified by num from database.
          -i                      initialize database.
          -o Option={num,yes/no}  set option.
 
    Option              |   Explanation.(default value)
   ---------------------+------------------------------------------------
    ExtNum              |   ext max numbers fiber supported
    ExecuteUnknownExt   |   execute for unknown file ext.(yes)
    ExecuteURL          |   execute URL(ftp:,http:,...).(yes)
    TrustExt            |   trust ext that filename has.(yes)
    OverrideExt         |   override ext if filename has unknown ext.(no)

  file:
          filename without ext.
          files that Windows can ShellExecute(Ex) (with ext).
          URL(http://...)
 

EXAMPLES
--------

1. SPECIFYING FILE EXTENSION (-e)

  > fiber -e jpg foo.dat

  Fiber assumes foo.dat is a JPEG file,
  copies foo.dat to foo.dat.jpg and executes foo.dat.jpg.


2. SYNCHRONOUS MODE (-s)

  (ex.1) Without "-s" option:

    > fiber foo.jpg

   fiber returns to command prompt immediately.

  (ex.2) However, with "-s" option

    > fiber -s foo

   fiber copies foo to foo.ext, executes foo.ext, waits until the invoked
   execution finishes, and deletes foo.ext.


3. ADDING NEW EXTENSIONS (-a)

   You can add new extensions to fiber as below:

     > fiber -a extension_name=identification(,offset_value)

   If offset_value is omitted, it is considered to be 0.

   (ex.1) ".mid" file

     Since .mid format is:

       file's head
           |
           V
           0   1   2   3   4   5   6   7  (bytes)
         +---+---+---+---+---+---+---+---
         | M | T | h | d | ? | ? | ? | ?  ...
         +---+---+---+---+---+---+---+---

    you should specify 
      > fiber -a mid=MThd
    or
      > fiber -a mid=MThd,0


   (ex.2) ".wav" file

    Since .wav format is:

       file's head
           |
           V
           0   1   2   3   4   5   6   7   8   9   10  11  12  (bytes)
         +---+---+---+---+---+---+---+---+---+---+---+---+---
         | ? | ? | ? | ? | ? | ? | ? | ? | W | A | V | E | ? ...
         +---+---+---+---+---+---+---+---+---+---+---+---+---

     you should specify
      > fiber -a wav=WAVE,8


4. CHANGING OPTIONS (-o)

   (ex.1) Set the number of supported files to 128.

     > fiber -o ExtNum=128

   (ex.2) Not execute files that have unknown extensions.

     > fiber -o ExecuteUnknownExt=no


REMARKS
-------

  o If the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Fiber"
    does not exist, fiber creates it and writes initial values.

  o For more information, see fiber.c :-)


;; document ends here.
