home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Java
/
Java.zip
/
rdb084r2.zip
/
RIO111.Zip
/
example2.cmd
next >
Wrap
OS/2 REXX Batch file
|
1996-08-19
|
1KB
|
43 lines
/* The corresponding OS/2 REXX procedure of
the example2.nrx (see that).
Note: The pure REXX version is 5.5
times faster on my system:
486dx4-120, 32meg RAM, 2xFireball 1.2g HD. */
say ' '
say 'This program creates a copy of an existing'
say 'binary file.'
say 'The result file of the copy is placed in'
say 'this directory, under the name TEMP.BIN.'
say ' '
say 'WARNING! This example takes forever to execute'
say 'with large files..'
do until length(fname) \= 0
say ' '
say 'Please enter a valid file name..'
say ' '
say 'Example: c:\filename.exe'
say ' '
ok=charout(,"File name>")
fname = linein()
if length(stream(fname,"c", "query exists")) = 0 then
do
fname = ""
say "That file doesn't exists."
end
end
"@del temp.bin"
ok = stream(fname, "c","open read")
ok = stream("temp.bin","c","open write")
count = 0
do while chars(fname) > 0
bytes = charin(fname)
count = count + 1
ok = charout("temp.bin", bytes)
end
say count 'bytes copied.'