index headers
Bob Stockler
bob at trebor.iglou.com
Fri Jun 18 08:57:08 PDT 2004
On Fri, Jun 18, 2004 at 08:38:24AM -0400, Brian K. White wrote:
|
| Does anyone successfully copy indexes to new systems or new fp trees by only
| copying the header and doing a rebuild?
I used to use 'dd' to write index headers to INDX.[A-P] files
to be used to rebuild the index.[A-P] files (and later wrote a
filePro processing table to do that), but now, with the filePro
IXSORT() function one can document indexes in the form:
-oA -e -rf 2,15,a:3,15,a
-oB -e -rf 1,4,a
I've written a filePro program that writes this form of output,
and can also use this output to re-index the files. My program
allows this to be done for all or selected filePro files (in its
documation or rebuilding mode). The documentation files are
placed in each filePro file directory.
It also documents indexes in human readable form:
filePro File: fpcust - Indexes Documented - 06/18/2004 @ 11:45:50
Index: A
Sort1 on Field 2 - Len 15 - Asc - last name - uplow
Sort2 on Field 3 - Len 15 - Asc - first name - uplow
Index: B
Sort1 on Field 1 - Len 4 - Asc - customer number - *
I'll email it to you if you want it.
Bob
PS - A simpler way to do what you want might be for you to
simply rebuild all of the indexes in the files to be
transferred (the indexes having been built with data in
the key and data files) after you null out the data in
the key and data files.
| 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
|
| _______________________________________________
| Filepro-list mailing list
| Filepro-list at lists.celestial.com
| http://mailman.celestial.com/mailman/listinfo/filepro-list
--
Bob Stockler - bob at trebor.iglou.com
Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
Fully functional (time-limited) demos available by email request (specify OS).
More information about the Filepro-list
mailing list