home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.uv.es
/
2014.11.ftp.uv.es.tar
/
ftp.uv.es
/
pub
/
msdos
/
compresores
/
tar
/
pdtar.doc
next >
Wrap
Text File
|
1993-06-30
|
14KB
|
596 lines
_p_d_t_a_r
_D_E_S_C_R_I_P_T_I_O_N
_p_d_t_a_r is an extensive rewriting of gnu tar (public domain)
that provides for direct transfer of tar format files
between SCO Xenix and MSDOS systems.
_p_d_t_a_r options are both a subset and a superset of those
provided by Xenix tar.
_U_S_A_G_E
_p_d_t_a_r [-options] [file(s)]
_O_P_T_I_O_N_S
_p_d_t_a_r options are of three forms.
-x
the option x is invoked.
-xNN
the option x is invoked with an associated parameter set to
the numerical value NN.
-x string
the option x is called with an associated string parameter
set to string.
NOTE _p_d_t_a_r does NOT support tar style options where certain
flags point to the nth argument.
----- April 23, 1989 -----
2
_F_U_N_C_T_I_O_N_S
NOTE Use the -h option described below to verify your ver-
sion of _p_d_t_a_r against this documentation. If there is a
difference, the -h will give the latest options.
[0-9]Take options for a default file. On Xenix this is
/etc/default/tar and under MSDOS /default/tar.
NOTE You must create your own MSDOS default file in Xenix
format to use this under MSDOS.
-A Do NOT use absolute names if present (strip leading /).
-c Create an archive.
-C Change to a named directory. For example, given
_p_d_t_a_r -cvf archive.tar . -C ../goodies
_p_d_t_a_r will archive files in the current directory and
its subdirectories (if any). It will then do a chdir to
../goodies and archive all files in it and its
subdirectories. Files taken from ../goodies will have
the form ./file rather than ../goodies/file. Copy under
MSDOS files that were linked under **IX.
-E Estimate the number of floppies needed.
-f The following argument is the archive or device name.
NOTE For MSDOS device names are given as a:, b:, c:, etc.
_p_d_t_a_r does NOT recognize or use the disk drivers
supplied with MSDOS 3.x. For example, if you have a
second drive with multiple drivers that you reference
as e:, f:, etc. depending on density and tracks, for
_p_d_t_a_r, you must call the drive b:.
NOTE
NOTE
NOTE _p_d_t_a_r begins writing a track 0, if you specify your
hard disk as the output device, it will probably TRASH
YOUR HARD DISK. Testing whether this is really the case
is left up to the user as an exercise.
-F The following argument is the name of a file containing
a list of files (or directories) to be placed in or
extracted from an archive.
----- April 23, 1989 -----
3
-G Extracts multiple generations. If a file in the archive
has the same name but different modification time AND
different size from the current file, the archive file
is extracted under the name xxxxxxxx.ggg where xxxxxxxx
is a (possibly) modified version of the current name
and ggg is a unique number beginning at 000.
-h Prints a summary listing of the available functions and
options.
NOTE This function is operating-system selective.
-knn Specify the archive size (for fixed length devices) in
kilobytes. Acceptable values for nn are 360, 720, 1200.
NOTE _p_d_t_a_r actually operates in terms of 512 character
blocks, and it is this value that is used for reporting
archive sizes.
-m Do NOT restore modification times for extracted files.
-n Not a tape or a pipe (seeks can be used to speed
skips). This is implied by the -k option.
-N If the local file is newer than the archive file, do
NOT extract the archive file.
-p Do not restore the original permissions but rather use
the default permission generated by umask().
NOTE SCO Xenix documentation claims the -p option is
necessary for restoration of the original permissions.
This is backasswards from the way the program actually
operates.
-Pnn Strip the leading nn parts of the archive path name.
-T Do NOT adjust MSDOS times. See below.
-t Produce a table of contents.
-x Extract from the archive.
-U Do NOT mask MSDOS permissions to 0755. See "MSDOS
PERMISSIONS" below.
-Z Unlink each file as it is added to the archive.
This option is potentially dangerous.
----- April 23, 1989 -----
4
* Any other names on the command line are taken as files
(or directories) to be placed in or extracted from an
archive. During extraction named files or directories
limits the extraction to matched items.
NOTE A common error in this context is failure to give a
properly literal string for a desired file name. For
example, if an archive was made from a list (such as
that produced by find) with names of the form
./path/name
then a restrictive list must be of the form
./path
or
./path/name
Due allowance must be made for the impact of the -A and
-P options in creating a restrictive list for an
extraction.
NOTE A single dash (-) given as a file name implies stdin or
stdout as appropriate.
NOTE The MSDOS version does NOT currently expand wildcards.
If you are using the MKS Toolkit shell, names con-
taining wildcards will be expanded but argument
truncation is probable.
NOTE Case IS ignored in MSDOS file specifications.
NOTE Directory names given in a -F list ARE expanded. Be
careful with the following construct:
find . -print > filelist
If the current directory has subdirectories, "filelist"
will have those directory names plus the files in those
directories. _p_d_t_a_r will expand the directory names with
the result that two or more copies of the files are
added to the archive. The proper form for producing
such a list (unless you want redundancy) is
find . -type f -print > filelist
----- April 23, 1989 -----
5
_M_S_D_O_S _T_I_M_E_S
MSDOS and UNIX use different conventions for giving a time
and date stamp to files. Although Turbo C and other MSDOS
compilers provide functions that mimic **IX file functions,
a problem remains because a given long integer value (the
way tar records times) represents different "clock" times
for MSDOS and **IX.
_p_d_t_a_r deals with the time problem by comparing the **IX
representation of 1989:01:01 with the MSDOS version. The
difference is used to adjust the file time stored in the tar
header. In particular
(a) an archive made under MSDOS has header times adjusted
so that when the archive is extracted under **IX, the
files will have the same clock times as they did under
MSDOS.
(b) an archive extracted under MSDOS has header times
adjusted so that the extracted files will have the same
clock time as they did under **IX.
The **IX version of _p_d_t_a_r does NOT change times. The time
adjustment mechanism may be turned off with the -T option.
Generally, even for archives used entirely under MSDOS, it
should be left on.
_M_S_D_O_S _P_E_R_M_I_S_S_I_O_N_S
MSDOS has an even more brain-dead permission system than
**IX.
With archives created under **IX, _p_d_t_a_r lets the chmod()
function in Turbo C map the **IX permissions to those of
MSDOS.
With archives created under MSDOS, _p_d_t_a_r gives all files
permission 0755 unless the -U option is used. In this case
the original MSDOS permissions are retained. With this
option in effect, the usual MSDOS file is extracted with
permission 0600 under **IX.
_M_S_D_O_S _N_A_M_E_S
----- April 23, 1989 -----
6
**IX names are modified, if necessary, to produce acceptable
MSDOS names. The modification rules are:
(1) Truncate file names to 8 characters.
(2) Change any illegal characters in file names to 'z'.
Translate any periods (other than for a suffix) to '_'.
(3) Truncate suffixes to 3 characters.
_F_O_R_M_A_T_T_I_N_G _D_I_S_K_S
_p_d_t_a_r works with either Xenix or MSDOS format disks.
Under Xenix, _p_d_t_a_r (and Xenix tar) will write a proper tar
format file to either Xenix or MSDOS format. This disk can
be read under Xenix with tar or _p_d_t_a_r and under MSDOS with
_p_d_t_a_r.
Under MSDOS, _p_d_t_a_r WITH THE RAW IO OPTION can use either
Xenix or MSDOS format disks to write a proper tar format
file that can be read with either tar or _p_d_t_a_r under Xenix.
Under MSDOS, _p_d_t_a_r WITHOUT the raw io option writes standard
MSDOS disk files. These can only be processed under MSDOS by
_p_d_t_a_r.
Once a MSDOS format disk has been written with _p_d_t_a_r rawio,
it will NOT be acceptable for use as a standard MSDOS disk
unless you reformat it.
Note carefully the differences between the following cases.
1 _p_d_t_a_r -cvf a:archive.tar -F filelist
produces an archive on a MSDOS disk in MSDOS format. To
read this under Xenix you need
doscp -r a:archive.tar archive.tar
tar -xvf archive.tar
2 _p_d_t_a_r -cvf a: -k 360 -F filelist
produces an archive in Xenix format (even if the raw
disk has been formatted for MSDOS). To read this under
Xenix you need only give
tar -0xv
----- April 23, 1989 -----
7
extract the contents.
The converse of this operation also works for moving files
to MSDOS from Xenix.
_P_O_R_T_A_B_I_L_I_T_Y
_p_d_t_a_r compiles and runs on the following systems:
4.3 BSD (Sun Workstations)
SCO Xenix (80286 machines)
MSDOS 3.x (AT-class machines)
The code should be portable to any machine with a reasonable
approximation of **IX stdio libraries.
_T_A_P_E_S
_p_d_t_a_r has not been tested with tapes.
_B_L_O_C_K_I_N_G _F_A_C_T_O_R
_p_d_t_a_r uses a variable blocking scheme ranging from one (1)
to twenty (20) 512 character blocks.
_E_X_T_E_N_T_S
_p_d_t_a_r follows the SCO Xenix scheme for splitting files too
large to fit on a single floppy.
_L_I_N_E _T_E_R_M_I_N_A_T_I_O_N _C_O_N_V_E_N_T_I_O_N_S
_p_d_t_a_r makes no attempt to adjust for the different line
terminations of **IX (LF) and MSDOS (CRLF). The Kinmonth
_B_i_b_l_i_o_f_i_l_e system includes a program for this purpose (_u_d_l).
This program can distinguish between text and binary files,
converting only the former. Unless otherwise specified, con-
verted files retain their preconversion modification times.
Usage is simple:
_u_d_l -u -f list
----- April 23, 1989 -----
8
converts all text files in list to UNIX conventions.
Changing -u to -d converts all text files in list to MSDOS
conventions.
If the -N (extract only newer files) option of _p_d_t_a_r is
used, the following sequence results in the least
processing.
pdtar -Nxf archive > list
pdtar -xf archive
_u_d_l -u -f list
_B_U_G_S
* Interrupt handling needs improvement.
* No good provision is made for read/write errors,
especially full disks under MSDOS.
Due to bugs in MSDOS or the Turbo C library, a full
disk produces a diagnostic about "file not found."
* **IX -> MSDOS file conversion could be improved.
* Wildcards in file names are not expanded when using
command.com under MSDOS.
_C_O_P_Y_R_I_G_H_T
SCO Xenix is a product of the Santa Cruz Operation.
MSDOS is a trademark of Microsoft, a company dedicated to
proving that you do not have to have a good product to make
big bucks.
Turbo C is a trademark of Borland International, a company
dedicated to proving that you can lose money with good pro-
ducts.
The MKS Toolkit is a product of Mortice Kern Systems and
worth every penny, US or Canadian!
Portions of this program are dependent on code released to
the Public Domain by John Gilmore. The author's release is
cited below.
----- April 23, 1989 -----
9
The remainder of the code is (c) 1988 by Earl H. Kinmonth,
History Department, University of California, Davis,
California, 95616.
916-752-1636/916-752-0776
ucbvax!ucdavis!ucdked!cck
NON-COMMERCIAL, NON-MILITARY use permitted.
[Original release in GNU tar code.]
I am the author of all the code in this program. I hereby
place it in the public domain. If you modify it, or port it
to another system, please send me back a copy, so I can keep
a master source.
John Gilmore
Nebula Consultants
1504 Golden Gate Ave.
San Francisco, California, USA 94115
+1 415 931 4667 voice
hoptoad!gnu data
jgilmore@lll-crg.arpa data
Hoptoad talks to sun, ptsfa, well, lll-crg, ihnp4, cbosgd,
ucsfcgl, pyramid.
----- April 23, 1989 -----