1 Deprecations

1.1  Introduction

This document lists all deprecated functionality in Erlang/OTP. For more information regarding the strategy regarding deprecations see the documentation of Support, Compatibility, Deprecations, and Removal.

1.2  OTP 23

Crypto Old API

The Old API is now deprecated and has also been scheduled for removal.

For replacement functions see the New API.

http_uri

Since OTP 21 the recommended module to handle URIs is uri_string. The module http_uri does not provide a implementation that satisfies the RFC.

ssh

The public key algorithm 'ssh-rsa is regarded as insecure due to its usage of SHA1, and is therfore deprecated. It will not be available by default from OTP-24.

The public key algorithm 'ssh-dss is regarded as insecure due to its usage of SHA1 and its short key length, and is therfore deprecated. It is not available by default from OTP-23.

pg2

As of OTP 23, a new process group implementation pg is introduced. pg is similar to pg2, but with much better scalability properties. However, the API and behavior are not compatible.

pg2 is now deprecated and has also been scheduled for removal in OTP 24.

Distributed Disk Logs

As of OTP 23, the distributed disk_log feature has been deprecated and it has also been scheduled for removal in OTP 24.

erl_interface registry

As of OTP 23, the registry functionality part of erl_interface has been deprecated and it has also been scheduled for removal in OTP 24.

Functions Deprecated in OTP 23

  • filename:safe_relative_path/1 (use filelib:safe_relative_path/2 instead)
  • http_uri:decode/1 (use uri_string functions instead)
  • http_uri:encode/1 (use uri_string functions instead)
  • http_uri:parse/1 (use uri_string functions instead)
  • http_uri:parse/2 (use uri_string functions instead)
  • http_uri:scheme_defaults/0 (use uri_string functions instead)
  • httpd:parse_query/1 (use uri_string:dissect_query/1 instead)
  • pg2:_/_ (use 'pg' instead)
  • snmpm:async_get/3 (use snmpm:async_get2/3 instead.)
  • snmpm:async_get/4 (use snmpm:async_get2/4 instead.)
  • snmpm:async_get/5 (use snmpm:async_get2/4 instead.)
  • snmpm:async_get/6 (use snmpm:async_get2/4 instead.)
  • snmpm:async_get_bulk/5 (use snmpm:async_get_bulk2/5 instead.)
  • snmpm:async_get_bulk/6 (use snmpm:async_get_bulk2/6 instead.)
  • snmpm:async_get_bulk/7 (use snmpm:async_get_bulk2/6 instead.)
  • snmpm:async_get_bulk/8 (use snmpm:async_get_bulk2/6 instead.)
  • snmpm:async_get_next/3 (use snmpm:async_get_next2/3 instead.)
  • snmpm:async_get_next/4 (use snmpm:async_get_next2/4 instead.)
  • snmpm:async_get_next/5 (use snmpm:async_get_next2/4 instead.)
  • snmpm:async_get_next/6 (use snmpm:async_get_next2/4 instead.)
  • snmpm:async_set/3 (use snmpm:async_set2/3 instead.)
  • snmpm:async_set/4 (use snmpm:async_set2/4 instead.)
  • snmpm:async_set/5 (use snmpm:async_set2/4 instead.)
  • snmpm:async_set/6 (use snmpm:async_set2/4 instead.)
  • snmpm:sync_get/3 (use snmpm:sync_get2/3 instead.)
  • snmpm:sync_get/4 (use snmpm:sync_get2/4 instead.)
  • snmpm:sync_get/5 (use snmpm:sync_get2/4 instead.)
  • snmpm:sync_get/6 (use snmpm:sync_get2/4 instead.)
  • snmpm:sync_get_bulk/5 (use snmpm:sync_get_bulk2/5 instead.)
  • snmpm:sync_get_bulk/6 (use snmpm:sync_get_bulk2/6 instead.)
  • snmpm:sync_get_bulk/7 (use snmpm:sync_get_bulk2/6 instead.)
  • snmpm:sync_get_bulk/8 (use snmpm:sync_get_bulk2/6 instead.)
  • snmpm:sync_get_next/3 (use snmpm:sync_get_next2/3 instead.)
  • snmpm:sync_get_next/4 (use snmpm:sync_get_next2/4 instead.)
  • snmpm:sync_get_next/5 (use snmpm:sync_get_next2/4 instead.)
  • snmpm:sync_get_next/6 (use snmpm:sync_get_next2/4 instead.)
  • snmpm:sync_set/3 (use snmpm:sync_set2/3 instead.)
  • snmpm:sync_set/4 (use snmpm:sync_set2/4 instead.)
  • snmpm:sync_set/5 (use snmpm:sync_set2/4 instead.)
  • snmpm:sync_set/6 (use snmpm:sync_set2/4 instead.)

1.3  OTP 22

VxWorks Support

Some parts of OTP has had limited VxWorks support, such as for example erl_interface. This support is now deprecated and has also been scheduled for removal in OTP 23.

Legacy parts of erl_interface

The old legacy erl_interface library (functions with prefix erl_) is deprecated as of OTP 22. These parts of erl_interface has been informally deprecated for a very long time. You typically want to replace the usage of the erl_interface library with the use of the ei library which also is part of the erl_interface application. The old legacy erl_interface library has also been scheduled for removal in OTP 23.

System Events

The format of "System Events" as defined in the man page for sys has been clarified and cleaned up. Due to this, code that relied on the internal badly documented previous (before this change) format of OTP's "System Events", needs to be changed.

In the wake of this the function sys:get_debug/3 that returns data with undocumented and internal format (and therefore is practically useless) has been deprecated, and a new function sys:get_log/1 has been added, that hopefully does what the deprecated function was intended for.

Functions Deprecated in OTP 22

  • crypto:block_decrypt/3 (use crypto:crypto_one_time/4 or crypto:crypto_init/3 + crypto:crypto_update/2 + crypto:crypto_final/1 instead)
  • crypto:block_decrypt/4 (use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead)
  • crypto:block_encrypt/3 (use crypto:crypto_one_time/4 or crypto:crypto_init/3 + crypto:crypto_update/2 + crypto:crypto_final/1 instead)
  • crypto:block_encrypt/4 (use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead)
  • crypto:cmac/3 (use crypto:mac/4 instead)
  • crypto:cmac/4 (use crypto:macN/5 instead)
  • crypto:hmac/3 (use crypto:mac/4 instead)
  • crypto:hmac/4 (use crypto:macN/5 instead)
  • crypto:hmac_final/1 (use crypto:mac_final/1 instead)
  • crypto:hmac_final_n/2 (use crypto:mac_finalN/2 instead)
  • crypto:hmac_init/2 (use crypto:mac_init/3 instead)
  • crypto:hmac_update/2 (use crypto:mac_update/2 instead)
  • crypto:next_iv/_ (see the 'New and Old API' chapter of the CRYPTO User's guide)
  • crypto:poly1305/2 (use crypto:mac/3 instead)
  • crypto:stream_decrypt/2 (use crypto:crypto_update/2 instead)
  • crypto:stream_encrypt/2 (use crypto:crypto_update/2 instead)
  • crypto:stream_init/_ (use crypto:crypto_init/3 + crypto:crypto_update/2 + crypto:crypto_final/1 or crypto:crypto_one_time/4 instead)
  • net:broadcast/3 (use rpc:eval_everywhere/3 instead)
  • net:call/4 (use rpc:call/4 instead)
  • net:cast/4 (use rpc:cast/4 instead)
  • net:ping/1 (use net_adm:ping/1 instead)
  • net:relay/1 (use slave:relay/1 instead)
  • net:sleep/1 (use 'receive after T -> ok end' instead)
  • sys:get_debug/3 (incorrectly documented and only for internal use. Can often be replaced with sys:get_log/1)

1.4  OTP 21

Functions Deprecated in OTP 21

  • ssl:cipher_suites/0 (use cipher_suites/2,3 instead)
  • ssl:cipher_suites/1 (use cipher_suites/2,3 instead)
  • ssl:ssl_accept/_ (use ssl_handshake/1,2,3 instead)

1.5  OTP 20

Functions Deprecated in OTP 20

  • crypto:rand_uniform/2 (use rand:rand_uniform/1 instead)
  • erlang:get_stacktrace/0 (use the new try/catch syntax for retrieving the stack backtrace)
  • filename:find_src/_ (use filelib:find_source/1,3 instead)
  • gen_fsm:_/_ (use the 'gen_statem' module instead)

1.6  OTP 19

SSL/TLS

For security reasons SSL-3.0 is no longer supported by default, but can be configured.

Functions Deprecated in OTP 19

  • code:rehash/0 (the code path cache feature has been removed)
  • crypto:rand_bytes/1 ()
  • queue:lait/1 (use queue:liat/1 instead)
  • random:_/_ (use the 'rand' module instead)

1.7  OTP 18

erlang:now/0

New time functionality and a new time API was introduced. For more information see the Time and Time Correction chapter in the ERTS User's guide and specifically the Dos and Donts section on how to replace usage of erlang:now/0.

httpd_conf module

API functions in the module httpd_conf was deprecated in favor of standard modules such as lists, string, filelib, and erlang.

Functions Deprecated in OTP 18

  • erlang:now/0 (see the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information)

1.8  OTP 16

Functions Deprecated in OTP 16

  • megaco:format_versions/1 (use megaco:print_version_info/0,1 instead.)
  • snmpa:old_info_format/1 (use "new" format instead)
  • wxCalendarCtrl:enableYearChange/1 (not available in wxWidgets-2.9 and later)
  • wxCalendarCtrl:enableYearChange/2 (not available in wxWidgets-2.9 and later)
  • wxClientDC:new/0 (not available in wxWidgets-2.9 and later)
  • wxCursor:new/3 (not available in wxWidgets-2.9 and later)
  • wxCursor:new/4 (not available in wxWidgets-2.9 and later)
  • wxDC:computeScaleAndOrigin/1 (not available in wxWidgets-2.9 and later)
  • wxGraphicsRenderer:createLinearGradientBrush/7 (not available in wxWidgets-2.9 and later)
  • wxGraphicsRenderer:createRadialGradientBrush/8 (not available in wxWidgets-2.9 and later)
  • wxGridCellEditor:endEdit/4 (not available in wxWidgets-2.9 and later)
  • wxGridCellEditor:paintBackground/3 (not available in wxWidgets-2.9 and later)
  • wxIdleEvent:canSend/1 (not available in wxWidgets-2.9 and later)
  • wxMDIClientWindow:new/1 (not available in wxWidgets-2.9 and later)
  • wxMDIClientWindow:new/2 (not available in wxWidgets-2.9 and later)
  • wxPaintDC:new/0 (not available in wxWidgets-2.9 and later)
  • wxPostScriptDC:getResolution/0 (not available in wxWidgets-2.9 and later)
  • wxPostScriptDC:setResolution/1 (not available in wxWidgets-2.9 and later)
  • wxWindowDC:new/0 (not available in wxWidgets-2.9 and later)

1.9  OTP 12

inets - httpd Apache config files

A new config file format was introduced.

Functions Deprecated in OTP 12

  • auth:cookie/0 (use erlang:get_cookie/0 instead)
  • auth:cookie/1 (use erlang:set_cookie/2 instead)
  • auth:is_auth/1 (use net_adm:ping/1 instead)
  • auth:node_cookie/_ (use erlang:set_cookie/2 and net_adm:ping/1 instead)
  • calendar:local_time_to_universal_time/1 (use calendar:local_time_to_universal_time_dst/1 instead)

1.10  OTP 10

Functions Deprecated in OTP 10

  • snmp:add_agent_caps/2 (use snmpa:add_agent_caps/2 instead.)
  • snmp:c/1 (use snmpa:c/1 instead.)
  • snmp:c/2 (use snmpa:c/2 instead.)
  • snmp:change_log_size/1 (use snmpa:change_log_size/1 instead.)
  • snmp:compile/3 (use snmpa:compile/3 instead.)
  • snmp:current_address/0 (use snmpa:current_address/0 instead.)
  • snmp:current_community/0 (use snmpa:current_community/0 instead.)
  • snmp:current_context/0 (use snmpa:current_context/0 instead.)
  • snmp:current_net_if_data/0 (use snmpa:current_net_if_data/0 instead.)
  • snmp:current_request_id/0 (use snmpa:current_request_id/0 instead.)
  • snmp:del_agent_caps/1 (use snmpa:del_agent_caps/1 instead.)
  • snmp:dump_mibs/0 (use snmpa:dump_mibs/0 instead.)
  • snmp:dump_mibs/1 (use snmpa:dump_mibs/1 instead.)
  • snmp:enum_to_int/2 (use snmpa:enum_to_int/2 instead.)
  • snmp:enum_to_int/3 (use snmpa:enum_to_int/3 instead.)
  • snmp:get/2 (use snmpa:get/2 instead.)
  • snmp:get_agent_caps/0 (use snmpa:get_agent_caps/0 instead.)
  • snmp:get_symbolic_store_db/0 (use snmpa:get_symbolic_store_db/0 instead.)
  • snmp:info/1 (use snmpa:info/1 instead.)
  • snmp:int_to_enum/2 (use snmpa:int_to_enum/2 instead.)
  • snmp:int_to_enum/3 (use snmpa:int_to_enum/3 instead.)
  • snmp:is_consistent/1 (use snmpa:is_consistent/1 instead.)
  • snmp:load_mibs/2 (use snmpa:load_mibs/2 instead.)
  • snmp:log_to_txt/2 (use snmpa:log_to_txt/2 instead.)
  • snmp:log_to_txt/3 (use snmpa:log_to_txt/3 instead.)
  • snmp:log_to_txt/4 (use snmpa:log_to_txt/4 instead.)
  • snmp:mib_to_hrl/1 (use snmpa:mib_to_hrl/1 instead.)
  • snmp:name_to_oid/1 (use snmpa:name_to_oid/1 instead.)
  • snmp:name_to_oid/2 (use snmpa:name_to_oid/2 instead.)
  • snmp:oid_to_name/1 (use snmpa:oid_to_name/1 instead.)
  • snmp:oid_to_name/2 (use snmpa:oid_to_name/2 instead.)
  • snmp:register_subagent/3 (use snmpa:register_subagent/3 instead.)
  • snmp:send_notification/3 (use snmpa:send_notification/3 instead.)
  • snmp:send_notification/4 (use snmpa:send_notification/4 instead.)
  • snmp:send_notification/5 (use snmpa:send_notification/5 instead.)
  • snmp:send_notification/6 (use snmpa:send_notification/6 instead.)
  • snmp:send_trap/3 (use snmpa:send_trap/3 instead.)
  • snmp:send_trap/4 (use snmpa:send_trap/4 instead.)
  • snmp:unload_mibs/2 (use snmpa:unload_mibs/2 instead.)
  • snmp:unregister_subagent/2 (use snmpa:unregister_subagent/2 instead.)