The bosses here want to get a report of all our texis database sizes. By that, I'm assuming all .tbl and .blb files, although it might be good to include all the index files and their extensions too.
I know it's possible to write shell scripts, perl and/or python scripts to pull this information, but before going down that road I thought I'd ask to see if maybe your API has a getdatabasesize() function I'd missed, or conversely, if you knew a good way to get this info using a vortex script, with maybe a quick pseudocode example and or vortex function listing(s) of interest?
I'd like to keep the queries as Thunderstone-centric as possible and avoid other dependencies, which is why I'd like to do this with vortex or your API. Thanks for the tips.
There's no call to do that directly. You should query SYSTABLES and SYSINDEX to get the filenames then use <stat> to do wildcard expansion and get file sizes to add up.
One thing I'm trying to do is use <stat> with a couple of wildcards. I believe the find command will take multiple -name parameters on the command line, but when I try it with <stat> all I get are matches on the "last" pattern, which makes sense.
<stat> currently only supports one NAME wildcard. You could get multiple-wildcard behavior by removing the NAME and using <rex> inside the <stat> loop.
Problem is, my rex skills are such that I can't figure out a way to return something if the line ends with either tbl or dat or blb. Couldn't help with a tip, could you?
Thanks Mark-- as an aside, do you guys have some good sample scripts with regular expressions that I can go through and use to build up my knowledge? I've looked at the online docs and would like to get my hands on some more.