anchor.diff:  %% Include files
   %%----------------------------------------------------------------------
   
  +-include_lib("kernel/include/file.hrl").
   -include_lib("common_test/include/ct.hrl").
   -include("snmp_test_lib.hrl").
   
  
positive.code: %% -----
  %%
  
  init_per_testcase(_Case, Config) when is_list(Config) ->
      Config.
  
  
negative.code: 
  %%======================================================================
  
  %% Since we need something to read, we also write.
  %% And we can just as well that too...
  read(suite) -> [];
  read(Config) when is_list(Config) ->
      ?TC_TRY(read,
              fun() -> ok end,
              fun(_) -> do_read(Config) end,
              fun(_) -> ok end).
  
  do_read(Config) ->
      Dir       = ?config(priv_subdir, Config),
      NumOpenFD = ?config(num_open_fd, Config),
  
      Entries = [
                 snmpa_conf:agent_entry(intAgentIpAddress, {0,0,0,0}),
                 snmpa_conf:agent_entry(intAgentUDPPort, 161),
                 snmpa_conf:agent_entry(snmpEngineMaxMessageSize, 484),
                 snmpa_conf:agent_entry(snmpEngineID, "fooBarEI")
                ],
  
      NumFD01 = NumOpenFD(),
  
      ok = snmpa_conf:write_agent_config(Dir, Entries),
  
      NumFD02 = NumOpenFD(),
  
      {ok, _} = snmpa_conf:read_agent_config(Dir),
  
  
      NumFD03 = NumOpenFD(),
      if
          (NumFD01 =:= NumFD02) andalso (NumFD02 =:= NumFD03) ->
              ok;
          true ->
              ?FAIL({num_open_fd, NumFD01, NumFD02, NumFD03})
      end.
  
  
  
  %% There are other ways to test this:
  %% lsof (linux and maybe FreeBSD):    lsof -p <pid>
  %%    os:cmd("lsof -p " ++ os:getpid() ++ " | grep -v COMMAND | wc -l").
  %% fstat (FreeBSD and maybe OpenBSD): fstat -p <pid>
  %%    os:cmd("fstat -p " ++ os:getpid() ++ " | grep -v USER | wc -l").
  %% But this is good enough...
  num_open_fd_using_list_dir() ->
      case file:list_dir("/proc/" ++ os:getpid() ++ "/fd") of
          {ok, FDs} ->
              length(FDs);
          {error, Reason} ->
              ?SKIP({failed_listing_fd, Reason})
      end.
  
  
  %%======================================================================
  