index headers
Brian K. White
brian at aljex.com
Fri Jun 18 05:38:24 PDT 2004
Does anyone successfully copy indexes to new systems or new fp trees by only
copying the header and doing a rebuild?
I have an installation that has a lot of qualifiers and a lot of data, and a
lot of development happens in this system.
every now and then I want to "export" a copy of the system but only copy out
the code, menus, formats, etc..
and only one unqualified empty key & data and indexes for each filepro file.
I have that working fine except for the indexes.
Originally, I tried using dd to just grab the first 140 bytes instead of
copying the whole index file.
The indexes were invalid in the new target system so I took a closer look at
this:
http://www.fptech.net/jsp/filepro/developer/technical/auto45.html
And replaced the first two bytes the same way that page describes.
It didn't help.
Copying the whole index file works, but the resulting target data set is 50%
larger than necessary.
here's the commands I run to copy just the header, with the changed magic
number;
for i in `ls index.* 2>/dev/null |cut -d. -f2` ; do
shw i$i
I=index.$i
## version 1 - copy the whole index
cp -f $I ${T}/$I
## version 2 - copy only the first 140 bytes
#dd if=$I of=${T}/$I bs=2 skip=1 seek=1 count=69 >/dev/null 2>&1
## version 3 - create new magic, copy bytes 2-140
#echo "\0301\070\c" >${T}/$I
#dd if=$I of=${T}/$I bs=2 skip=1 seek=1 count=69 >/dev/null 2>&1
done
Neither version 2 or 3 works. They work in so far as they do what I
intended. They don't in that the output is rejected by fp. dxmaint won't
reuild them or display anything other than say index X in invalid.
At the time this block runs, it's inside a loop that has cd'd into a source
filepro file directory and $T is the full path to the matching directory in
the output target tree.
"shw" is just a busy-display function defined near the top so that instead
of a lot of hard coded echo commands, I use the function, and then in the
function I can have it actually show nothing, or a single dot, or the actual
argument that was given, by twiddling on little knob.
I tested the dd command and the preceding echo command and I am getting
exactly the result I was aiming for
Here is a simplified example that shows the commands do what I want them to.
# echo "123456" >t1
# echo "xx\c" >t2
# dd if=t1 of=t2 bs=2 skip=1 seek=1 count=2
2+0 records in
2+0 records out
# cat t2
xx3456#
t1 is like the live, populated, source index
t2 is the new copy, with the first two bytes changed and the rest not
altered or shifted or anything funny.
Setperms is run in the target system after this and it works so I don't
think it's permissions.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
More information about the Filepro-list
mailing list