home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
cbbs_415.lzh
/
CBBS
/
CBBS.lzh
/
mem
/
doc
next >
Wrap
Text File
|
1989-09-01
|
3KB
|
61 lines
I wrote the two programs in the 'c' directory called loadram and saveram.
I use them to load (with loadram) the entire CBBS source and object into a
ram: directory and then to save back to disk (using saveram) only those files
that have changed. See the file 'loadram' in this directory for an example
of how to call it. Unfortunately, these two programs can't be used to
load bbs files into ram and periodically update them back to disk if they
have been modified. This is because of a problem with the way 1.2 changes
dates in a file and may be fixed in 1.3 ... see the PROBLEMS below.
Loadram has been modified so that if any files are to be copied that match
the pattern "*.o" then these are remembered and copied last after everything
else has been done. This is so that the date on the *.o file will be later
than its corresponding *.c file so that 'make' will not try to remake the
*.o file simply because it was copied into ram before its corresponding
*.c file.
Loadram:
called by: loadram ram-dir disk-dir filespecs ....
The specified ram-dir need not exist and will be created if absent. The
disk-dir must exist. The filespecs can be individual file names or filenames
with a wildcard "*" in them (UNIX-style). The * can ONLY be at the beginning
or end of a filename. Thus, *.c or a5* are valid but a*b is not.
The program will copy all specified files from the disk-dir into the
ram-dir. It will then create in ram-dir a file (.loadram) that specifies the
name of the disk-dir and the time that the copy was completed.
Saveram:
called by: saveram [ram-dir [disk-dir]]
With no arguments, saveram opens the .loadram file in the current directory
(it assumes you are connected to a ram directory in this case) and if it
can't find the .loadram file it complains. If .loadram exists then it
uses the date in that file as the basis for determining whether a file in
the ram-dir has been changed since the loadram was performed. If so it
is written to the disk file specified in the .loadram file. A ram-dir can
be specified as the first argument, and the disk directory in the .loadram
file can be overridden by specifying the required disk directory name as
the second argument.
Saveram has been modified so that if no updates are required then it does
not access the disk at all. (It used to check for the existence of the
disk directory whether or not it was going to use it).
Once saveram has has done the file updates (if any) it changes the date/time
in .loadram to 'now'.
PROBLEMS:
1. When AMIGADOS renames a file it does NOT change the file's
date/time and therefore saveram can't detect that a renamed file has been
changed. This can cause problems if you do a loadram, rename a file, and
then a saveram, since saveram won't save the file under the new name.
SO BE CAREFUL OF RENAMING FILES WHEN USING loadram AND saveram.
2. The same kind of problem applies to a file that is opened, modified and
then closed (but which is not deleted and recreated). The date is not
changed so the saveram program will not see that a change has been made
and so won't save it. This is a real nuisance but I can't work around
it yet.