[developers] Checking for a profile from lisp?

Stephan Oepen oe at ifi.uio.no
Sat Apr 4 13:00:14 CEST 2009


hi eric,

> I am trying to automate some stuff with LOGON and would like to check
> if a profile exists and if not creates it from an ascii file.
> I know a simple hack would be to check for non-zero length item and
> Relations files, but is there a safer way that checks the integrity of
> the profile as well?

look for the [incr tsdb()] function verify-tsdb-directory(), and use it
as a role model.  tsdb(1) has a mode for profile validation:

  tsdb -verify -quiet -pager=null -home <path>

will exit(3) with a non-zero value for invalid profiles.  looking more
at verify-tsdb-directory(), you will also find that profiles are used
in read-only mode as soon as the `item' relation is compressed.  thus,
i notice, when compressing profiles one should always make sure to run
gzip(1) on all non-empty files (except for `relations'), not just the
bulky ones (i believe some people tend to only compress `result').

                                                  best wishes  -  oe

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++ Universitetet i Oslo (IFI); Boks 1080 Blindern; 0316 Oslo; (+47) 2284 0125
+++     CSLI Stanford; Ventura Hall; Stanford, CA 94305; (+1 650) 723 0515
+++       --- oe at ifi.uio.no; oe at csli.stanford.edu; stephan at oepen.net ---
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



More information about the developers mailing list