home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
lpt197.zip
/
lptool.doc
< prev
next >
Wrap
Text File
|
1998-08-04
|
27KB
|
649 lines
LPTool filetransfer & rexec; version 1.97 01-08-98 (c) 1996-98; Jan van Wijk
════════════════════════════[ www.fsys.demon.nl ]═════════════════════════════
CONTENTS
--------
Introduction, purpose of the program 1
Status of the program 1
Installation 2
Summary of commands 2
Command reference 3
Examples of LPT usage 7
Known limitations 8
Considered improvements 8
Introduction, purpose of the program
------------------------------------
LPTool enables file transfer and remote execution via a "laplink" cable
connection between parallel ports of two machines running OS/2 3.0 or
greater.
Features include the ability to create directories on the remote
machine, copy of complete directory-trees including EAs (S option), and
replace locked (in use) OS/2 DLLs or EXEs at the receiver side.
LPTool works using a daemon in a text-window, accessible either directly or
through other programs with the help of LPTQ.EXE, enabling REXX and batchfile
automation and integration with file-managers.
Two warnings! LPTool will overwrite directories and files without
warning, so make very certain you know where your files are headed
before you begin a transfer. And, LPTool comes with no guarantee of any
nature. But so far it seems to work quite well.
Availability
------------
1) My Homepage: http://www.fsys.demon.nl (Follow shareware, lpt)
2) HOBBES (WWW): ftp://hobbes.nmsu.edu/pub/os2/util/diskutil/LPTxxx.ZIP
On special request an OS/2 2.x version is available.
Status of the program
---------------------
LPTOOL.EXE (version 1.97) is the latest version and includes LZW compression
This version of the program is free for anyone to use, it was written
in my own time using my own equipment. However, I would very much
appreciate any feedback by e-mail or a simple postcard to:
┌───────────────────┐
│ Jan van Wijk │
│ Blekerstraat 83 │
│ 1315 AC Almere │
│ Netherlands │
└───────────────────┘
Further development depends on my own needs and feedback I receive from
other users, al work has to be done on spare time...
You can reach me through the Internet: lpt@fsys.demon.nl (preferred)
or: jan.van.wijk@cmg.nl
Change History
--------------
1.00 27-01-96 Initial version, communicate with the device-driver
1.16 22-02-96 First BETA; with some known bugs
1.26 06-03-96 GAMMA version, including REXEC and performance statistics
1.30 14-03-96 First production version, including REXX; no internal trace
CRC-32 checking is being done on file-transfer
1.34 10-04-96 Added extra file-spec evaluation for include/exclude [x]
1.35 14-04-96 Auto exit feature; Replace of locked EXE's or DLL's
1.42 12-05-96 Command-queueing, other programs can supply cmds (LPTQ.EXE)
1.50 27-05-96 Final version using command-queueing, WARP EXEPACK:2
1.56 16-06-96 First version using multi-threaded read/write port/disk
1.65 27-01-97 Dynamic loading of REXX support; fixed thread priorities
1.69 06-02-97 filetree and drivemap commands added for GUI interface
1.70 08-02-97 -c option (clean) and daemon command added for LPTGUI
1.71 12-02-97 P option on send, no peer-prompting and stat; *cmd pilot
1.75 17-02-97 *send reliable (but slow); lpts.cmd for synchronizing dirs
1.76 23-02-97 New cmd "qscreen" on/off, new cmd "say"; @ for no echo
1.81 13-07-97 New filetree / tstree commands; bug-fixes
1.83 26-04-98 Multiple-cmd using # separators; cosmetic fixes; WEB info
1.84 04-05-98 Accept \pipe\xxx as source and \pipe\ as destination stream
1.86 09-05-98 Fixed 'sound asleep' priority problem for daemon thread
1.87 15-05-98 Fixed some more dead-lock possibilities in agent thread
1.90 07-06-98 Made size-param obsolete on \pipe\, prepare for LZW compres
1.92 15-06-98 First release with LZW compression on file-transfer
1.95 21-06-98 Rename to LPTool, display changes + fixes for compress bugs
1.96 23-06-98 High-res icons, fix for 'overwriting dir' trap; diplay fixes
1.97 01-08-98 Added support for LPT2, BETA, not properly tested yet :-(
Special thanks to:
Ray Tennenbaum for his contribution to this documentation
Aglaja Przyborski for the nice icons she created for the tool
Installation
------------
Only two files are required to operate LPTool, LPTDD.SYS, the device
driver, and LPTOOL.EXE, the actual LPTool.
1) Unzip the files into a directory. Next, add to your config.sys:
DEVICE=[drive]:\[path]\LPTDD.SYS
Note: LPTDD.SYS can take two optional parameters:
"-T:ss" specifying the timeout value on send/receive (default 10 seconds).
If using slow media (diskette) increase this for reliable operation, e.g.
DEVICE=[drive]:\[path]\LPTDD.SYS -T:20
"-P:n" specifying the LPT port to use (default is 1 for using LPT1).
DEVICE=[drive]:\[path]\LPTDD.SYS -P:2
2) To use LPTOOL.EXE, either copy it to a directory in your path
(recommended) or simply start it in its own directory. You may then
issue commands like the ones below. LPTool supports REXX.
* LPTRACE.EXE is the LPTool with trace and debug code
-- it also runs on OS/2 2.11.
* LPTQ.EXE is a simple text front-end to pass LPTool commands to LPT.EXE
-- very useful for batchfile transfers of files and directories.
* LPTS.CMD is an LPTool REXX script to synchronize a local directory with
a remote directory, based on date- and time-info.
* LPTD.CMD is a simple command to start LPTool as dedicated daemon.
For best results, all these should be in your PATH.
Summary of commands
-------------------
LPTool takes commands as a command-line argument or from the keyboard and
displays the results to the screen, scrolling text upward.
Results can also be copied to a file for later analysis.
When a command is passed from the command-line, LPTool will quit automatically
after execution of the command. This makes is easier to call LPTool functions
from other tools, like file-managers. The commands are single words.
Most commands have one or more parameters of wich some are optional.
An overview of the available commands is given below, it can also be
referenced from within the program using the '?' command.
ping [ + | - ] = Check if other station is connected and ready
find [s][c][o][a][n][x] = Find files, display info; optional cmd [c])
show [s][d][o][a][n][x] = Show source & target filespec for a send
send [s][d][o][a][n][x] = Send files to connected peer machine
s = source specification, optional absolute or relative path
d = destination: path or, '*' = current dir, '=' = same path
o = options: S=subdirectories, F=Files, D=Dirs, I=Include, A=async
x = exclude/include file-spec(s), wildcards * and ? allowed
a = Attributes to match for source selection
n = Attributes to set/reset afterwards on source
A = Archive, R = Read-only, S = System, H = Hidden
Prefix each with '+' for set and '-' for reset
command-string = Execute an LPTool or OS/2 command here
.command-string = Execute an LPTool command at the other side
r command-string = Remote exec command, redirect output back
run lpt-macro[.cmd] = Run REXX macro in LPTool ADDRESS-environment
? = Give (this) helptext
q, quit, exit = Exit LPTool; 1.97 01-08-98 (c) 1996-98; Jan van Wijk
EXTERNALS Any command not recognized as a valid LPTool internal command
will be passed to the default command-processor (COMSPEC).
Usefull commands: DIR, DEL, ...
Command reference
send [source-files] [destination] [options] [attrib] [new-attr] [excludes]
Purpose: Send one or more files from HERE to PEER
Parameters: source-files source specification, default '*'
may include absolute or relative path, can
also be a named pipe: "\pipe\pipename" where
pipename will be used as destination filename
dest destination path, default current dir
'*' = current dir (placeholder),
'=' = same path as source
\pipe\ = Named pipe "\pipe\src-fname" where
src-fname is the filename part of
the source specification (no path)
options options for file selection, default 'B'
R = Reportback RC of file-transfer to sender
S = subdirectories included
F = Files only
D = Directories only
B = Both files and directories
I = Use additional Filespecs [x] as INCLUDE
selection, not Exclude. (default exclude)
may be prefixed with '+', '-' or '/'
attrib Attributes for selection, default none
A = Archive
R = Read-only
S = System
H = Hidden
D = Directory
When specified, each attribute must be
prefixed with:
'+' attribute set
'-' attribute clear
'*' attribute don't care
new-attr Attributes to set/reset afterwards on
each selected source file/directory.
A = Archive H = Hidden
R = Read-only D = Directory
S = System
When specified, prefix each attribute with:
'+' attribute set '*' attribute keep
'-' attribute clear
excludes Upto 9 seperate file-specs to be excluded or
specifically included.
Multiple wildcards * and ? allowed.
Output: One line for each file/directory sent to PEER, with:
filesize EA-size attributes filename progress
Some lines with a summary of the number of files,
directories, read-only files etcetera that were found.
Also a performance indication in Kb/second is given,
the actual amount sent and the compression ratio.
show [source-files] [destination] [options] [attrib] [new-attr] [excludes]
Purpose: Show wich files will be sent from HERE to PEER if the
same parameters are used on the SEND command
Parameters see SEND command
Output: One line for each file/directory sent to PEER with:
source-filespec => target-filespec
find [source-files] [os2-command] [options] [attrib] [new-attr] [excludes]
Parameters see SEND command, except for [c] parameter
os2-command Command to execute on each file found, the
full path and filename will be passed as
argument to the specified command.
Note: DO NOT INCLUDE ANY SPACES IN THE COMMAND
Purpose: Find files using same syntax as send/show
Output: One line for each file/directory found with:
filesize EA-size attributes filename
Some lines with a summary of the number of files,
directories, read-only files etcetera that were found.
filetree [source-files] [dest] [options] [attrib] [new-attr] [excludes]
Purpose: Find files, display in REXX SysFileTree format
Parameters see SEND command, [dest] parameter is ignored
Purpose: Find and list files using REXX SysFileTree output syntax
Output: One line for each file/directory found with:
dd/mm/yy hh:mm filesize attributes full-filename
fstree [source-files] [dest] [options] [attrib] [new-attr] [excludes]
Purpose: Find files, display in date-sortable format
Parameters see SEND command, including [dest] parameter (destination)
Purpose: Find and list files using a date sortable output format
Output: One line for each file/directory found with:
yymmddhhmm full-filename » destination-path
.command-string = Execute an LPTool command at the other side
Purpose: Execute an LPTool command at the PEER
Parameters: As required by the LPTool command
*command-string = Execute an LPTool command at the other side, watch
Purpose: Execute an LPTool command at the PEER, stay watching output for
a short while (usefull from LPTQ to get AGENT output back)
Also see the 'WATCH' command
Parameters: As required by the LPTool command
r command-string = Remote exec command, redirect output back
Purpose: Execute an OS/2 command at the PEER and get output HERE
Parameters: As required by the OS/2 command
Output: All standard-output (STDOUT, filehandle 1) and all
standard-error (STDERR, filehandle 2) will be intercepted
at the PEER, send back to the local machine, and is displayed
using standard LPTool mechanisms. This includes a local log-file.
set var [value] = Set/show an LPTool system variable value
Purpose: Set an LPTool system variable to a specific value and/or
show the actual value of a variable
Parameters: var [value] name and optional value for a variable
- prompt prompting level 0 no automatic prompting
1 just a command-prompt
2 full menu at auto prompt
4 Daemon usage auto prompt
- compress compression level 0 no compression
10 .. 13 LZW variants
14 LZW 14-bit (default)
Output: Value of the system-variable, after optional value assignment
watch [time-out] [idle-time]
Purpose: Keep watching, and redirecting, screenouput to be able to
see it from an attached LPTQ or in the logfile
Parameters: time-out Timeout for first-output line in seconds,
if no ouput after (to) then command ends
idle-time Timeout after first output is seen in seconds,
if no more ouput is seen for (it) seconds the
command (and redirection) will end
Output: All standard-output (STDOUT, filehandle 1) and all
standard-error (STDERR, filehandle 2) will be intercepted
at the PEER, send back to the local machine, and is displayed
using standard LPTool mechanisms. This includes a local log-file.
l [file] = Log to 'file' ('l' = stop log)
Purpose: Close current LOG, open new and capture LPTool output in it
Parameters: File specification
If no parameter is specified, logging is stopped.
Output: Concatenated output of LPTool commands given after the
'l' command, upto next 'l' or 'q' command.
ANSI control characters for colors and cursor-positioning
are not written to the logfile.
Remarks: There is no check on available space on the destination
drive, file may end up empty if disk(ette) is full.
The same logfile specification can be used more than once,
output will be concatenated.
On each 'l' command the current logfile will be closed.
trace [level] = Set trace level for LPTool internal functions
Purpose: Investigate unexpected behaviour and debug LPTool
Parameters: level optional Trace level; 0 = no trace
Output: The resulting trace-level, after this the output will be
normal output mixed with extra trace information showing
API return-codes and LPTool internal variables
Remarks Use with care, tracing will delay processing wich might
cause additional problems like LPTDD$ timeouts.
This function might be left out of production versions of
the tool to get maximum performance.
q, quit, exit = Exit LPTool; 1.97 01-08-98 (c) 1996-98; Jan van Wijk
Purpose: Exit LPTool program
Parameters: none
Output: none
Remarks: LPTDD$ and logfile will be closed on exit
Asynchronious running threads will be aborted.
When given from clients like LPTQ, the daemon can be stopped
as well by executing the 'QQ' command.
lpt = Identify currently running LPTool (daemon) version
Purpose: Show version of connected LPTool daemon, useful from clients
Parameters: none
Output: Version info
device [device-name] = Identify or set the LPT device to use
Purpose: Show attached device-driver name, or optionaly set and re-open
with a different name (allowing use of LPT2 for instance)
Parameters: device-name The device-driver name to open, any valid OS/2
device will do, but only the ones created by
LPTDD.SYS or LPTIO.SYS will actualy work :-)
The device names when are:
"LPTDD1$" for the LPT1 port
"LPTDD2$" for the LPT2 port
"LPTIO1$" for the LPT1 port using LPTIO.SYS
"LPTIO2$" for the LPT2 port using LPTIO.SYS
Output: Either the name of the currently attached device name, or
a message indicating success or failure opening the device, and
possible warnings if the device is not a proper LPTool device.
Remarks: On startup LPTool automaticaly will try to open each of the above
mentioned devices, until it finds on present.
This will usualy be the "LPTDD1$" device.
For use of another port, like LPT2 the "-P:n" switch is needed
on the device statement in config.sys for LPTDD.SYS
cd [path] = Change current Directory
Purpose: Change both the current directory and the current drive
Parameters: path optional Absolute or relative path specification
Output: The resulting current drive and directory
Remarks: '.' and '..' can be used in the relative path specification
d: = Change current Drive
Purpose: Change the current drive, without changing current directory
Parameters: none
Output: The resulting current drive and directory
screen [arg] = Switch output to the screen on or off
Purpose: Allow output to logfile only
Parameters: arg optional 'on' or 'off' to switch mode
Output: none
Remarks: The returncode (rc from REXX) will indicate the setting for
screen output: 0 indicates screen switched on
1 indicates screen switched off
run mf [arg] = Run a REXX macro from LPT
Purpose: Execute a REXX script using the 'LPT' environment
Parameters: mf mandatory Macro file specification
arg optional Arguments to the REXX macro
Output: Any output from the REXX macro including (OS/2) commands
executed from the macro.
There is no redirection of any output to the LPTool logfile.
Remarks: LPTool commands can be issued from within the macro, this
is the default environment (Address LPT).
Command for CMD.EXE must be addressed explicitly using
an 'Address Cmd'
The following REXX variables will be available after
each executed LPTool command from a macro:
rc The returncode from the LPTool command
REXX is dynamically loaded, when the run-command is exectuted
It requires REXX.DLL and REXXAPI.DLL in the libpath.
filetree [s][d][o][a][n][x] = Find files, output in SysFileTree format
Purpose: Show wich files exist for a given filespec and attributes
usefull for a GUI interface remote query (".filetree")
Parameters see SEND command
Output: One line for each file/directory in SysFileTree format
drivemap [d] Show wich logical drives exist
Purpose: Show wich drive-letters exist at the LPT-deamon
usefull for a GUI interface remote query (".drivemap")
Parameters d optional Output-format / level of detail
Output: default: One line of drives, example: "C: D: E: R: Z:"
'-' : One line for each drive-letter, just the drive
'+' : One line for each drive-letter, with drive and
additional filesystem information
EXTERNALS Any command not recognized as a valid LPTool internal command
will be passed to the default command-processor (COMSPEC).
Purpose: Allow execution of external commands like CHKDSK, DIR etc.
Parameters: As required by the external command
Output: Any output by the command
Examples of LPTool usage
-----------------------
- Send all files in current directory to PEER's current directory
SEND
- Send a single file to a specific directory
SEND s:\some\source\path\somefile.ext d:\some\destination\path
- Send a complete tree of files to a specific destination directory
SEND s:\some\source\path\* d:\some\destination\path s
- Send all modified (archive-bit set) file in a directory tree to
exactly the same path on the PEER side and reset archive-bit on source
SEND * = s +a -a
- Show wich files will be sent for the previous example
SHOW * = s +a
Note that the '-a' option is NOT SPECIFIED to prevent the archive-bit
to be reset just by showing (we want that to happen on SEND).
- Send a product-development tree except objects and executables:
SEND d:\project\* . s * * *.OBj *.EXE
- Send an installed OS/2 version to a different destionation-drive and
exclude the OS/2 ini-files, swapper end desktop-directory
SEND c:\* e:\ s * * *os2*.ini *swapper.dat c:\desktop*
- Send all .C and .H files, from a tree, that have changed (archive bit)
SEND d:\project\test\* . si +a * *.c *.h
- Find all files on the C: drive that are read-only
FIND C:\* s +r
- Show drives available at the remote machine:
REXEC DRIVEMAP
- Show new (archive attribute) files at remote machine in filetree format:
REXEC FILETREE C:\* s +a
- Show new (archive attribute) files at local machine in filetree format:
FILETREE C:\* s +a
- Send a file using a named-pipe as source (as called from DFSee "sim"):
SEND \pipe\bootsect.img d:\tmp
- Receive a file using a named-pipe as destination (as with DFSee "wrim"):
.SEND d:\tmp\bootsect.img \pipe\
Known limitations and bugs
--------------------------
Error recovery
Error recovery is limitted to reporting the error-code and for most
common errors als a short description of the error. Usualy this will
be shown both HERE and at the PEER station.
REXEC redirection of STDIN
No redirection for a remote program's standard-input is possible yet.
Canceling functions
Interrupting the program using Ctrl-C will exit completely, there is
currently no 'smooth' way to cancel an operation.
Redirection sometimes causes keyboard-in-use errors (rc 447)
I noticed this on the 'find' command.
Considered improvements
-----------------------
- Limited retries on failing block-transfers (CRC error, timeout etc)
- Redirect STDIN for remote executed commands from PEER to HERE
- A PM frontend (LPTQPM.EXE) to supply LPTool command with a graphical
user-interface for both input and output.
- A text-mode frontend (LPTQVIO.EXE) to supply LPTool command with a
user-interface for both input and output.