home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
fut_1_00.zip
/
utils.inf
(
.txt
)
< prev
Wrap
OS/2 Help File
|
1996-12-30
|
13KB
|
385 lines
ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
This is a small set of utilities which were written to assist in my work on
both UNIX and OS/2 based machines. These types of routine may already have been
written many times, but in the absence of being able to find any easily
available I have produced my own. They have been made available as much for my
own satisfaction as for their potential usefulness.
Currently there are four tools:
u2d :- UNIX to DOS file format convertor
d2u :- DOS to UNIX file format convertor
fsplit :- File splitting utility
hexdump :- Display the contents of a file in hexadecimal.
I am pleased to make them available for others to use. I would welcome
feedback on them all, both in terms of problems which you have encountered or
suggestions for improvements.
ΓòÉΓòÉΓòÉ 1.1. Build Information ΓòÉΓòÉΓòÉ
These utilities were written in 'C' and compiled using IBM's C Set++ compiler
on a Pentium based machine, but compiled without specific switches for a
Pentium. The version of OS/2 on the host machine was OS/2 WARP Version 4.
ΓòÉΓòÉΓòÉ 2. Utilities ΓòÉΓòÉΓòÉ
Following are the actual manual pages for the utilities.
ΓòÉΓòÉΓòÉ 2.1. u2d ΓòÉΓòÉΓòÉ
ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ d2u ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ source file ΓöÇΓöÇ
ΓööΓöÇ drive ΓöÇΓöÿ ΓööΓöÇ path ΓöÇΓöÿ Γö£ /s Γöñ
Γö£ /h Γöñ
Γöö /v Γöÿ
ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöñ
ΓööΓöÇ destination file ΓöÇΓöÿ
This routine takes as input a UNIX format text file and provides as output a
DOS format text file. The contents of the original UNIX file are unaltered.
It is possible to convert a UNIX format text file in-situ by use of the /s
switch if required. In this case the contents of the original UNIX file are
altered.
Examples
u2d a_UNIX_file a_DOS_file
The above example transforms the source file a_UNIX_file' to the destination
file a_DOS_file.
u2d /s a_text_file
The above example transforms the source file a_text_file from UNIX to DOS in
situ.
ΓòÉΓòÉΓòÉ 2.2. d2u ΓòÉΓòÉΓòÉ
ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ d2u ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ source file ΓöÇΓöÇ
ΓööΓöÇ drive ΓöÇΓöÿ ΓööΓöÇ path ΓöÇΓöÿ Γö£ /s Γöñ
Γö£ /h Γöñ
Γöö /v Γöÿ
ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöñ
ΓööΓöÇ destination file ΓöÇΓöÿ
This routine takes as input a DOS format text file and provides as output a
UNIX format text file. The contents of the original DOS file are unaltered.
It is possible to convert a DOS format text file in-situ by use of the /s
switch if required. In this case the contents of the original DOS file are
altered.
Examples
d2u a_DOS_file a_UNIX_file
The above example transforms the source file a_DOS_file' to the destination
file a_UNIX_file.
d2u /s a_text_file
The above example transforms the source file a_text_file from DOS to UNIX in
situ.
ΓòÉΓòÉΓòÉ 2.3. fsplit ΓòÉΓòÉΓòÉ
ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ fsplit ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ source file ΓöÇΓöÇ
ΓööΓöÇ drive ΓöÇΓöÿ ΓööΓöÇ path ΓöÇΓöÿ Γö£ /b fileSize Γöñ
Γö£ΓöÇΓöÇΓöÇΓöÇ /h ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
ΓööΓöÇΓöÇΓöÇΓöÇ /v ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöñ
ΓööΓöÇ destination file root ΓöÇΓöÿ
This utility divides a source file up into a number of smaller files of
specified size. The last file may not be the exacy size as the source file may
not be exactly divisible. The resultan files have a root file as specified and
are qualified by an incremental count.
The default file size is 1M Byte, but can be varied by use of the /b switch.
The /b switch specifies the resultant file size in bytes and can be qualified
by k or m.
No reciprical utility exists for joining files together since this can be
achieved by using the OS/2 COPY command.
Examples
fsplit fromFile toFileRoot
The source file fromFile is divided into files of the default size 1M with the
root of their name being toFileRoot. Thus, the output files will be
toFileRoot.001, toFileRoot.002 etc.
fsplit /b 1k fromFile toFileRoot
This example operates as per the above example, except that this version
explicitly sets the resultant file size to 1k.
ΓòÉΓòÉΓòÉ 2.4. hexdump ΓòÉΓòÉΓòÉ
ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ hexdump ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ source file ΓöÇΓöÇΓöñ
ΓööΓöÇ drive ΓöÇΓöÿ ΓööΓöÇ path ΓöÇΓöÿ Γö£ /h Γöñ
Γöö /v Γöÿ
This utility produces a hexadecimal listing of a file. The byte count,
hexadecimal codes and actual file contents are displayed. As no paging is
included the result for large files is best redirected into another file for
viewing with an editor.
The row format of the hexadecimal listing is the byte count in hex, followed by
eight pairs of hexadeciml values for the file contents and finally the
corresponding contents of the file itself. Non-ascii characters are shown be a
period.
Examples
hexdump fileToDump > HEXDUMP_file
This example produces a hexadecimal listing of the file fileToDump and
redirects the output to the file HEXDUMP_file.
ΓòÉΓòÉΓòÉ 3. Legal Issues ΓòÉΓòÉΓòÉ
For completeness here are the usual set of license details, acknowledgments,
copyright and disclaimers.
ΓòÉΓòÉΓòÉ 3.1. License ΓòÉΓòÉΓòÉ
This software is protected by copyright and all rights are reserved by the
author.
These utility versions are currently available for you to freely use and
distribute, but their status may change with future upgrades and releases. You
may not charge anyone for this software other than those charges incurred in
effecting the transfer.
ΓòÉΓòÉΓòÉ 3.2. Acknowledgments ΓòÉΓòÉΓòÉ
I wish to acknowledge all trademarks which appear in this documentaion and are
used by the software, they belong to their respective owners.
In particular
OS/2, IBM and Presentation Manager are registered trademarks of IBM
Corporation.
Pentium is a registered trademark of Intel Corporation.
ΓòÉΓòÉΓòÉ 3.3. Copyright ΓòÉΓòÉΓòÉ
(C) Copyright John S Glover 1996. All rights reserved
ΓòÉΓòÉΓòÉ 3.4. Disclaimer ΓòÉΓòÉΓòÉ
This software is provided as is without warranty of any kind, either expressed
or implied, including but not limited to the implied warranty of
merchantability and fitness for a particular purpose.
I take no responsibility for any damage these utilities do to your data, files
or computer, or any other damage. You use these utilities at your own risk.
ΓòÉΓòÉΓòÉ 4. Problem Reports and Future Ideas ΓòÉΓòÉΓòÉ
I am keen to know of any incorrect operation, anomalies in documentation, or
suggestions for enhancements and additions. Therefore, all brickbats and
bouquets to
John S Glover
1 Glebelands Meadow
Alfold
Surrey
GU6 8EA
United Kingdom
jsglover@iee.org
If you do have any problems please provide as complete a description as
possible in terms of input, output and options selected for the utilities or
where you disagree with the description in the manual and the actually
operation. I make no promise to fix the problem since it all depends on the
time available to me, but I will do my best. I regret that a written postal
response can not be made unless a stamped addressed envelope is sent.
If anyone who uses these utilities and wishes to make a donation towards my
time and expense then all contributions would be gratefully received, pounds
sterling. A picture postcard of your home town would be a cheaper and more
interesting method of expressing your views on this software and informing me
on who has used this software.
For the future I have a number of intentions to improve the utilities
including:
Γûá generate Presentation Manager variants. IBM with OS/2 have generated a
powerful and flexible working environment and it would be appropriate to
derive the maximum benefit and productivity.
Γûá account for the extended attributes when spliting files with fsplit. The
extended attributes of a file are currently lost when the file is split which
is rather careless. Where though should the extended attributes be stored?
Γûá improve the command line parsing. The robustness of command line parsing
could be made stronger and more forgiving.
Γûá improve file size specification for fsplit. As you may notice only integer
values can be used with the k, m qualifiers, so for example, 1.4m causes an
error.
Γûá paging within hexdump. All the file is listed in hexadecimal format, so
either the scrolling must be interrupted in the OS/2 window using ^S or the
output directed to a file.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
External Command: Drive and Path Parameters
Specifies the drive and location for the command you want to process. External
commands are stored on the disk as program files. When an external command is
entered, the system searches for it in the current directory of the default or
specified drive. If the command is not found, the system continues searching
for it in the directories listed in the PATH statement.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
A UNIX format text file which is to be converted to a DOS format text file.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
A DOS format text file which is the resultant of converting the UNIX source
file.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
A DOS format text file which is to be converted to a UNIX format text file.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
A UNIX format text file which is the resultant of converting the DOS source
file.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
d2u Command: /S Parameter.
Specify the /S parameter to process the source file in-situ, i.e. the
resultant file name is the source file name. A destination file should NOT be
specified.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
A file which is to be divided into smaller separate files.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
The root from which the output file names are to be derived.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
A file for which a hexadeximal listing is required.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
u2d Command: /S Parameter.
Specify the /S parameter to process the source file in-situ, i.e. the
resultant file name is the source file name. A destination file should NOT be
specified.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
u2d Command: /H Parameter.
Display a simple usage summary.
This is synonomous with /?.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
u2d Command: /V Parameter.
Display the current version information.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
d2u Command: /H Parameter.
Display a simple usage summary.
This is synonomous with /?.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
d2u Command: /V Parameter.
Display the current version information.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
fsplit Command: /H Parameter.
Display a simple usage summary.
This is synonomous with /?.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
fsplit Command: /V Parameter.
Display the current version information.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
fsplit Command: /B fileSize.
Set the output file size to fileSize. The file size can be qualified by use
of k or m for kilobytes or megabytes.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
hexdump Command: /H Parameter.
Display a simple usage summary.
This is synonomous with /?.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
hexdump Command: /V Parameter.
Display the current version information.