LDAD System Manager's Manual

Appendix C - LdadUtils.pl

A set of utility routines is available to preprocessor developers writing in Perl. The module is accessed by including
  require "LdadUtils.pl";
in the preprocessor code.

Function Arguments Description
sendNotification hostName (I), portNo (I), msgType (I) Runs sendLDADnotification.pl to send a "data arrival" message. The destination port is passed to the preprocessor from the listener.
dokill none Kills the child process, if it exists.
createMsg msgType (I), msg (R*) Creates a "D"-type (data) message.
moveFile pattern (I) Moves files whose names contain the string <pattern> from $LDAD_DATA/tmp to $LDAD_DATA/Text and $LDAD_DATA/Raw. Sends notification of each file to the LDAD_ROUTER.
LDADcopy tmpFile (I), outFile (I) Copies <tmpFile> to <outFile>.
copyToRaw fileName (I), rawFile (R) Copies file <fileName> to $LDAD_DATA/Raw. Returns the fully-qualified name of the new file.
copyToText fileName (I), textFile (R) Copies file <fileName> to $LDAD_DATA/Text. Returns the fully-qualified name of the new file.
pingLdadRouter textFile (I) Runs sendPing LDAD_ROUTER <textFile> to notify decode/store processes of the file's existence.
formatStdLDAD_DateTime yr (I), mo (I), da (I), hr (I), min (I), sec (I), dateTime (R) Given the time components, creates a string of form YY/MM/DD HH:MM:SS.
generateUTCDateTimeFromFilename filename (I), dateTimeString (R) Given a standard-format LDAD data file name (as it appears in $LDAD_DATA/Raw, including an abstime string), return the corresponding UTC date/time string of form YY/MM/DD HH:MM:SS.
generateLocalUTCDateTimeFromFilename filename (I), dateTimeString (R) Given a standard-format LDAD data file name (as it appears in $LDAD_DATA/Raw, including an abstime string), return the corresponding local date/time string of form YY/MM/DD HH:MM:SS.
getEndString string (I), delimiter (I), subString (R) Returns the set of characters from the input string that follow the last occurrence in the string of the delimiter.
getFilename inString (I), fileName (R) Given a fully-qualified name, extract the filename from the directory path.
getLocalTimeFromString inString (I), dateTime (R) Translate an abstime string into a local date/time string of form YY/MM/DD HH:MM:SS.
getPrefix string (I), file (I), prefix (R) Returns the part of <file> that precedes the search string. This can be used to extract the directory path from a fully-qualified file name.
getUTCTimeFromString inString (I), dateTime (R) Translates an abstime string into a UTC date/time string of form YY/MM/DD HH:MM:SS.
getEndTimeString inString (I), fileTime (R) Extracts the abstime suffix string from a filename.
prependPoundToHeaders IN (I), LDAD_OUT (I), Reads from IN, and writes #-prepended header lines to LDAD_OUT.
putUDFCD_DateTimeIntoStdLDAD_DateTimeFmt ?? (I), dateTime (R) Extracts the date and time from UDFCD (ALERT data supplied by the Denver Urban Drainage and Flood Control District) date/time format and calls formatStdLDAD_DateTime to return a standard date/time string. (It's not known if this would be useful for ALERT data, in general.)

*R refers to the return value of the function


Table of Contents Prev


Last updated: 5 Apr 00 AWIPS 5.0