home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
d
/
dshar116.zip
/
DSHARDOC.ENG
< prev
next >
Wrap
Text File
|
1993-03-10
|
5KB
|
145 lines
note: This is only a summary of the Japanese document translated into
English. Sorry for my poor English. (^_^)
---------------------------------------------------------------------
dshar(MS-DOS command.com archiver, like UNIX shar) document (V1.13)
nide@nara-wu.ac.jp 93.02.25
This program, named `dshar' and works under MS-DOS, bundles some (text
or binary) files and produces a self-extract archive. The archive it
creates is a batch file, and you can extract the original files by
executing it under command.com. Since the archive contains only 7-bit
visible characters (unless you're using 8-bit characters in filenames)
and spaces and CRLFs, you can send it through text-only networks.
Moreover, you need no special tools other than command.com to unbundle
it.
Warning: Batch files created by the old version of dshar (until 1.10)
does not work correctly on some machines. Please use a newer version.
The contents
~~~~~~~~~~~~
dshar.doc ...Japanese document
dshardoc.eng ...This file
dshar.c dshardat.c dosfn.c setargs.c getopt.c common.h
...sources
makefile ...makefile for MS-C & ASCII(C)Software Tools make.exe
makefile.unx ...makefile for UNIX
dshar.exe ...MS-DOS executable
undshar.sh ...a shell script on UNIX to unbundle dshar'ed file
If your compiler has _dos_findfirst() etc, you don't need dosfn.c.
You don't need getopt.c unless you're compiling dshar on UNIX which
lacks getopt().
Usage on MS-DOS (how to archive)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dshar FILE FILE ... > ARCHIVE.bat
Arguments are the names of files you want to archive. You can use
wildcards (but except in the middle of the path).
If an argument is a directory, all files in it will be recursively
archived.
You can specify `response file' by adding `@' at the head of the name
of it. For example, if a file named `cfiles' contains the following
strings:
aaa.c bbb.*
cc/ddd.c
then, when you type `dshar z.exe @cfiles z.doc', it's just same as
typing `dshar z.exe aaa.c bbb.* cc/ddd.c z.doc'.
If one of the arguments is `@-', the standard input is regarded as a
response file. For example, you can type `ls a*/b*.c | dshar @-', if
you have UNIX-like ls.
How to extract from archive (On MS-DOS)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can extract the original files by simply executing it. If you
received an dshar'ed archive via e-mail, first you have to cut off the
lines above the `echo off' line.
Unless you're specifying the `-c' option, the existing files are not
overwritten.
* * *
You can find the following string near the end of the created archive:
`You may put any additional commands to be executed here.'
It means that you can add any optional commands after that. For
example, if you have an LHa's SFX and have archived it by dshar, then
you can add a command to extract the SFX after that string. If you do
so, when you execute it the SFX is extracted first, and then the SFX is
executed. Therefore you can easily extract the LHa'ed files in one
command. It's an efficient way to archive many or big files by dshar, I
think, since dshar doesn't have any abilities of compressing files.
But, note that you MAY NOT add or delete anything at any other places,
because an archive produced by dshar DEPENDS ON the positions of data in
the file.
Making archive and extracting on UNIX
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can compile dshar on UNIX by typing:
cc -DUNIX dshar.c dshardat.c setargs.c -o dshar
but, don't forget to define `-DUNIX'.
The usage of dshar on UNIX is
dshar [-b] [-t] FILE FILE ... > ARCHIVE.bat
which is almost same as on MS-DOS, but two options are added. They have
the following meanings:
-b produces the archive whose EOL marks are CR+LF.
-t archiving files while converting EOL marks from LF to CR+LF
On UNIX, dshar produces a batch file as a text file (unless you
specify -b option). If you transfar it to MS-DOS, please do so in TEXT
mode.
If you want to archive text files by dshar on UNIX, the archived files
must have CR+NL at the end of each line (unless you specify -t option).
Warning: On UNIX, dshar doesn't check whether the filenames are
permitted on MS-DOS (ex. whether they are within 8 letters + 3 letters
extention).
* * *
You can extract the dshar'ed archive on UNIX by using undshar.sh.
Please transfer it to UNIX and rename it to `undshar', and make it
executable. The usage of undshar is
undshar [-c] [-t] [-n] archive_file
and, the EOL marks of the archive can be either NL or CR+NL. Options
have the following meanings:
-c Overwrites the existing files
-t Trims CR and ^Z from the extracted files
-n Don't perform extraction but produce a shell script to do so
Undshar needs awk and uudecode. Archives created by old version of
dshar (before 1.04) can't be extracted by undshar.
Others
~~~~~~
Dshar is a free software, but not a PDS (except getopt.c, which is in
public domain). You can freely use or improve it, but you can
redistribute it only if:
- You give all files included in original archive
- If any changes are added, the position of modification and the
name of the person who changed it are clearly written
If you have bugs, please send a e-mail to nide@nara-wu.ac.jp, or
report it to fj.binaries.msdos.d.