Cadaver for OS/2
================

1. Introduction

   This is a rough, one-evening (well, in total) port of  Cadaver v 0.23.3 to
   OS/2, used  previously to automate off-site  backups to an ISP-hosted "web
   folder" that ended up in neglect. This release was  briefly tested but the
   upstream version number  speaks for itself  - and please  don't expect any
   long-term maintainer commitment. 

   In the technical sense, WebDAV (and the "web folders technology", the term
   coined to  describe its  Windows-powered client  side) is  an extension to
   HTTP to  provide more efficient   means  of exchanging documents in   both
   directions.   As a WebDAV client, Cadaver  was designed to resemble an FTP
   client as much as possible.


2. Installation

   EMX v 0.9d or later  is required, all  dependent DLLs are shipped with the
   package.

   To test your installation,  run CADAVER.EXE and  "open" any WebDAV URL you
   know  of.  If you pass the  authentication procedure, chances are 99% that
   everything will run smoothly after this point.

   A "dumb" version has been  compiled separately for  use with  stdin/stdout
   redirection  (i.e. automated scripting). In this version, readline support
   (the equivalent  of "KEYS ON" of CMD.EXE) has been  left out as it  is not
   compatible with redirection.

   LS.EXE from GNU file utilities is required for the "lls" command and  part
   of this WPI-Package.


3. Usage hints and known problems

3.1 High ASCII characters and GNU readline

   There  are  problems downloading    files  with spaces and/or   high ASCII
   characters  (umlaut/accents,  line-drawing  symbols,  DBCS  and  non-Latin
   scripts) in the filenames.  The transfer is OK, but  the filename is wrong
   on local system.
	e.g.: Spaces%20and%20Umlaute%45look%20ugly.pdf or so.

   The  readline-enabled  version (CADAVER.EXE)  does  not  handle high-ASCII
   characters by default, treating them as  Meta combinations. To work around
   this, the  WPI-Archive  creates  a file named   %HOME%\.inputrc   with the
   following three lines:

	set convert-meta off
	set output-meta on
	set input-meta on

   The WPI-Archive creates also a file named %HOME%\.cadaverrc containing the
   following line:

	set os2-cli-behavior

   This   makes  cadaver handle the  command    "lcd" without parameters like
   "lpwd".  By  default "lcd"  without  parameter changes  directory to local
   %HOME%. If  you     want  this, please     remove the   line   above  from
   %HOME%\.cadaverrc. 

   The WPI-Archive creates also a file named %HOME%\.netrc containing the
   following line:

       default login USERNAME password PASSWORD

   You can replace USERNAME and PASSWORD with the values for your default
   remote resource.

   IMPORTANT: Existing .inputrc, .netrc and/or .cadaverrc  files will not
   be overwritten.
   These files must be created in the UNIX format- use your favorite fromdos/
   tounix utility to get rid of carriage-return characters. 
        e.g.: http://hobbes.nmsu.edu/download/pub/os2/apps/wp/ux_dos.zip

   Ctrl+U clears the current prompt when browsing readline history.

   Complete documentation on readline 2.x is available here (as of 12/2009):
	http://athena.vvsu.ru/docs/unix/bashdocs/readline/readline.html
   Note that this might be the last place to obtain documentation for version
   2.2 which is outdated by a decade! Fresh ports anyone?

3.2 Environment variables

   Environment variables can be specified to override the UNIX-like defaults:

   EDITOR              The  editor  to  use  with  the  "edit"  command (e.g.
                       "SET EDITOR=e.exe"). Defaults to "vi".
   INPUTRC             The  path  to  the ".inputrc"  configuration  file for
                       readline. Defaults  to "%HOME%\.inputrc".  If you know
                       your  way  around .inputrc, don't forget to  strip CRs
                       when you modify it or else nothing will work.
   HOME                The directory contaning your ".netrc" and ".cadaverrc"
                       files.
   PAGER               The program to call when the "less" command is invoked
                       (e.g. "SET PAGER=less.exe"). Defaults to "/bin/less".
   TMP, TEMP, TMPDIR   Temporary directory. If neither of  these variables is
                       set, the default is "/tmp".

   If  Cadaver is  installed from  the WPI  package, WPS program objects will
   have  their  own environment  for PAGER, EDITOR and TMP - independent from
   CONFIG.SYS. You can change the environment easly via DragText.

3.3 expect/expectk

   Not available on OS/2 and probably won't compile easily.


4. Development Notes

   If you need a really straightforward  out-of-the-box build, go  for 0.22.4
   or try  the  Innotek/Netlabs  GCC instead of  EMX. There are  arcane  libc
   dependencies that could break some features such as wildcard expansion. In
   this case you can tweak the root  Makefile manually to include  some extra
   modules:

   lib/glob.o lib/regex.o lib/getlogin_r.o lib/mempcpy.o lib/fnmatch.o \
   lib/getpass.o lib/strncasecmp.o lib/lstat.o lib/tempname.o lib/mkstemp.o \
   lib/inet_aton.o \

   The original toolchain:
   * EMX v 0.9d
   * GCC v 3.2.1
   * Autoconf v 2.59-20051231 (CVS)
   * bash v 2.05
   * GNU make v 3.81 beta3
   * The "standard" set of GNU *utils from the EMX age.

   Libraries:
   * libexpat v 1.95.6
     http://hobbes.nmsu.edu/download/pub/os2/dev/expat-1-95-6.zip
   * OpenSSL v 0.9.8l
     http://ebisa.hp.infoseek.co.jp/os2/rb/openssl-0.9.8l-os2emx-20091107.zip
   * libiconv v 1.10 -- no longer needed/distributed as of 0.23.3
     http://ebisa.hp.infoseek.co.jp/os2/rb/iconv-1.10-ja1-emx-20060529.zip
   * GNU readline v 2.2
     http://hobbes.nmsu.edu/download/pub/os2/dev/emx/contrib/gnureadl.zip
   * ncurses v 5.5
     http://hobbes.nmsu.edu/download/pub/os2/dev/util/ncurses-5.5-os2.zip

   The "Configure" script was invoked with:
   --with-ssl [--disable-readline]


5. If you intend to use WebDAV to "create, share and explore"... 

   ...instead  of occasional/scripted  file transfers, then there  is a  more
   natural choice: a plugin for NetDrive. See http://ndpdav.netlabs.org


6. Revision History

   23/08/2005: Initial port of Cadaver v 0.22.2
   03/09/2005: Re-release of 0.22.2 with -lreadline and a binary mode patch
   07/02/2006: Updated to 0.22.3 + patches; readline left out again
   27/01/2008: Updated to 0.23.0 due to popular demand for fresh Cadavers
   02/02/2008: Upgraded libraries, fixed hardcoded paths, added patches/YATFs
   05/04/2008: Updated to 0.23.2; enabled "lcd" to switch drive letters
   30/12/2009: Updated to 0.23.3; small fixes ("lcd", "lpwd", autocompletion)


7. Contact

   Andrew Belov <andrew_belov@newmail.ru> 

   Oliver Cremer <oliver.cremer@gmx.de> has created the WPI package.

   The original source code is available at http://www.webdav.org/cadaver