[arachne] Re: change copy tool

Arachne at FreeLists---The Arachne Fan Club!

> Anyone know of software that copies only new or changed files for dos?
>Have several for os/2 but none for other.  Hints appreciated!
>
>  Cal

RAR archiver/compressor with the u and -as options performs quite a
decent job Cal.

If you're running a ramdisk and want to preserve any changes
made during a session then you may be interested in an extracts
from my setup.

Note that %RAMDISK% is set to the drive of my ramdisk e.g. r:
and %FLASHSTICK% is effectively set to the hardisk e.g. c: (I
haven't actually got a hardisk and use a Flashstick instead).
Both of those are set in Autoexec.bat e.g. SET RAMDISK=R:
and SET FLASHSTICK=C:

I use XMSDSK ramdisk driver as that supports assigning your own
prefered drive letter to the ramdisk (I prefer R:).  I also
use DR-DOS 7.03 stacker to compress that ramdisk, boosting the
space up from 40MB in standard form up to around twice that amount.

I've also got ANSI.SYS device driver loaded in config.sys, hence the
escape sequences that add a bit of colour to some of the displayed
messages.

An outline of my process to load Neopaint (easily changed to
any other program fileset) is :-

LoadNeo.bat checks to see if the files are already loaded onto the
ramdisk (e.g. in this example it's checking for neopaint.exe).
If it finds that file, is simply skips to the end of the bat file
(e.g. load.bat has been called more than once) and starts NeoPaint.

Otherwise, the previously created RAR archive holding all of the NeoPaint
programs (c:\data\ramdisk\neopaint.rar) is copied across to the root
directory of the ramdisk (use the same rar command line as in save.bat
to create the initial RAR archive content).

RAR is then called to extract that archive (x option) with no prompts
(-inul), by default the directory structure is reconstructed when the x
option is used.

Neopaint is then started.

The reason why I copy the archive to the ramdisk prior to extracting
is that I also leave it there so that when it comes to updating
it with any changes (using save.bat) processing is faster.  Under my
setup it appears to be faster to update the archive on ramdisk and copy
that single file back to the hardisk than it is to perform the updates
directly onto the hardisk based archive file.


LoadNeo.bat
===========

@echo off
if exist %RAMDISK%\neopaint\neopaint.exe goto already
echo  Installing NeoPaint to RamDisk... 
%RAMDISK%
cd \
copy %FLASHSTICK%\data\ramdisk\neopaint.rar >nul
rar x -inul neopaint.rar
:already
%RAMDISK%
cd \neopaint
neopaint %1 %2 %3


The next extract is for the save ramdisk bat file content, again I
just check to see if the files are already on the ramdisk, if not
it just skips to the end.  Otherwise RAR is called to update (u option)
the archive with no prompts (-inul), preserving pathnames (-ap)
and using the sync files option (-as), recursing through sub-directories
(-r) adding to the archive named neopaint all files in and under
r:\neopaint


Save.bat
========

@echo off
if exist %RAMDISK%\neopaint\neopaint.exe goto nok
echo  ÿÿÿÿÿÿ   No NeoPaint Changes Found        
goto nskip
:nok
echo  ÿÿÿÿÿÿ   Preserving NeoPaint Changes      
%RAMDISK%
cd \
rar u -inul -ap -as -r neopaint %RAMDISK%\neopaint\*.*
copy neopaint.rar %FLASHSTICK%\data\ramdisk\neopaint.rar >nul
:nskip


You have to use the DOS 32-bit version of RAR as older 16 bit
versions don't include the -as (sync) option.

What -as does is to compare the source files with the existing archive
content and if any have been deleted from the source directories then
they are removed from the archive.  The update option ensures only
new or changed files are reflected into the archive.


Regards and an early Happy New Year to all.

CJ.


Arachne at FreeLists
-- Arachne, The Web Browser/Suite for DOS and Linux --

Other related posts: