anchor.diff:  -module(jobpack).
   
  --export([valid/1,
  -         jobfile/1,
  -         exists/1,
  -         extract/2,
  -         extracted/1,
  -         read/1,
  -         save/2,
  -         copy/2,
  -         jobinfo/1]).
  +% Metadata extraction.
  +-export([jobinfo/1, valid/1]).
  +% Jobpack file management.
  +-export([jobfile/1, exists/1, extract/2, extracted/1, read/1, save/2, copy/2]).
   
   -include_lib("kernel/include/file.hrl").
   
  
positive.code: -define(HEADER_SIZE, 128).
  -define(COPY_BUFFER_SIZE, 1048576).
  
  -spec dict({'struct', [{term(), term()}]}) -> dict().
  dict({struct, List}) ->
      dict:from_list(List).
  
  -spec find(binary(), dict()) -> term().
  find(Key, Dict) ->
      case dict:find(Key, Dict) of
          {ok, Field} ->
              Field;
          error ->
              throw({error, disco:format("jobpack missing key '~s'", [Key])})
      end.
  
  -spec find(binary(), dict(), T) -> T.
  find(Key, Dict, Default) ->
      case dict:find(Key, Dict) of
          {ok, Field} ->
              Field;
          error ->
              Default
      end.
  
  -spec jobfile(path()) -> path().
  jobfile(JobHome) ->
  
negative.code:     {MegaSecs, Secs, MicroSecs} = now(),
      filename:join(JobHome, disco:format("jobfile@~.16b:~.16b:~.16b",
                                          [MegaSecs, Secs, MicroSecs])).
  