Data File structure

A FIP (FingerPost Information Processor) data file typically contains a FIP header at the top of the file, followed by the content of the story. The content is typically text but is considered to be binary data so can be anything: text, images, movies, compressed files, sound files etc.

The FIP header holds Metadata for the file; this includes system (input program, device and port number) and historical information (date/time stamps) that may be used downstream for any future processing.

A FIP header starts with a single tilde (~) character on a line of its own, followed by a new line (octal \012). The tilde character must be flush left with no other characters on the same line.

After the start of header character, the FIP header contains one or more FIP header fields. These fields are two character codes followed by a colon, followed by the value of that header field.

A valid FIP header field starts with an upper case alphabetic character and is followed by another upper case alphabetic or numeric character. The following two character codes are all valid fields AA, AB, AZ, A1 and Z9.

FIP header fields – Example SU:APDS DF:wire The first header field is ‘SU’ (source name) and has a value of ‘APDS’, whilst the second field is ‘DF’ (destination format) and has a value of ‘wire’.

Typically header fields starting with the letter ‘S’ are related to the source information, whilst those beginning with a ‘D’ are defining the destination, the letter ‘H’ are date and time stamps and those beginning with a ‘X’ are FIP internal fields. Check the Fip Header page? for a fuller list.

The list of FIP header fields ends with a second single tilde character on a line of its own and what follows is the text portion of the file.

FIP data file – Example

~
SU:APDS
ST:wire
SF:anpa
SP:192.168.100.1,4011
SC:ascii
DF:wire
ZI:
#HS:wire_4011_2004-7-30_11:32:46_5_211
HD:30
HM:07
HY:2004
HI:Jul
HH:11
HN:32
HB:46
HJ:211
HG:+0400
HW:5
HL:1091201566|3cd004
HF:20040730153246-0400
SH::Sa:N0550:L-----:Pr:Ci:F31:KBC-SchwarzeneggerStamp:V :R :D07-30:W0411
SN:a0550
~
^BC-Schwarzenegger Stamp,0420<
^New Schwarzenegger postage stamp goes on sale in Austria<
^AP Photos VIE105-107<
^By WILLIAM J. KOLE=
^Associated Press Writer=
           VIENNA, Austria (AP) _ Who says the Terminator can't be licked?
           Some 600,000 new postage stamps featuring a likeness of
California Gov. Arnold Schwarzenegger went on sale Friday _ his
57th birthday _ in his native Austria, and the postal service said
it was bracing for heavy demand.

Meaning of the FIP header fields

SU:APDS               - source user or agency name
ST:wire                  - source type or program that received this file
SF:anpa               - source format
SP:192.168.100.1,4011            - input physical device and port number
SC:ascii               - source character set
DF:wire               - destination format file
ZI:                  - file to be archived by ‘ipwheel’
#HS:wire_4011_2004-7-30_11:32:46_5_211   - program, port number, date, time,
- day of week and julian day
HD:30                  - day of month
HM:07                  - month of year
HY:2004               - year
HI:Jul                  - month of year
HH:11                  - hour
HN:32                  - minutes
HB:46                  - seconds
HJ:211                  - julian day
HG:+0400               - offset to return to GMT
HW:5                  - day of week (0=Sunday, 1=Monday etc)
HL:1091201566|3cd004            - Unix time, the number of seconds since 1st Jan
1970, the number of minutes since 1st Jan 1997
(hexadecimal) for Unisys systems
HF:20040730153246-0400         - combined time stamp
SH::Sa:N0550:L-----:Pr:Ci:F31:KBC-SchwarzeneggerStamp:V :R :D07-30:W0411
                  - source header
SN:a0550               - slug name
It is also possible to ‘string’ header fields on the same line. SO for example this snippet of header could be rewritten as:

HD:30
HM:07
HY:2004
HI:Jul
HH:11
HN:32
HB:46
HJ:211

The above eight lines of header could also have been written as:-

HD:30#HM:07#HY:200#HI:Jul#HH:11#HN:32#HB:46#HJ:211

There are a few special header fields that do not have a value. Their existence is enough to instruct a program to perform a specific task. The ZI: header field instructs ‘ipwheel’ to create an archive file in /fip/log/data, or if the archived file already exists, to append it on the end.

A similar process happens if the program ‘ipxchg’ sees the ZX: header field, though this time the file is archived once it has been through the string conversion.

FIP header fields can be found in either the FIP header (i.e. inside the data file) or as part of the filename. A typical FIP filename can look like:-

#SU:PA#SN:HSA6455#HS:wire_1202_2004-8-3_10:30:19_2_215#DU:w4racing_news#DP:localhost#DQ:2w4#DC:-SC#YT:sport
Each header field and its value, is separated by a ‘#’ character.

When new header fields are added to a file, they do not replace an existing value i.e. there may be two or more instances of the same field. Therefore there is a precedence which is:-

  • In the filename, the rightmost field takes precedence.
  • In the FIP header, the bottom most field takes precedence.
  • Fields in the filename takes precedence over those in the [FipHdr][FIP header]].

Links

See also FipHdr? , FipSeq - fip header manipulation,

Notes and Comments

Topic revision: r2 - 17 Mar 2005 - 12:25:49 - DotFingerPost?
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback