KEYfile output of example GDSII file
Some links are pointing to the corresponding GDSII records in the HEX dump of the GDSII file.

# KEY file for GDS-II
# File = example.key
# ====================================================================

HEADER 5; # version
BGNLIB;
LASTMOD {98-8-25  15:53:12}; # last modification time
LASTACC {98-8-25  15:53:12}; # last access time
LIBNAME TEMPEGS.DB;
UNITS;
USERUNITS 0.01; PHYSUNITS 1e-08;

BGNSTR; # Begin of structure
CREATION {98-8-25  15:53:12}; # creation time
LASTMOD  {98-8-25  15:53:12}; # last modification time
STRNAME AAP;

BOUNDARY; LAYER 1;  DATATYPE 0;
   XY 5;
   X     -920000.000; Y      452000.000;   X      656500.000; Y      765500.000;
   X      175000.000; Y     -174000.000;   X     -756000.000; Y     -198000.000;
   X     -920000.000; Y      452000.000;
ENDEL;

ENDSTR AAP;

BGNSTR; # Begin of structure
CREATION {98-8-25  15:53:12}; # creation time
LASTMOD  {98-8-25  15:53:12}; # last modification time
STRNAME LAYOUT;

BOUNDARY; LAYER 0;  DATATYPE 0;
   XY 5;
   X    -2032000.000; Y     1410000.000;   X     1427000.000; Y     1666000.000;
   X      502000.000; Y    -1580500.000;   X      502000.000; Y    -1523500.000;
   X    -2032000.000; Y     1410000.000;
ENDEL;

BOX; LAYER 2;  BOXTYPE 0;
   XY 5;
   X     1526500.000; Y    -1034500.000;   X     2623500.000; Y    -1034500.000;
   X     2623500.000; Y     1105500.000;   X     1526500.000; Y     1105500.000;
   X     1526500.000; Y    -1034500.000;
ENDEL;

SREF;
SNAME AAP;
STRANS 0,0,0;
   XY 1;

   X    -1112500.000; Y    -1267000.000;
ENDEL;

PATH; LAYER 3;  DATATYPE 0;WIDTH 100000;
   XY 4;
   X      891912.000; Y     2322024.000;   X      966537.000; Y     1854278.000;
   X     2599515.000; Y     2311647.000;   X     2626485.000; Y     2005353.000;
ENDEL;

TEXT; LAYER 3;
TEXTTYPE 0; PRESENTATION 0,2,0; PATHTYPE 1; STRANS 0,0,0; MAG 1875;
   XY 1;

   X    -2256500.000; Y     1539500.000;
STRING "Boundary";
ENDEL;

TEXT; LAYER 3;
TEXTTYPE 0; PRESENTATION 0,2,0; PATHTYPE 1; STRANS 0,0,0; MAG 1875;
   XY 1;

   X     -151500.000; Y     1924500.000;
STRING "Path";
ENDEL;

TEXT; LAYER 3;
TEXTTYPE 0; PRESENTATION 0,2,0; PATHTYPE 1; STRANS 0,0,0; MAG 1875;
   XY 1;

   X    -1740000.000; Y     -511500.000;
STRING "Sref";
ENDEL;

TEXT; LAYER 3;
TEXTTYPE 0; PRESENTATION 0,2,0; PATHTYPE 1; STRANS 0,0,0; MAG 1875;
   XY 1;

   X     1579000.000; Y     1301500.000;
STRING "Box";
ENDEL;

ENDSTR LAYOUT;
ENDLIB;
 
 
hexdump of example file
0000000  0006 0002 0005 001c 0102 0062 0008 0019
                            header                              bgnlib
0000020  000f 0035 000c 0062 0008 0019 000f 0035
0000040  000c 000e 0206 5445 4d50 4547 532e 4442
                                       libname
0000060  0014 0305 3f28 f5c2 8f5c 28f6 3a2a f31d
                            units
0000100  c461 1874 001c 0502 0062 0008 0019 000f
                                                 bgnlib
0000120  0035 000c 0062 0008 0019 000f 0035 000c
0000140  0008 0606 4141 5000 0004 0800 0006 0d02
                           strname                             boundary       layer
0000160  0001 0006 0e02 0000 002c 1003 fff1 f640
0000200  0006 e5a0 000a 0474 000b ae3c 0002 ab98
0000220  fffd 5850 fff4 76e0 fffc fa90 fff1 f640
0000240  0006 e5a0 0004 1100 0004 0700 001c 0502
                                           endel                             endstr
0000260  0062 0008 0019 000f 0035 000c 0062 0008
0000300  0019 000f 0035 000c 000a 0606 4c41 594f
0000320  5554 0004 0800 0006 0d02 0000 0006 0e02
                                     boundary
0000340  0000 002c 1003 ffe0 fe80 0015 83d0 0015
0000360  c638 0019 6bd0 0007 a8f0 ffe7 e22c 0007
0000400  a8f0 ffe8 c0d4 ffe0 fe80 0015 83d0 0004
0000420  1100 0004 2d00 0006 0d02 0002 0006 2e02
                                     box
0000440  0000 002c 1003 0017 4ae4 fff0 36fc 0028
0000460  080c fff0 36fc 0028 080c 0010 de5c 0017
0000500  4ae4 0010 de5c 0017 4ae4 fff0 36fc 0004
0000520  1100 0004 0a00 0008 1206 4141 5000 000c
                                      sref
0000540  1003 ffef 064c ffec aac8 0004 1100 0004
0000560 0900 0006 0d02 0003 0006 0e02 0000 0008
                  path
0000600  0f03 0001 86a0 0024 1003 000d 9c08 0023
0000620  6e68 000e bf89 001c 4b46 0027 aa5b 0023
0000640  45df 0028 13b5 001e 9969 0004 1100 0004
0000660 0c00 0006 0d02 0003 0006 1602 0000 0006
                    text
0000700  1701 0008 0006 2102 0001 0006 1a01 0000
0000720  000c 1b05 4375 3000 0000 0000 000c 1003
0000740  ffdd 918c 0017 7dac 000c 1906 426f 756e
0000760  6461 7279 0004 1100 0004 0c00 0006 0d02
                                                                   text
0001000  0003 0006 1602 0000 0006 1701 0008 0006
0001020  2102 0001 0006 1a01 0000 000c 1b05 4375
0001040  3000 0000 0000 000c 1003 fffd b034 001d
0001060  5d94 0008 1906 5061 7468 0004 1100 0004
0001100 0c00 0006 0d02 0003 0006 1602 0000 0006
                  text
0001120  1701 0008 0006 2102 0001 0006 1a01 0000
0001140  000c 1b05 4375 3000 0000 0000 000c 1003
0001160  ffe5 7320 fff8 31f4 0008 1906 5372 6566
0001200  0004 1100 0004 0c00 0006 0d02 0003 0006
                                                text
0001220  1602 0000 0006 1701 0008 0006 2102 0001
0001240  0006 1a01 0000 000c 1b05 4375 3000 0000
0001260  0000 000c 1003 0018 17f8 0013 dbfc 0008
0001300  1906 426f 7800 0004 1100 0004 0700 0004
0001320  0400
0001322