--- /srv/rebuilderd/tmp/rebuilderdnQF8cH/inputs/erlang-doc_27.3.4.6+dfsg-1_all.deb +++ /srv/rebuilderd/tmp/rebuilderdnQF8cH/out/erlang-doc_27.3.4.6+dfsg-1_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2025-11-27 12:27:59.000000 debian-binary │ --rw-r--r-- 0 0 0 39780 2025-11-27 12:27:59.000000 control.tar.xz │ --rw-r--r-- 0 0 0 16804484 2025-11-27 12:27:59.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 39792 2025-11-27 12:27:59.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 16804460 2025-11-27 12:27:59.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./control │ │ │ @@ -1,13 +1,13 @@ │ │ │ Package: erlang-doc │ │ │ Source: erlang │ │ │ Version: 1:27.3.4.6+dfsg-1 │ │ │ Architecture: all │ │ │ Maintainer: Debian Erlang Packagers │ │ │ -Installed-Size: 96121 │ │ │ +Installed-Size: 96122 │ │ │ Depends: libjs-jquery, libjs-jquery-ui │ │ │ Suggests: erlang:any │ │ │ Conflicts: erlang-base:any (<< 1:13.b.4), erlang-base-hipe:any, erlang-doc-html │ │ │ Replaces: erlang-doc-html │ │ │ Provides: erlang-doc-html │ │ │ Section: doc │ │ │ Priority: optional │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ │ │ │ ├── line order │ │ │ │ @@ -370,15 +370,15 @@ │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ │ -usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/search_data-7ECECF0A.js │ │ │ │ +usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/search_data-47E11C0C.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/sidebar_items-020EA270.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/event_handler_chapter.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/example_chapter.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/getting_started_chapter.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/index.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/install_chapter.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/introduction.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ │ -usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/search_data-9C801719.js │ │ │ │ +usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/search_data-F7701E90.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/sidebar_items-0B6017A6.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/i.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/index.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/int.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/introduction.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/notes.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/search.html │ │ │ │ @@ -608,15 +608,15 @@ │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ │ -usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/search_data-76AA0443.js │ │ │ │ +usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/search_data-24CC7BE0.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/sidebar_items-4C553487.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/doc_storage.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc_cmd.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc_doclet.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc_doclet_chunks.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc_doclet_markdown.html │ │ │ │ @@ -1093,15 +1093,15 @@ │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ │ -usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/search_data-48CBC29D.js │ │ │ │ +usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/search_data-669DC705.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/sidebar_items-845AA6F8.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/index.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia.epub │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_app_a.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_app_b.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_app_c.html │ │ │ │ @@ -1209,15 +1209,15 @@ │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ │ -usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/search_data-30902A86.js │ │ │ │ +usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/search_data-D20C2403.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/sidebar_items-CB1A13C5.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/index.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/memsup.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/notes.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/nteventlog.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/os_mon.epub │ │ │ │ usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/os_mon_app.html │ │ │ │ @@ -1542,15 +1542,15 @@ │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ │ -usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/search_data-23A43DFC.js │ │ │ │ +usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/search_data-2297B424.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/sidebar_items-132EB75C.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/index.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/notes.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/search.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl.epub │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl_app.html │ │ │ │ @@ -1684,15 +1684,15 @@ │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ │ -usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/search_data-B09DB05B.js │ │ │ │ +usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/search_data-1D7BB8C0.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/sidebar_items-2B4A1108.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/epp_dodger.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_comment_scan.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_prettypr.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_recomment.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_syntax.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_syntax_lib.html │ │ │ │ @@ -1756,15 +1756,15 @@ │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ │ -usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/search_data-6515C1E6.js │ │ │ │ +usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/search_data-074D3797.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/sidebar_items-11035E81.js │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/eprof.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/erlang-el.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/erlang_mode_chapter.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/fprof.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/fprof_chapter.html │ │ │ │ usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/index.html ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -137,15 +137,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 292 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/ssh.html │ │ │ -rw-r--r-- 0 root (0) root (0) 293 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/ssl.html │ │ │ -rw-r--r-- 0 root (0) root (0) 294 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/stdlib.html │ │ │ -rw-r--r-- 0 root (0) root (0) 300 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/syntax_tools.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/ │ │ │ -rw-r--r-- 0 root (0) root (0) 2286 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/.build │ │ │ -rw-r--r-- 0 root (0) root (0) 5648 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/404.html │ │ │ --rw-r--r-- 0 root (0) root (0) 654582 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/Erlang System Documentation.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 654625 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/Erlang System Documentation.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 53542 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/applications.html │ │ │ -rw-r--r-- 0 root (0) root (0) 97489 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/appup_cookbook.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/assets/ │ │ │ -rw-r--r-- 0 root (0) root (0) 7982 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/assets/ballpoint-pen.svg │ │ │ -rw-r--r-- 0 root (0) root (0) 2284 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/assets/dist1.gif │ │ │ -rw-r--r-- 0 root (0) root (0) 5214 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/assets/dist2.gif │ │ │ -rw-r--r-- 0 root (0) root (0) 5007 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/doc/system/assets/dist3.gif │ │ │ @@ -397,15 +397,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 10672 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/api-reference.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/assets/ │ │ │ -rw-r--r-- 0 root (0) root (0) 4963 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/assets/config.gif │ │ │ -rw-r--r-- 0 root (0) root (0) 10726 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/assets/html_logs.gif │ │ │ -rw-r--r-- 0 root (0) root (0) 5837 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/assets/logo.png │ │ │ -rw-r--r-- 0 root (0) root (0) 9561 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/assets/tc_execution.gif │ │ │ -rw-r--r-- 0 root (0) root (0) 21795 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/basics_chapter.html │ │ │ --rw-r--r-- 0 root (0) root (0) 399357 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/common_test.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 399370 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/common_test.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 7502 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/common_test_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 59626 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/config_file_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25541 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/cover_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 182818 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/ct.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12310 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/ct_cover.html │ │ │ -rw-r--r-- 0 root (0) root (0) 30032 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/ct_ftp.html │ │ │ -rw-r--r-- 0 root (0) root (0) 77362 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/ct_hooks.html │ │ │ @@ -438,15 +438,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23236 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ --rw-r--r-- 0 root (0) root (0) 585051 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/search_data-7ECECF0A.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 585051 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/search_data-47E11C0C.js │ │ │ -rw-r--r-- 0 root (0) root (0) 58564 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/dist/sidebar_items-020EA270.js │ │ │ -rw-r--r-- 0 root (0) root (0) 31486 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/event_handler_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 62593 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/example_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 26740 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/getting_started_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 270 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8025 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/install_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8890 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/common_test-1.27.7/doc/html/introduction.html │ │ │ @@ -500,15 +500,15 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/ │ │ │ -rw-r--r-- 0 root (0) root (0) 992 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/.build │ │ │ -rw-r--r-- 0 root (0) root (0) 6016 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/404.html │ │ │ -rw-r--r-- 0 root (0) root (0) 35139 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/algorithm_details.html │ │ │ -rw-r--r-- 0 root (0) root (0) 6670 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/api-reference.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/assets/ │ │ │ -rw-r--r-- 0 root (0) root (0) 5837 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/assets/logo.png │ │ │ --rw-r--r-- 0 root (0) root (0) 127045 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/crypto.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 127034 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/crypto.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 294963 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/crypto.html │ │ │ -rw-r--r-- 0 root (0) root (0) 10018 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/crypto_app.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/dist/ │ │ │ -rw-r--r-- 0 root (0) root (0) 20933 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/dist/handlebars.runtime-CFQAK6SD.js │ │ │ -rw-r--r-- 0 root (0) root (0) 33580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/dist/handlebars.templates-K7URE6B4.js │ │ │ -rw-r--r-- 0 root (0) root (0) 70589 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/dist/html-55NP3CS6.js │ │ │ -rw-r--r-- 0 root (0) root (0) 67213 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/crypto-5.5.3/doc/html/dist/html-erlang-WGRVP7UZ.css │ │ │ @@ -546,15 +546,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 21770 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/assets/cond_break_dialog.jpg │ │ │ -rw-r--r-- 0 root (0) root (0) 13532 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/assets/function_break_dialog.jpg │ │ │ -rw-r--r-- 0 root (0) root (0) 28924 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/assets/interpret.jpg │ │ │ -rw-r--r-- 0 root (0) root (0) 14414 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/assets/line_break_dialog.jpg │ │ │ -rw-r--r-- 0 root (0) root (0) 5837 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/assets/logo.png │ │ │ -rw-r--r-- 0 root (0) root (0) 40742 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/assets/monitor.jpg │ │ │ -rw-r--r-- 0 root (0) root (0) 34504 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/assets/view.jpg │ │ │ --rw-r--r-- 0 root (0) root (0) 219445 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/debugger.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 219446 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/debugger.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 13135 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/debugger.html │ │ │ -rw-r--r-- 0 root (0) root (0) 52048 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/debugger_chapter.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/ │ │ │ -rw-r--r-- 0 root (0) root (0) 20933 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/handlebars.runtime-CFQAK6SD.js │ │ │ -rw-r--r-- 0 root (0) root (0) 33580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/handlebars.templates-K7URE6B4.js │ │ │ -rw-r--r-- 0 root (0) root (0) 70589 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/html-55NP3CS6.js │ │ │ -rw-r--r-- 0 root (0) root (0) 67213 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/html-erlang-WGRVP7UZ.css │ │ │ @@ -567,15 +567,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23236 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ --rw-r--r-- 0 root (0) root (0) 81137 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/search_data-9C801719.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 81137 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/search_data-F7701E90.js │ │ │ -rw-r--r-- 0 root (0) root (0) 9465 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/dist/sidebar_items-0B6017A6.js │ │ │ -rw-r--r-- 0 root (0) root (0) 48190 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/i.html │ │ │ -rw-r--r-- 0 root (0) root (0) 268 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 61669 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/int.html │ │ │ -rw-r--r-- 0 root (0) root (0) 7638 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/introduction.html │ │ │ -rw-r--r-- 0 root (0) root (0) 56037 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5950 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/debugger-5.5.0.1/doc/html/search.html │ │ │ @@ -583,15 +583,15 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/ │ │ │ -rw-r--r-- 0 root (0) root (0) 921 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/.build │ │ │ -rw-r--r-- 0 root (0) root (0) 6028 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/404.html │ │ │ -rw-r--r-- 0 root (0) root (0) 6794 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/api-reference.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/assets/ │ │ │ -rw-r--r-- 0 root (0) root (0) 5837 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/assets/logo.png │ │ │ --rw-r--r-- 0 root (0) root (0) 66385 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dialyzer.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 66388 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dialyzer.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 53654 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dialyzer.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25902 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dialyzer_chapter.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dist/ │ │ │ -rw-r--r-- 0 root (0) root (0) 20933 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dist/handlebars.runtime-CFQAK6SD.js │ │ │ -rw-r--r-- 0 root (0) root (0) 33580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dist/handlebars.templates-K7URE6B4.js │ │ │ -rw-r--r-- 0 root (0) root (0) 70589 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dist/html-55NP3CS6.js │ │ │ -rw-r--r-- 0 root (0) root (0) 67213 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/dialyzer-5.3.1/doc/html/dist/html-erlang-WGRVP7UZ.css │ │ │ @@ -618,15 +618,15 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/ │ │ │ -rw-r--r-- 0 root (0) root (0) 1143 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/.build │ │ │ -rw-r--r-- 0 root (0) root (0) 6034 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/404.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8222 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/api-reference.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/assets/ │ │ │ -rw-r--r-- 0 root (0) root (0) 5837 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/assets/logo.png │ │ │ --rw-r--r-- 0 root (0) root (0) 144222 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 144219 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 253956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 57599 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 29032 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter_codec.html │ │ │ -rw-r--r-- 0 root (0) root (0) 32274 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter_dict.html │ │ │ -rw-r--r-- 0 root (0) root (0) 6784 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter_examples.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9532 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter_intro.html │ │ │ -rw-r--r-- 0 root (0) root (0) 21968 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/diameter-2.4.1.1/doc/html/diameter_make.html │ │ │ @@ -707,15 +707,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23236 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ --rw-r--r-- 0 root (0) root (0) 108335 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/search_data-76AA0443.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 108335 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/search_data-24CC7BE0.js │ │ │ -rw-r--r-- 0 root (0) root (0) 12810 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/dist/sidebar_items-4C553487.js │ │ │ -rw-r--r-- 0 root (0) root (0) 12682 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/doc_storage.html │ │ │ -rw-r--r-- 0 root (0) root (0) 58180 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8098 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc_cmd.html │ │ │ -rw-r--r-- 0 root (0) root (0) 16455 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc_doclet.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8636 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc_doclet_chunks.html │ │ │ -rw-r--r-- 0 root (0) root (0) 10093 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/edoc-1.3.2/doc/html/edoc_doclet_markdown.html │ │ │ @@ -752,15 +752,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 24651 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/dist/search_data-7A421979.js │ │ │ -rw-r--r-- 0 root (0) root (0) 6047 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/dist/sidebar_items-5C2028D5.js │ │ │ --rw-r--r-- 0 root (0) root (0) 33176 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/eldap.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 33180 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/eldap.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 94819 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/eldap.html │ │ │ -rw-r--r-- 0 root (0) root (0) 266 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25611 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5935 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eldap-1.2.14.1/doc/html/search.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/erl_interface-5.5.2/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/erl_interface-5.5.2/doc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/erl_interface-5.5.2/doc/html/ │ │ │ @@ -832,15 +832,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 80722 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/dist/search_data-07FF68FB.js │ │ │ -rw-r--r-- 0 root (0) root (0) 9243 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/dist/sidebar_items-639C3385.js │ │ │ --rw-r--r-- 0 root (0) root (0) 302537 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 302543 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 22899 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et.html │ │ │ -rw-r--r-- 0 root (0) root (0) 57168 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et_collector.html │ │ │ -rw-r--r-- 0 root (0) root (0) 52414 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et_desc.html │ │ │ -rw-r--r-- 0 root (0) root (0) 100534 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et_examples.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9916 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et_intro.html │ │ │ -rw-r--r-- 0 root (0) root (0) 20457 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et_selector.html │ │ │ -rw-r--r-- 0 root (0) root (0) 45778 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/et-1.7.1/doc/html/et_tutorial.html │ │ │ @@ -873,15 +873,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 75635 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/dist/search_data-9EC16955.js │ │ │ -rw-r--r-- 0 root (0) root (0) 3043 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/dist/sidebar_items-3A2D003A.js │ │ │ --rw-r--r-- 0 root (0) root (0) 45179 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/eunit.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 45180 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/eunit.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 13587 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/eunit.html │ │ │ -rw-r--r-- 0 root (0) root (0) 6634 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/eunit_surefire.html │ │ │ -rw-r--r-- 0 root (0) root (0) 263 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 38822 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5926 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/eunit-2.9.1/doc/html/search.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/ │ │ │ @@ -907,15 +907,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 29403 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/dist/search_data-FF6A1601.js │ │ │ -rw-r--r-- 0 root (0) root (0) 5270 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/dist/sidebar_items-B6B07F6E.js │ │ │ --rw-r--r-- 0 root (0) root (0) 33167 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/ftp.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 33166 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/ftp.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 82127 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/ftp.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12856 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/ftp_client.html │ │ │ -rw-r--r-- 0 root (0) root (0) 261 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 7162 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/introduction.html │ │ │ -rw-r--r-- 0 root (0) root (0) 22515 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5914 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ftp-1.2.3/doc/html/search.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/inets-9.3.2.2/ │ │ │ @@ -1138,15 +1138,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 57284 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/global.html │ │ │ -rw-r--r-- 0 root (0) root (0) 37262 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/global_group.html │ │ │ -rw-r--r-- 0 root (0) root (0) 24987 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/heart.html │ │ │ -rw-r--r-- 0 root (0) root (0) 267 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 184609 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/inet.html │ │ │ -rw-r--r-- 0 root (0) root (0) 86882 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/inet_res.html │ │ │ -rw-r--r-- 0 root (0) root (0) 7733 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/introduction_chapter.html │ │ │ --rw-r--r-- 0 root (0) root (0) 791802 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/kernel.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 791829 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/kernel.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 42777 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/kernel_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 188467 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/logger.html │ │ │ -rw-r--r-- 0 root (0) root (0) 108811 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/logger_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 70518 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/logger_cookbook.html │ │ │ -rw-r--r-- 0 root (0) root (0) 15657 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/logger_disk_log_h.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25586 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/logger_filters.html │ │ │ -rw-r--r-- 0 root (0) root (0) 34203 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/kernel-10.2.7.3/doc/html/logger_formatter.html │ │ │ @@ -1198,15 +1198,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 200183 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/dist/search_data-3F59FB08.js │ │ │ -rw-r--r-- 0 root (0) root (0) 33244 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/dist/sidebar_items-0FDD3384.js │ │ │ -rw-r--r-- 0 root (0) root (0) 264 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/index.html │ │ │ --rw-r--r-- 0 root (0) root (0) 181536 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 181548 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 199461 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco.html │ │ │ -rw-r--r-- 0 root (0) root (0) 13680 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco_architecture.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9136 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco_codec_meas.html │ │ │ -rw-r--r-- 0 root (0) root (0) 23098 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco_codec_mstone1.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9740 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco_codec_mstone2.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9712 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco_codec_transform.html │ │ │ -rw-r--r-- 0 root (0) root (0) 18676 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/megaco-4.7.2/doc/html/megaco_debug.html │ │ │ @@ -1250,18 +1250,18 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23236 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ --rw-r--r-- 0 root (0) root (0) 375315 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/search_data-48CBC29D.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 375315 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/search_data-669DC705.js │ │ │ -rw-r--r-- 0 root (0) root (0) 24530 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/dist/sidebar_items-845AA6F8.js │ │ │ -rw-r--r-- 0 root (0) root (0) 265 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/index.html │ │ │ --rw-r--r-- 0 root (0) root (0) 221928 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 221917 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 320920 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia.html │ │ │ -rw-r--r-- 0 root (0) root (0) 45468 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_app_a.html │ │ │ -rw-r--r-- 0 root (0) root (0) 87795 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_app_b.html │ │ │ -rw-r--r-- 0 root (0) root (0) 46060 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_app_c.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9869 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_chap1.html │ │ │ -rw-r--r-- 0 root (0) root (0) 109095 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_chap2.html │ │ │ -rw-r--r-- 0 root (0) root (0) 51394 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/mnesia-4.23.5/doc/html/mnesia_chap3.html │ │ │ @@ -1350,15 +1350,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 76343 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/dist/search_data-D78563F6.js │ │ │ -rw-r--r-- 0 root (0) root (0) 7406 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/dist/sidebar_items-19ECDBA9.js │ │ │ -rw-r--r-- 0 root (0) root (0) 13859 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/error_handling.html │ │ │ -rw-r--r-- 0 root (0) root (0) 51373 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/getting_started.html │ │ │ -rw-r--r-- 0 root (0) root (0) 261 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8466 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/introduction.html │ │ │ -rw-r--r-- 0 root (0) root (0) 57071 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/notes.html │ │ │ --rw-r--r-- 0 root (0) root (0) 67290 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/odbc.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 67288 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/odbc.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 76660 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/odbc.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5917 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/odbc-2.15/doc/html/search.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/ │ │ │ -rw-r--r-- 0 root (0) root (0) 952 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/.build │ │ │ -rw-r--r-- 0 root (0) root (0) 6019 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/404.html │ │ │ @@ -1381,21 +1381,21 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23236 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ --rw-r--r-- 0 root (0) root (0) 69231 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/search_data-30902A86.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 69231 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/search_data-D20C2403.js │ │ │ -rw-r--r-- 0 root (0) root (0) 7923 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/dist/sidebar_items-CB1A13C5.js │ │ │ -rw-r--r-- 0 root (0) root (0) 265 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 31358 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/memsup.html │ │ │ -rw-r--r-- 0 root (0) root (0) 57043 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 14802 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/nteventlog.html │ │ │ --rw-r--r-- 0 root (0) root (0) 50283 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/os_mon.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 50282 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/os_mon.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 9983 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/os_mon_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 22952 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/os_sup.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5935 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/os_mon-2.10.1/doc/html/search.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/parsetools-2.6/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/parsetools-2.6/doc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/parsetools-2.6/doc/html/ │ │ │ -rw-r--r-- 0 root (0) root (0) 890 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/parsetools-2.6/doc/html/.build │ │ │ @@ -1455,15 +1455,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 145165 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/dist/search_data-3C8D465E.js │ │ │ -rw-r--r-- 0 root (0) root (0) 16466 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/dist/sidebar_items-6446AF99.js │ │ │ -rw-r--r-- 0 root (0) root (0) 271 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 90723 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/notes.html │ │ │ --rw-r--r-- 0 root (0) root (0) 100055 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/public_key.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 100052 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/public_key.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 207172 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/public_key.html │ │ │ -rw-r--r-- 0 root (0) root (0) 10281 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/public_key_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 70652 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/public_key_records.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5965 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/search.html │ │ │ -rw-r--r-- 0 root (0) root (0) 131335 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/public_key-1.17.1.1/doc/html/using_public_key.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/ │ │ │ @@ -1491,15 +1491,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 90283 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/dist/search_data-8726EDEC.js │ │ │ -rw-r--r-- 0 root (0) root (0) 8840 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/dist/sidebar_items-DF937488.js │ │ │ -rw-r--r-- 0 root (0) root (0) 265 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 46277 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/notes.html │ │ │ --rw-r--r-- 0 root (0) root (0) 62888 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/reltool.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 62881 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/reltool.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 100619 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/reltool.html │ │ │ -rw-r--r-- 0 root (0) root (0) 199744 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/reltool_examples.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/reltool_intro.html │ │ │ -rw-r--r-- 0 root (0) root (0) 23138 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/reltool_usage.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5938 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/reltool-1.0.1/doc/html/search.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/ │ │ │ @@ -1533,15 +1533,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 9774 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/dtrace.html │ │ │ -rw-r--r-- 0 root (0) root (0) 47868 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/dyntrace.html │ │ │ -rw-r--r-- 0 root (0) root (0) 271 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 50868 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/instrument.html │ │ │ -rw-r--r-- 0 root (0) root (0) 64811 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/lttng.html │ │ │ -rw-r--r-- 0 root (0) root (0) 50067 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/msacc.html │ │ │ -rw-r--r-- 0 root (0) root (0) 78751 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/notes.html │ │ │ --rw-r--r-- 0 root (0) root (0) 118757 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/runtime_tools.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 118746 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/runtime_tools.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 7584 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/runtime_tools_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 29115 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/scheduler.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5974 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/search.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12911 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/system_information.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9992 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/runtime_tools-2.1.1/doc/html/systemtap.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/ │ │ │ @@ -1576,15 +1576,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 34663 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/error_logging.html │ │ │ -rw-r--r-- 0 root (0) root (0) 262 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 70067 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 42546 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/rb.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12220 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/rel.html │ │ │ -rw-r--r-- 0 root (0) root (0) 80519 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/release_handler.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9577 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/relup.html │ │ │ --rw-r--r-- 0 root (0) root (0) 92274 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/sasl.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 92278 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/sasl.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 17193 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/sasl_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 7699 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/sasl_intro.html │ │ │ -rw-r--r-- 0 root (0) root (0) 17269 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/script.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5920 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/search.html │ │ │ -rw-r--r-- 0 root (0) root (0) 40703 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/sasl-4.2.2/doc/html/systools.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/ │ │ │ @@ -1623,15 +1623,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 549455 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/dist/search_data-18B48D27.js │ │ │ -rw-r--r-- 0 root (0) root (0) 90029 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/dist/sidebar_items-E4326166.js │ │ │ -rw-r--r-- 0 root (0) root (0) 263 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 61226 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5923 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/search.html │ │ │ --rw-r--r-- 0 root (0) root (0) 443718 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 443725 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 148375 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp.html │ │ │ -rw-r--r-- 0 root (0) root (0) 39983 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp_advanced_agent.html │ │ │ -rw-r--r-- 0 root (0) root (0) 62881 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp_agent_config_files.html │ │ │ -rw-r--r-- 0 root (0) root (0) 51341 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp_agent_funct_descr.html │ │ │ -rw-r--r-- 0 root (0) root (0) 18123 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp_agent_netif.html │ │ │ -rw-r--r-- 0 root (0) root (0) 66609 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8609 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/snmp-5.18.2/doc/html/snmp_app_a.html │ │ │ @@ -1714,15 +1714,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 368521 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/dist/search_data-D1FC7F0C.js │ │ │ -rw-r--r-- 0 root (0) root (0) 45982 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/dist/sidebar_items-CB7FE887.js │ │ │ -rw-r--r-- 0 root (0) root (0) 23928 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/hardening.html │ │ │ -rw-r--r-- 0 root (0) root (0) 264 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 14206 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/introduction.html │ │ │ -rw-r--r-- 0 root (0) root (0) 232134 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5923 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/search.html │ │ │ --rw-r--r-- 0 root (0) root (0) 272819 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 272817 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 250454 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh.html │ │ │ -rw-r--r-- 0 root (0) root (0) 24859 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh_agent.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25480 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 44362 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh_client_channel.html │ │ │ -rw-r--r-- 0 root (0) root (0) 23335 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh_client_key_api.html │ │ │ -rw-r--r-- 0 root (0) root (0) 78399 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh_connection.html │ │ │ -rw-r--r-- 0 root (0) root (0) 49063 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssh-5.2.11.4/doc/html/ssh_file.html │ │ │ @@ -1754,20 +1754,20 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23236 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ --rw-r--r-- 0 root (0) root (0) 486708 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/search_data-23A43DFC.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 486708 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/search_data-2297B424.js │ │ │ -rw-r--r-- 0 root (0) root (0) 27290 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/dist/sidebar_items-132EB75C.js │ │ │ -rw-r--r-- 0 root (0) root (0) 265 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 255340 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5926 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/search.html │ │ │ --rw-r--r-- 0 root (0) root (0) 210845 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 210849 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 316893 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl.html │ │ │ -rw-r--r-- 0 root (0) root (0) 17362 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12890 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl_crl_cache.html │ │ │ -rw-r--r-- 0 root (0) root (0) 21815 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl_crl_cache_api.html │ │ │ -rw-r--r-- 0 root (0) root (0) 39368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl_distribution.html │ │ │ -rw-r--r-- 0 root (0) root (0) 14213 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl_protocol.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25887 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/ssl-11.2.12.4/doc/html/ssl_session_cache_api.html │ │ │ @@ -1865,15 +1865,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 5938 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/search.html │ │ │ -rw-r--r-- 0 root (0) root (0) 47248 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/sets.html │ │ │ -rw-r--r-- 0 root (0) root (0) 106196 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/shell.html │ │ │ -rw-r--r-- 0 root (0) root (0) 10144 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/shell_default.html │ │ │ -rw-r--r-- 0 root (0) root (0) 49822 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/shell_docs.html │ │ │ -rw-r--r-- 0 root (0) root (0) 33204 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/slave.html │ │ │ -rw-r--r-- 0 root (0) root (0) 354762 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/sofs.html │ │ │ --rw-r--r-- 0 root (0) root (0) 1410505 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/stdlib.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 1410516 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/stdlib.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 15682 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/stdlib_app.html │ │ │ -rw-r--r-- 0 root (0) root (0) 191516 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/string.html │ │ │ -rw-r--r-- 0 root (0) root (0) 93086 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/supervisor.html │ │ │ -rw-r--r-- 0 root (0) root (0) 20623 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/supervisor_bridge.html │ │ │ -rw-r--r-- 0 root (0) root (0) 107262 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/sys.html │ │ │ -rw-r--r-- 0 root (0) root (0) 81680 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/timer.html │ │ │ -rw-r--r-- 0 root (0) root (0) 75028 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/stdlib-6.2.2.2/doc/html/unicode.html │ │ │ @@ -1906,15 +1906,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23236 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ --rw-r--r-- 0 root (0) root (0) 212519 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/search_data-B09DB05B.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 212519 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/search_data-1D7BB8C0.js │ │ │ -rw-r--r-- 0 root (0) root (0) 52682 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/dist/sidebar_items-2B4A1108.js │ │ │ -rw-r--r-- 0 root (0) root (0) 37822 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/epp_dodger.html │ │ │ -rw-r--r-- 0 root (0) root (0) 17453 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_comment_scan.html │ │ │ -rw-r--r-- 0 root (0) root (0) 39814 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_prettypr.html │ │ │ -rw-r--r-- 0 root (0) root (0) 17404 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_recomment.html │ │ │ -rw-r--r-- 0 root (0) root (0) 509513 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_syntax.html │ │ │ -rw-r--r-- 0 root (0) root (0) 112150 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/syntax_tools-3.2.2.2/doc/html/erl_syntax_lib.html │ │ │ @@ -1953,15 +1953,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 22267 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/dist/search_data-BA5DB564.js │ │ │ -rw-r--r-- 0 root (0) root (0) 3043 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/dist/sidebar_items-3CBBBF05.js │ │ │ -rw-r--r-- 0 root (0) root (0) 9543 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/getting_started.html │ │ │ -rw-r--r-- 0 root (0) root (0) 262 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 7929 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/introduction.html │ │ │ -rw-r--r-- 0 root (0) root (0) 14778 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5920 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/search.html │ │ │ --rw-r--r-- 0 root (0) root (0) 28823 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/tftp.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 28825 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/tftp.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 44679 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/tftp.html │ │ │ -rw-r--r-- 0 root (0) root (0) 11777 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tftp-1.2.2/doc/html/tftp_logger.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/ │ │ │ -rw-r--r-- 0 root (0) root (0) 1139 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/.build │ │ │ -rw-r--r-- 0 root (0) root (0) 6010 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/404.html │ │ │ @@ -1988,29 +1988,29 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 23236 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-300-normal-YUMVEFOL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23580 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-400-normal-W7754I4D.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 23040 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-700-normal-2XVSBPG4.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5624 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-ext-300-normal-VPGGJKJL.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5472 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-ext-400-normal-N27NCBWW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 5368 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2 │ │ │ -rw-r--r-- 0 root (0) root (0) 1956 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/remixicon-NKANDIL5.woff2 │ │ │ --rw-r--r-- 0 root (0) root (0) 305159 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/search_data-6515C1E6.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 305159 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/search_data-074D3797.js │ │ │ -rw-r--r-- 0 root (0) root (0) 36457 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/dist/sidebar_items-11035E81.js │ │ │ -rw-r--r-- 0 root (0) root (0) 42782 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/eprof.html │ │ │ -rw-r--r-- 0 root (0) root (0) 28459 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/erlang-el.html │ │ │ -rw-r--r-- 0 root (0) root (0) 18986 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/erlang_mode_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 132045 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/fprof.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12996 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/fprof_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 263 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 67398 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/lcnt.html │ │ │ -rw-r--r-- 0 root (0) root (0) 53417 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/lcnt_chapter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 18424 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/make.html │ │ │ -rw-r--r-- 0 root (0) root (0) 106923 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5926 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/search.html │ │ │ -rw-r--r-- 0 root (0) root (0) 28575 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/tags.html │ │ │ --rw-r--r-- 0 root (0) root (0) 239552 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/tools.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 239539 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/tools.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 173731 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/tprof.html │ │ │ -rw-r--r-- 0 root (0) root (0) 184557 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/xref.html │ │ │ -rw-r--r-- 0 root (0) root (0) 39616 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/tools-4.1.1/doc/html/xref_chapter.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/ │ │ │ -rw-r--r-- 0 root (0) root (0) 1612 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/.build.gz │ │ │ @@ -2040,15 +2040,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 1665163 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/dist/search_data-C8002B3E.js │ │ │ -rw-r--r-- 0 root (0) root (0) 578685 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/dist/sidebar_items-F7AE20D7.js │ │ │ -rw-r--r-- 0 root (0) root (0) 1720405 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/gl.html │ │ │ -rw-r--r-- 0 root (0) root (0) 77348 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/glu.html │ │ │ -rw-r--r-- 0 root (0) root (0) 262 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 59333 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 5914 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/search.html │ │ │ --rw-r--r-- 0 root (0) root (0) 1607644 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wx.epub │ │ │ +-rw-r--r-- 0 root (0) root (0) 1607641 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wx.epub │ │ │ -rw-r--r-- 0 root (0) root (0) 54025 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wx.html │ │ │ -rw-r--r-- 0 root (0) root (0) 19460 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wxAcceleratorEntry.html │ │ │ -rw-r--r-- 0 root (0) root (0) 15138 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wxAcceleratorTable.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12381 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wxActivateEvent.html │ │ │ -rw-r--r-- 0 root (0) root (0) 19135 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wxArtProvider.html │ │ │ -rw-r--r-- 0 root (0) root (0) 17647 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wxAuiDockArt.html │ │ │ -rw-r--r-- 0 root (0) root (0) 63051 2025-11-27 12:27:59.000000 ./usr/share/doc/erlang-doc/html/lib/wx-2.4.3.1/doc/html/wxAuiManager.html │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/Erlang System Documentation.epub │ │ │ ├── zipinfo {} │ │ │ │ @@ -1,93 +1,93 @@ │ │ │ │ -Zip file size: 654582 bytes, number of entries: 91 │ │ │ │ -?rw-r--r-- 6.1 unx 20 bx stor 25-Nov-27 13:07 mimetype │ │ │ │ -?rw-r--r-- 6.1 unx 17922 bx defN 25-Nov-27 13:07 OEBPS/versions.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 4673 bx defN 25-Nov-27 13:07 OEBPS/upgrade.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 53439 bx defN 25-Nov-27 13:07 OEBPS/typespec.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 2166 bx defN 25-Nov-27 13:07 OEBPS/tutorial.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 764 bx defN 25-Nov-27 13:07 OEBPS/title.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 46256 bx defN 25-Nov-27 13:07 OEBPS/tablesdatabases.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 12466 bx defN 25-Nov-27 13:07 OEBPS/system_principles.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 7346 bx defN 25-Nov-27 13:07 OEBPS/system_limits.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 63476 bx defN 25-Nov-27 13:07 OEBPS/sup_princ.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 253918 bx defN 25-Nov-27 13:07 OEBPS/statem.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 111264 bx defN 25-Nov-27 13:07 OEBPS/spec_proc.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 249951 bx defN 25-Nov-27 13:07 OEBPS/seq_prog.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 70943 bx defN 25-Nov-27 13:07 OEBPS/robustness.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 20854 bx defN 25-Nov-27 13:07 OEBPS/release_structure.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 59888 bx defN 25-Nov-27 13:07 OEBPS/release_handling.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 4596 bx defN 25-Nov-27 13:07 OEBPS/reference_manual.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 19455 bx defN 25-Nov-27 13:07 OEBPS/ref_man_records.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 48276 bx defN 25-Nov-27 13:07 OEBPS/ref_man_processes.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 14454 bx defN 25-Nov-27 13:07 OEBPS/ref_man_functions.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 49542 bx defN 25-Nov-27 13:07 OEBPS/records_macros.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 2190 bx defN 25-Nov-27 13:07 OEBPS/readme.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 785 bx defN 25-Nov-27 13:07 OEBPS/programming_examples.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 40147 bx defN 25-Nov-27 13:07 OEBPS/prog_ex_records.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 15206 bx defN 25-Nov-27 13:07 OEBPS/profiling.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 8501 bx defN 25-Nov-27 13:07 OEBPS/ports.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 3737 bx defN 25-Nov-27 13:07 OEBPS/patterns.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 13417 bx defN 25-Nov-27 13:07 OEBPS/overview.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 8959 bx defN 25-Nov-27 13:07 OEBPS/otp-patch-apply.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 9082 bx defN 25-Nov-27 13:07 OEBPS/opaques.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 14065 bx defN 25-Nov-27 13:07 OEBPS/nif.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 6367 bx defN 25-Nov-27 13:07 OEBPS/nav.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 25842 bx defN 25-Nov-27 13:07 OEBPS/modules.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 7012 bx defN 25-Nov-27 13:07 OEBPS/misc.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 5477 bx defN 25-Nov-27 13:07 OEBPS/memory.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 45509 bx defN 25-Nov-27 13:07 OEBPS/maps.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 39594 bx defN 25-Nov-27 13:07 OEBPS/macros.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 31439 bx defN 25-Nov-27 13:07 OEBPS/listhandling.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 42996 bx defN 25-Nov-27 13:07 OEBPS/list_comprehensions.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 2211 bx defN 25-Nov-27 13:07 OEBPS/installation_guide.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 55516 bx defN 25-Nov-27 13:07 OEBPS/install.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 28229 bx defN 25-Nov-27 13:07 OEBPS/install-win32.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 35715 bx defN 25-Nov-27 13:07 OEBPS/install-cross.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 20858 bx defN 25-Nov-27 13:07 OEBPS/included_applications.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 2353 bx defN 25-Nov-27 13:07 OEBPS/getting_started.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 31341 bx defN 25-Nov-27 13:07 OEBPS/gen_server_concepts.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 118675 bx defN 25-Nov-27 13:07 OEBPS/funs.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 8453 bx defN 25-Nov-27 13:07 OEBPS/features.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 255000 bx defN 25-Nov-27 13:07 OEBPS/expressions.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 2365 bx defN 25-Nov-27 13:07 OEBPS/example.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 26747 bx defN 25-Nov-27 13:07 OEBPS/events.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 16629 bx defN 25-Nov-27 13:07 OEBPS/errors.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 13609 bx defN 25-Nov-27 13:07 OEBPS/error_logging.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 42501 bx defN 25-Nov-27 13:07 OEBPS/erl_interface.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 18220 bx defN 25-Nov-27 13:07 OEBPS/embedded.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 2085 bx defN 25-Nov-27 13:07 OEBPS/efficiency_guide.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 46447 bx defN 25-Nov-27 13:07 OEBPS/eff_guide_processes.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 21209 bx defN 25-Nov-27 13:07 OEBPS/eff_guide_functions.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 9338 bx defN 25-Nov-27 13:07 OEBPS/drivers.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 47180 bx defN 25-Nov-27 13:07 OEBPS/documentation.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 14892 bx defN 25-Nov-27 13:07 OEBPS/distributed_applications.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 24284 bx defN 25-Nov-27 13:07 OEBPS/distributed.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 14562 bx defN 25-Nov-27 13:07 OEBPS/dist/epub-erlang-ESPT6BQV.css │ │ │ │ -?rw-r--r-- 6.1 unx 499 bx defN 25-Nov-27 13:07 OEBPS/dist/epub-LSJCIYTM.js │ │ │ │ -?rw-r--r-- 6.1 unx 36780 bx defN 25-Nov-27 13:07 OEBPS/design_principles.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 15003 bx defN 25-Nov-27 13:07 OEBPS/debugging.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 71771 bx defN 25-Nov-27 13:07 OEBPS/data_types.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 115067 bx defN 25-Nov-27 13:07 OEBPS/create_target.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 13187 bx defN 25-Nov-27 13:07 OEBPS/content.opf │ │ │ │ -?rw-r--r-- 6.1 unx 129900 bx defN 25-Nov-27 13:07 OEBPS/conc_prog.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 33231 bx defN 25-Nov-27 13:07 OEBPS/commoncaveats.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 11935 bx defN 25-Nov-27 13:07 OEBPS/code_loading.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 803 bx defN 25-Nov-27 13:07 OEBPS/cnode.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 5177 bx defN 25-Nov-27 13:07 OEBPS/character_set.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 40707 bx defN 25-Nov-27 13:07 OEBPS/c_portdriver.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 35510 bx defN 25-Nov-27 13:07 OEBPS/c_port.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 34819 bx defN 25-Nov-27 13:07 OEBPS/bit_syntax.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 53327 bx defN 25-Nov-27 13:07 OEBPS/binaryhandling.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 7606 bx defN 25-Nov-27 13:07 OEBPS/benchmarking.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 5837 bx defN 25-Nov-27 13:07 OEBPS/assets/logo.png │ │ │ │ -?rw-r--r-- 6.1 unx 5837 bx defN 25-Nov-27 13:07 OEBPS/assets/erlang-logo.png │ │ │ │ -?rw-r--r-- 6.1 unx 7044 bx stor 25-Nov-27 13:07 OEBPS/assets/dist5.gif │ │ │ │ -?rw-r--r-- 6.1 unx 2939 bx stor 25-Nov-27 13:07 OEBPS/assets/dist4.gif │ │ │ │ -?rw-r--r-- 6.1 unx 5007 bx stor 25-Nov-27 13:07 OEBPS/assets/dist3.gif │ │ │ │ -?rw-r--r-- 6.1 unx 5214 bx stor 25-Nov-27 13:07 OEBPS/assets/dist2.gif │ │ │ │ -?rw-r--r-- 6.1 unx 2284 bx stor 25-Nov-27 13:07 OEBPS/assets/dist1.gif │ │ │ │ -?rw-r--r-- 6.1 unx 7982 bx stor 25-Nov-27 13:07 OEBPS/assets/ballpoint-pen.svg │ │ │ │ -?rw-r--r-- 6.1 unx 91721 bx defN 25-Nov-27 13:07 OEBPS/appup_cookbook.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 47722 bx defN 25-Nov-27 13:07 OEBPS/applications.xhtml │ │ │ │ -?rw-r--r-- 6.1 unx 252 bx defN 25-Nov-27 13:07 META-INF/container.xml │ │ │ │ -?rw-r--r-- 6.1 unx 162 bx defN 25-Nov-27 13:07 META-INF/com.apple.ibooks.display-options.xml │ │ │ │ -91 files, 3077736 bytes uncompressed, 638650 bytes compressed: 79.3% │ │ │ │ +Zip file size: 654625 bytes, number of entries: 91 │ │ │ │ +?rw-r--r-- 6.1 unx 20 bx stor 25-Dec-18 10:50 mimetype │ │ │ │ +?rw-r--r-- 6.1 unx 17922 bx defN 25-Dec-18 10:50 OEBPS/versions.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 4673 bx defN 25-Dec-18 10:50 OEBPS/upgrade.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 53439 bx defN 25-Dec-18 10:50 OEBPS/typespec.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 2166 bx defN 25-Dec-18 10:50 OEBPS/tutorial.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 764 bx defN 25-Dec-18 10:50 OEBPS/title.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 46256 bx defN 25-Dec-18 10:50 OEBPS/tablesdatabases.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 12466 bx defN 25-Dec-18 10:50 OEBPS/system_principles.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 7346 bx defN 25-Dec-18 10:50 OEBPS/system_limits.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 63476 bx defN 25-Dec-18 10:50 OEBPS/sup_princ.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 253918 bx defN 25-Dec-18 10:50 OEBPS/statem.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 111264 bx defN 25-Dec-18 10:50 OEBPS/spec_proc.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 249951 bx defN 25-Dec-18 10:50 OEBPS/seq_prog.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 70943 bx defN 25-Dec-18 10:50 OEBPS/robustness.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 20854 bx defN 25-Dec-18 10:50 OEBPS/release_structure.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 59888 bx defN 25-Dec-18 10:50 OEBPS/release_handling.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 4596 bx defN 25-Dec-18 10:50 OEBPS/reference_manual.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 19455 bx defN 25-Dec-18 10:50 OEBPS/ref_man_records.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 48276 bx defN 25-Dec-18 10:50 OEBPS/ref_man_processes.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 14454 bx defN 25-Dec-18 10:50 OEBPS/ref_man_functions.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 49542 bx defN 25-Dec-18 10:50 OEBPS/records_macros.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 2190 bx defN 25-Dec-18 10:50 OEBPS/readme.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 785 bx defN 25-Dec-18 10:50 OEBPS/programming_examples.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 40147 bx defN 25-Dec-18 10:50 OEBPS/prog_ex_records.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 15206 bx defN 25-Dec-18 10:50 OEBPS/profiling.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 8501 bx defN 25-Dec-18 10:50 OEBPS/ports.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 3737 bx defN 25-Dec-18 10:50 OEBPS/patterns.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 13417 bx defN 25-Dec-18 10:50 OEBPS/overview.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 8959 bx defN 25-Dec-18 10:50 OEBPS/otp-patch-apply.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 9082 bx defN 25-Dec-18 10:50 OEBPS/opaques.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 14065 bx defN 25-Dec-18 10:50 OEBPS/nif.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 6367 bx defN 25-Dec-18 10:50 OEBPS/nav.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 25842 bx defN 25-Dec-18 10:50 OEBPS/modules.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 7012 bx defN 25-Dec-18 10:50 OEBPS/misc.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 5477 bx defN 25-Dec-18 10:50 OEBPS/memory.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 45509 bx defN 25-Dec-18 10:50 OEBPS/maps.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 39594 bx defN 25-Dec-18 10:50 OEBPS/macros.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 31439 bx defN 25-Dec-18 10:50 OEBPS/listhandling.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 42996 bx defN 25-Dec-18 10:50 OEBPS/list_comprehensions.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 2211 bx defN 25-Dec-18 10:50 OEBPS/installation_guide.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 55516 bx defN 25-Dec-18 10:50 OEBPS/install.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 28229 bx defN 25-Dec-18 10:50 OEBPS/install-win32.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 35715 bx defN 25-Dec-18 10:50 OEBPS/install-cross.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 20858 bx defN 25-Dec-18 10:50 OEBPS/included_applications.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 2353 bx defN 25-Dec-18 10:50 OEBPS/getting_started.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 31341 bx defN 25-Dec-18 10:50 OEBPS/gen_server_concepts.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 118675 bx defN 25-Dec-18 10:50 OEBPS/funs.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 8453 bx defN 25-Dec-18 10:50 OEBPS/features.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 255000 bx defN 25-Dec-18 10:50 OEBPS/expressions.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 2365 bx defN 25-Dec-18 10:50 OEBPS/example.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 26747 bx defN 25-Dec-18 10:50 OEBPS/events.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 16629 bx defN 25-Dec-18 10:50 OEBPS/errors.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 13609 bx defN 25-Dec-18 10:50 OEBPS/error_logging.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 42501 bx defN 25-Dec-18 10:50 OEBPS/erl_interface.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 18220 bx defN 25-Dec-18 10:50 OEBPS/embedded.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 2085 bx defN 25-Dec-18 10:50 OEBPS/efficiency_guide.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 46447 bx defN 25-Dec-18 10:50 OEBPS/eff_guide_processes.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 21209 bx defN 25-Dec-18 10:50 OEBPS/eff_guide_functions.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 9338 bx defN 25-Dec-18 10:50 OEBPS/drivers.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 47180 bx defN 25-Dec-18 10:50 OEBPS/documentation.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 14892 bx defN 25-Dec-18 10:50 OEBPS/distributed_applications.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 24284 bx defN 25-Dec-18 10:50 OEBPS/distributed.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 14562 bx defN 25-Dec-18 10:50 OEBPS/dist/epub-erlang-ESPT6BQV.css │ │ │ │ +?rw-r--r-- 6.1 unx 499 bx defN 25-Dec-18 10:50 OEBPS/dist/epub-LSJCIYTM.js │ │ │ │ +?rw-r--r-- 6.1 unx 36780 bx defN 25-Dec-18 10:50 OEBPS/design_principles.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 15003 bx defN 25-Dec-18 10:50 OEBPS/debugging.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 71771 bx defN 25-Dec-18 10:50 OEBPS/data_types.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 115067 bx defN 25-Dec-18 10:50 OEBPS/create_target.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 13187 bx defN 25-Dec-18 10:50 OEBPS/content.opf │ │ │ │ +?rw-r--r-- 6.1 unx 129900 bx defN 25-Dec-18 10:50 OEBPS/conc_prog.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 33231 bx defN 25-Dec-18 10:50 OEBPS/commoncaveats.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 11935 bx defN 25-Dec-18 10:50 OEBPS/code_loading.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 803 bx defN 25-Dec-18 10:50 OEBPS/cnode.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 5177 bx defN 25-Dec-18 10:50 OEBPS/character_set.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 40707 bx defN 25-Dec-18 10:50 OEBPS/c_portdriver.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 35510 bx defN 25-Dec-18 10:50 OEBPS/c_port.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 34819 bx defN 25-Dec-18 10:50 OEBPS/bit_syntax.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 53327 bx defN 25-Dec-18 10:50 OEBPS/binaryhandling.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 7606 bx defN 25-Dec-18 10:50 OEBPS/benchmarking.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 5837 bx defN 25-Dec-18 10:50 OEBPS/assets/logo.png │ │ │ │ +?rw-r--r-- 6.1 unx 5837 bx defN 25-Dec-18 10:50 OEBPS/assets/erlang-logo.png │ │ │ │ +?rw-r--r-- 6.1 unx 7044 bx stor 25-Dec-18 10:50 OEBPS/assets/dist5.gif │ │ │ │ +?rw-r--r-- 6.1 unx 2939 bx stor 25-Dec-18 10:50 OEBPS/assets/dist4.gif │ │ │ │ +?rw-r--r-- 6.1 unx 5007 bx stor 25-Dec-18 10:50 OEBPS/assets/dist3.gif │ │ │ │ +?rw-r--r-- 6.1 unx 5214 bx stor 25-Dec-18 10:50 OEBPS/assets/dist2.gif │ │ │ │ +?rw-r--r-- 6.1 unx 2284 bx stor 25-Dec-18 10:50 OEBPS/assets/dist1.gif │ │ │ │ +?rw-r--r-- 6.1 unx 7982 bx stor 25-Dec-18 10:50 OEBPS/assets/ballpoint-pen.svg │ │ │ │ +?rw-r--r-- 6.1 unx 91721 bx defN 25-Dec-18 10:50 OEBPS/appup_cookbook.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 47722 bx defN 25-Dec-18 10:50 OEBPS/applications.xhtml │ │ │ │ +?rw-r--r-- 6.1 unx 252 bx defN 25-Dec-18 10:50 META-INF/container.xml │ │ │ │ +?rw-r--r-- 6.1 unx 162 bx defN 25-Dec-18 10:50 META-INF/com.apple.ibooks.display-options.xml │ │ │ │ +91 files, 3077736 bytes uncompressed, 638693 bytes compressed: 79.3% │ │ │ ├── zipdetails --redact --walk --utc {} │ │ │ │ @@ -1,29 +1,29 @@ │ │ │ │ │ │ │ │ 00000 LOCAL HEADER #1 04034B50 (67324752) │ │ │ │ 00004 Extract Zip Spec 0A (10) '1.0' │ │ │ │ 00005 Extract OS 00 (0) 'MS-DOS' │ │ │ │ 00006 General Purpose Flag 0000 (0) │ │ │ │ 00008 Compression Method 0000 (0) 'Stored' │ │ │ │ -0000A Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ +0000A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ 0000E CRC 2CAB616F (749429103) │ │ │ │ 00012 Compressed Size 00000014 (20) │ │ │ │ 00016 Uncompressed Size 00000014 (20) │ │ │ │ 0001A Filename Length 0008 (8) │ │ │ │ 0001C Extra Length 001C (28) │ │ │ │ 0001E Filename 'XXXXXXXX' │ │ │ │ # │ │ │ │ # WARNING: Offset 0x1E: Filename 'XXXXXXXX' │ │ │ │ # Zero length filename │ │ │ │ # │ │ │ │ 00026 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ 00028 Length 0009 (9) │ │ │ │ 0002A Flags 03 (3) 'Modification Access' │ │ │ │ -0002B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -0002F Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ +0002B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +0002F Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ 00033 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ 00035 Length 000B (11) │ │ │ │ 00037 Version 01 (1) │ │ │ │ 00038 UID Size 04 (4) │ │ │ │ 00039 UID 00000000 (0) │ │ │ │ 0003D GID Size 04 (4) │ │ │ │ 0003E GID 00000000 (0) │ │ │ │ @@ -31,30 +31,30 @@ │ │ │ │ │ │ │ │ 00056 LOCAL HEADER #2 04034B50 (67324752) │ │ │ │ 0005A Extract Zip Spec 14 (20) '2.0' │ │ │ │ 0005B Extract OS 00 (0) 'MS-DOS' │ │ │ │ 0005C General Purpose Flag 0000 (0) │ │ │ │ [Bits 1-2] 0 'Normal Compression' │ │ │ │ 0005E Compression Method 0008 (8) 'Deflated' │ │ │ │ -00060 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ +00060 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ 00064 CRC 9B94E171 (2610225521) │ │ │ │ 00068 Compressed Size 000015AD (5549) │ │ │ │ 0006C Uncompressed Size 00004602 (17922) │ │ │ │ 00070 Filename Length 0014 (20) │ │ │ │ 00072 Extra Length 001C (28) │ │ │ │ 00074 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ # │ │ │ │ # WARNING: Offset 0x74: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ # Zero length filename │ │ │ │ # │ │ │ │ 00088 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ 0008A Length 0009 (9) │ │ │ │ 0008C Flags 03 (3) 'Modification Access' │ │ │ │ -0008D Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -00091 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ +0008D Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +00091 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ 00095 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ 00097 Length 000B (11) │ │ │ │ 00099 Version 01 (1) │ │ │ │ 0009A UID Size 04 (4) │ │ │ │ 0009B UID 00000000 (0) │ │ │ │ 0009F GID Size 04 (4) │ │ │ │ 000A0 GID 00000000 (0) │ │ │ │ @@ -62,30 +62,30 @@ │ │ │ │ │ │ │ │ 01651 LOCAL HEADER #3 04034B50 (67324752) │ │ │ │ 01655 Extract Zip Spec 14 (20) '2.0' │ │ │ │ 01656 Extract OS 00 (0) 'MS-DOS' │ │ │ │ 01657 General Purpose Flag 0000 (0) │ │ │ │ [Bits 1-2] 0 'Normal Compression' │ │ │ │ 01659 Compression Method 0008 (8) 'Deflated' │ │ │ │ -0165B Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ +0165B Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ 0165F CRC E0C122D0 (3770753744) │ │ │ │ 01663 Compressed Size 000006D5 (1749) │ │ │ │ 01667 Uncompressed Size 00001241 (4673) │ │ │ │ 0166B Filename Length 0013 (19) │ │ │ │ 0166D Extra Length 001C (28) │ │ │ │ 0166F Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ # │ │ │ │ # WARNING: Offset 0x166F: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ # Zero length filename │ │ │ │ # │ │ │ │ 01682 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ 01684 Length 0009 (9) │ │ │ │ 01686 Flags 03 (3) 'Modification Access' │ │ │ │ -01687 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -0168B Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ +01687 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +0168B Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ 0168F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ 01691 Length 000B (11) │ │ │ │ 01693 Version 01 (1) │ │ │ │ 01694 UID Size 04 (4) │ │ │ │ 01695 UID 00000000 (0) │ │ │ │ 01699 GID Size 04 (4) │ │ │ │ 0169A GID 00000000 (0) │ │ │ │ @@ -93,6187 +93,6187 @@ │ │ │ │ │ │ │ │ 01D73 LOCAL HEADER #4 04034B50 (67324752) │ │ │ │ 01D77 Extract Zip Spec 14 (20) '2.0' │ │ │ │ 01D78 Extract OS 00 (0) 'MS-DOS' │ │ │ │ 01D79 General Purpose Flag 0000 (0) │ │ │ │ [Bits 1-2] 0 'Normal Compression' │ │ │ │ 01D7B Compression Method 0008 (8) 'Deflated' │ │ │ │ -01D7D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -01D81 CRC 2C95CB71 (748014449) │ │ │ │ -01D85 Compressed Size 00002DA0 (11680) │ │ │ │ +01D7D Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +01D81 CRC D01A9A42 (3491404354) │ │ │ │ +01D85 Compressed Size 00002DA5 (11685) │ │ │ │ 01D89 Uncompressed Size 0000D0BF (53439) │ │ │ │ 01D8D Filename Length 0014 (20) │ │ │ │ 01D8F Extra Length 001C (28) │ │ │ │ 01D91 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ # │ │ │ │ # WARNING: Offset 0x1D91: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ # Zero length filename │ │ │ │ # │ │ │ │ 01DA5 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ 01DA7 Length 0009 (9) │ │ │ │ 01DA9 Flags 03 (3) 'Modification Access' │ │ │ │ -01DAA Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -01DAE Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ +01DAA Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +01DAE Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ 01DB2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ 01DB4 Length 000B (11) │ │ │ │ 01DB6 Version 01 (1) │ │ │ │ 01DB7 UID Size 04 (4) │ │ │ │ 01DB8 UID 00000000 (0) │ │ │ │ 01DBC GID Size 04 (4) │ │ │ │ 01DBD GID 00000000 (0) │ │ │ │ 01DC1 PAYLOAD │ │ │ │ │ │ │ │ -04B61 LOCAL HEADER #5 04034B50 (67324752) │ │ │ │ -04B65 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -04B66 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -04B67 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -04B69 Compression Method 0008 (8) 'Deflated' │ │ │ │ -04B6B Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -04B6F CRC 7D6EEFA5 (2104422309) │ │ │ │ -04B73 Compressed Size 000003F0 (1008) │ │ │ │ -04B77 Uncompressed Size 00000876 (2166) │ │ │ │ -04B7B Filename Length 0014 (20) │ │ │ │ -04B7D Extra Length 001C (28) │ │ │ │ -04B7F Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x4B7F: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -04B93 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -04B95 Length 0009 (9) │ │ │ │ -04B97 Flags 03 (3) 'Modification Access' │ │ │ │ -04B98 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -04B9C Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -04BA0 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -04BA2 Length 000B (11) │ │ │ │ -04BA4 Version 01 (1) │ │ │ │ -04BA5 UID Size 04 (4) │ │ │ │ -04BA6 UID 00000000 (0) │ │ │ │ -04BAA GID Size 04 (4) │ │ │ │ -04BAB GID 00000000 (0) │ │ │ │ -04BAF PAYLOAD │ │ │ │ - │ │ │ │ -04F9F LOCAL HEADER #6 04034B50 (67324752) │ │ │ │ -04FA3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -04FA4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -04FA5 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -04FA7 Compression Method 0008 (8) 'Deflated' │ │ │ │ -04FA9 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -04FAD CRC A7487B91 (2806545297) │ │ │ │ -04FB1 Compressed Size 000001AE (430) │ │ │ │ -04FB5 Uncompressed Size 000002FC (764) │ │ │ │ -04FB9 Filename Length 0011 (17) │ │ │ │ -04FBB Extra Length 001C (28) │ │ │ │ -04FBD Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x4FBD: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -04FCE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -04FD0 Length 0009 (9) │ │ │ │ -04FD2 Flags 03 (3) 'Modification Access' │ │ │ │ -04FD3 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -04FD7 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -04FDB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -04FDD Length 000B (11) │ │ │ │ -04FDF Version 01 (1) │ │ │ │ -04FE0 UID Size 04 (4) │ │ │ │ -04FE1 UID 00000000 (0) │ │ │ │ -04FE5 GID Size 04 (4) │ │ │ │ -04FE6 GID 00000000 (0) │ │ │ │ -04FEA PAYLOAD │ │ │ │ - │ │ │ │ -05198 LOCAL HEADER #7 04034B50 (67324752) │ │ │ │ -0519C Extract Zip Spec 14 (20) '2.0' │ │ │ │ -0519D Extract OS 00 (0) 'MS-DOS' │ │ │ │ -0519E General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -051A0 Compression Method 0008 (8) 'Deflated' │ │ │ │ -051A2 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -051A6 CRC 7F37C7F8 (2134362104) │ │ │ │ -051AA Compressed Size 000020C6 (8390) │ │ │ │ -051AE Uncompressed Size 0000B4B0 (46256) │ │ │ │ -051B2 Filename Length 001B (27) │ │ │ │ -051B4 Extra Length 001C (28) │ │ │ │ -051B6 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x51B6: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -051D1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -051D3 Length 0009 (9) │ │ │ │ -051D5 Flags 03 (3) 'Modification Access' │ │ │ │ -051D6 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -051DA Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -051DE Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -051E0 Length 000B (11) │ │ │ │ -051E2 Version 01 (1) │ │ │ │ -051E3 UID Size 04 (4) │ │ │ │ -051E4 UID 00000000 (0) │ │ │ │ -051E8 GID Size 04 (4) │ │ │ │ -051E9 GID 00000000 (0) │ │ │ │ -051ED PAYLOAD │ │ │ │ - │ │ │ │ -072B3 LOCAL HEADER #8 04034B50 (67324752) │ │ │ │ -072B7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -072B8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -072B9 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -072BB Compression Method 0008 (8) 'Deflated' │ │ │ │ -072BD Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -072C1 CRC C93D1212 (3376222738) │ │ │ │ -072C5 Compressed Size 00000E6F (3695) │ │ │ │ -072C9 Uncompressed Size 000030B2 (12466) │ │ │ │ -072CD Filename Length 001D (29) │ │ │ │ -072CF Extra Length 001C (28) │ │ │ │ -072D1 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x72D1: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -072EE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -072F0 Length 0009 (9) │ │ │ │ -072F2 Flags 03 (3) 'Modification Access' │ │ │ │ -072F3 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -072F7 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -072FB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -072FD Length 000B (11) │ │ │ │ -072FF Version 01 (1) │ │ │ │ -07300 UID Size 04 (4) │ │ │ │ -07301 UID 00000000 (0) │ │ │ │ -07305 GID Size 04 (4) │ │ │ │ -07306 GID 00000000 (0) │ │ │ │ -0730A PAYLOAD │ │ │ │ - │ │ │ │ -08179 LOCAL HEADER #9 04034B50 (67324752) │ │ │ │ -0817D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -0817E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -0817F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -08181 Compression Method 0008 (8) 'Deflated' │ │ │ │ -08183 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -08187 CRC CF0D8E87 (3473772167) │ │ │ │ -0818B Compressed Size 00000972 (2418) │ │ │ │ -0818F Uncompressed Size 00001CB2 (7346) │ │ │ │ -08193 Filename Length 0019 (25) │ │ │ │ -08195 Extra Length 001C (28) │ │ │ │ -08197 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x8197: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -081B0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -081B2 Length 0009 (9) │ │ │ │ -081B4 Flags 03 (3) 'Modification Access' │ │ │ │ -081B5 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -081B9 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -081BD Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -081BF Length 000B (11) │ │ │ │ -081C1 Version 01 (1) │ │ │ │ -081C2 UID Size 04 (4) │ │ │ │ -081C3 UID 00000000 (0) │ │ │ │ -081C7 GID Size 04 (4) │ │ │ │ -081C8 GID 00000000 (0) │ │ │ │ -081CC PAYLOAD │ │ │ │ - │ │ │ │ -08B3E LOCAL HEADER #10 04034B50 (67324752) │ │ │ │ -08B42 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -08B43 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -08B44 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -08B46 Compression Method 0008 (8) 'Deflated' │ │ │ │ -08B48 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -08B4C CRC 16B1376C (380712812) │ │ │ │ -08B50 Compressed Size 00003881 (14465) │ │ │ │ -08B54 Uncompressed Size 0000F7F4 (63476) │ │ │ │ -08B58 Filename Length 0015 (21) │ │ │ │ -08B5A Extra Length 001C (28) │ │ │ │ -08B5C Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x8B5C: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -08B71 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -08B73 Length 0009 (9) │ │ │ │ -08B75 Flags 03 (3) 'Modification Access' │ │ │ │ -08B76 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -08B7A Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -08B7E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -08B80 Length 000B (11) │ │ │ │ -08B82 Version 01 (1) │ │ │ │ -08B83 UID Size 04 (4) │ │ │ │ -08B84 UID 00000000 (0) │ │ │ │ -08B88 GID Size 04 (4) │ │ │ │ -08B89 GID 00000000 (0) │ │ │ │ -08B8D PAYLOAD │ │ │ │ +04B66 LOCAL HEADER #5 04034B50 (67324752) │ │ │ │ +04B6A Extract Zip Spec 14 (20) '2.0' │ │ │ │ +04B6B Extract OS 00 (0) 'MS-DOS' │ │ │ │ +04B6C General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +04B6E Compression Method 0008 (8) 'Deflated' │ │ │ │ +04B70 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +04B74 CRC 7D6EEFA5 (2104422309) │ │ │ │ +04B78 Compressed Size 000003F0 (1008) │ │ │ │ +04B7C Uncompressed Size 00000876 (2166) │ │ │ │ +04B80 Filename Length 0014 (20) │ │ │ │ +04B82 Extra Length 001C (28) │ │ │ │ +04B84 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x4B84: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +04B98 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +04B9A Length 0009 (9) │ │ │ │ +04B9C Flags 03 (3) 'Modification Access' │ │ │ │ +04B9D Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +04BA1 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +04BA5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +04BA7 Length 000B (11) │ │ │ │ +04BA9 Version 01 (1) │ │ │ │ +04BAA UID Size 04 (4) │ │ │ │ +04BAB UID 00000000 (0) │ │ │ │ +04BAF GID Size 04 (4) │ │ │ │ +04BB0 GID 00000000 (0) │ │ │ │ +04BB4 PAYLOAD │ │ │ │ + │ │ │ │ +04FA4 LOCAL HEADER #6 04034B50 (67324752) │ │ │ │ +04FA8 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +04FA9 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +04FAA General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +04FAC Compression Method 0008 (8) 'Deflated' │ │ │ │ +04FAE Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +04FB2 CRC A7487B91 (2806545297) │ │ │ │ +04FB6 Compressed Size 000001AE (430) │ │ │ │ +04FBA Uncompressed Size 000002FC (764) │ │ │ │ +04FBE Filename Length 0011 (17) │ │ │ │ +04FC0 Extra Length 001C (28) │ │ │ │ +04FC2 Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x4FC2: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +04FD3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +04FD5 Length 0009 (9) │ │ │ │ +04FD7 Flags 03 (3) 'Modification Access' │ │ │ │ +04FD8 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +04FDC Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +04FE0 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +04FE2 Length 000B (11) │ │ │ │ +04FE4 Version 01 (1) │ │ │ │ +04FE5 UID Size 04 (4) │ │ │ │ +04FE6 UID 00000000 (0) │ │ │ │ +04FEA GID Size 04 (4) │ │ │ │ +04FEB GID 00000000 (0) │ │ │ │ +04FEF PAYLOAD │ │ │ │ + │ │ │ │ +0519D LOCAL HEADER #7 04034B50 (67324752) │ │ │ │ +051A1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +051A2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +051A3 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +051A5 Compression Method 0008 (8) 'Deflated' │ │ │ │ +051A7 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +051AB CRC 9DFB3381 (2650485633) │ │ │ │ +051AF Compressed Size 000020C4 (8388) │ │ │ │ +051B3 Uncompressed Size 0000B4B0 (46256) │ │ │ │ +051B7 Filename Length 001B (27) │ │ │ │ +051B9 Extra Length 001C (28) │ │ │ │ +051BB Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x51BB: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +051D6 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +051D8 Length 0009 (9) │ │ │ │ +051DA Flags 03 (3) 'Modification Access' │ │ │ │ +051DB Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +051DF Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +051E3 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +051E5 Length 000B (11) │ │ │ │ +051E7 Version 01 (1) │ │ │ │ +051E8 UID Size 04 (4) │ │ │ │ +051E9 UID 00000000 (0) │ │ │ │ +051ED GID Size 04 (4) │ │ │ │ +051EE GID 00000000 (0) │ │ │ │ +051F2 PAYLOAD │ │ │ │ + │ │ │ │ +072B6 LOCAL HEADER #8 04034B50 (67324752) │ │ │ │ +072BA Extract Zip Spec 14 (20) '2.0' │ │ │ │ +072BB Extract OS 00 (0) 'MS-DOS' │ │ │ │ +072BC General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +072BE Compression Method 0008 (8) 'Deflated' │ │ │ │ +072C0 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +072C4 CRC C93D1212 (3376222738) │ │ │ │ +072C8 Compressed Size 00000E6F (3695) │ │ │ │ +072CC Uncompressed Size 000030B2 (12466) │ │ │ │ +072D0 Filename Length 001D (29) │ │ │ │ +072D2 Extra Length 001C (28) │ │ │ │ +072D4 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x72D4: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +072F1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +072F3 Length 0009 (9) │ │ │ │ +072F5 Flags 03 (3) 'Modification Access' │ │ │ │ +072F6 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +072FA Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +072FE Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +07300 Length 000B (11) │ │ │ │ +07302 Version 01 (1) │ │ │ │ +07303 UID Size 04 (4) │ │ │ │ +07304 UID 00000000 (0) │ │ │ │ +07308 GID Size 04 (4) │ │ │ │ +07309 GID 00000000 (0) │ │ │ │ +0730D PAYLOAD │ │ │ │ + │ │ │ │ +0817C LOCAL HEADER #9 04034B50 (67324752) │ │ │ │ +08180 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +08181 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +08182 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +08184 Compression Method 0008 (8) 'Deflated' │ │ │ │ +08186 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +0818A CRC CF0D8E87 (3473772167) │ │ │ │ +0818E Compressed Size 00000972 (2418) │ │ │ │ +08192 Uncompressed Size 00001CB2 (7346) │ │ │ │ +08196 Filename Length 0019 (25) │ │ │ │ +08198 Extra Length 001C (28) │ │ │ │ +0819A Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x819A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +081B3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +081B5 Length 0009 (9) │ │ │ │ +081B7 Flags 03 (3) 'Modification Access' │ │ │ │ +081B8 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +081BC Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +081C0 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +081C2 Length 000B (11) │ │ │ │ +081C4 Version 01 (1) │ │ │ │ +081C5 UID Size 04 (4) │ │ │ │ +081C6 UID 00000000 (0) │ │ │ │ +081CA GID Size 04 (4) │ │ │ │ +081CB GID 00000000 (0) │ │ │ │ +081CF PAYLOAD │ │ │ │ + │ │ │ │ +08B41 LOCAL HEADER #10 04034B50 (67324752) │ │ │ │ +08B45 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +08B46 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +08B47 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +08B49 Compression Method 0008 (8) 'Deflated' │ │ │ │ +08B4B Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +08B4F CRC CCF59E6C (3438648940) │ │ │ │ +08B53 Compressed Size 0000387E (14462) │ │ │ │ +08B57 Uncompressed Size 0000F7F4 (63476) │ │ │ │ +08B5B Filename Length 0015 (21) │ │ │ │ +08B5D Extra Length 001C (28) │ │ │ │ +08B5F Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x8B5F: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +08B74 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +08B76 Length 0009 (9) │ │ │ │ +08B78 Flags 03 (3) 'Modification Access' │ │ │ │ +08B79 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +08B7D Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +08B81 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +08B83 Length 000B (11) │ │ │ │ +08B85 Version 01 (1) │ │ │ │ +08B86 UID Size 04 (4) │ │ │ │ +08B87 UID 00000000 (0) │ │ │ │ +08B8B GID Size 04 (4) │ │ │ │ +08B8C GID 00000000 (0) │ │ │ │ +08B90 PAYLOAD │ │ │ │ │ │ │ │ 0C40E LOCAL HEADER #11 04034B50 (67324752) │ │ │ │ 0C412 Extract Zip Spec 14 (20) '2.0' │ │ │ │ 0C413 Extract OS 00 (0) 'MS-DOS' │ │ │ │ 0C414 General Purpose Flag 0000 (0) │ │ │ │ [Bits 1-2] 0 'Normal Compression' │ │ │ │ 0C416 Compression Method 0008 (8) 'Deflated' │ │ │ │ -0C418 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -0C41C CRC 21E07247 (568357447) │ │ │ │ -0C420 Compressed Size 0000AAD9 (43737) │ │ │ │ +0C418 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +0C41C CRC 0784EB6B (126151531) │ │ │ │ +0C420 Compressed Size 0000AADF (43743) │ │ │ │ 0C424 Uncompressed Size 0003DFDE (253918) │ │ │ │ 0C428 Filename Length 0012 (18) │ │ │ │ 0C42A Extra Length 001C (28) │ │ │ │ 0C42C Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ # │ │ │ │ # WARNING: Offset 0xC42C: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ # Zero length filename │ │ │ │ # │ │ │ │ 0C43E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ 0C440 Length 0009 (9) │ │ │ │ 0C442 Flags 03 (3) 'Modification Access' │ │ │ │ -0C443 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -0C447 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ +0C443 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +0C447 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ 0C44B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ 0C44D Length 000B (11) │ │ │ │ 0C44F Version 01 (1) │ │ │ │ 0C450 UID Size 04 (4) │ │ │ │ 0C451 UID 00000000 (0) │ │ │ │ 0C455 GID Size 04 (4) │ │ │ │ 0C456 GID 00000000 (0) │ │ │ │ 0C45A PAYLOAD │ │ │ │ │ │ │ │ -16F33 LOCAL HEADER #12 04034B50 (67324752) │ │ │ │ -16F37 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -16F38 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -16F39 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -16F3B Compression Method 0008 (8) 'Deflated' │ │ │ │ -16F3D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -16F41 CRC 849BB16F (2224796015) │ │ │ │ -16F45 Compressed Size 00003B1D (15133) │ │ │ │ -16F49 Uncompressed Size 0001B2A0 (111264) │ │ │ │ -16F4D Filename Length 0015 (21) │ │ │ │ -16F4F Extra Length 001C (28) │ │ │ │ -16F51 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x16F51: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -16F66 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -16F68 Length 0009 (9) │ │ │ │ -16F6A Flags 03 (3) 'Modification Access' │ │ │ │ -16F6B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -16F6F Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -16F73 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -16F75 Length 000B (11) │ │ │ │ -16F77 Version 01 (1) │ │ │ │ -16F78 UID Size 04 (4) │ │ │ │ -16F79 UID 00000000 (0) │ │ │ │ -16F7D GID Size 04 (4) │ │ │ │ -16F7E GID 00000000 (0) │ │ │ │ -16F82 PAYLOAD │ │ │ │ - │ │ │ │ -1AA9F LOCAL HEADER #13 04034B50 (67324752) │ │ │ │ -1AAA3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -1AAA4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -1AAA5 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -1AAA7 Compression Method 0008 (8) 'Deflated' │ │ │ │ -1AAA9 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -1AAAD CRC 768242E0 (1988248288) │ │ │ │ -1AAB1 Compressed Size 0000907F (36991) │ │ │ │ -1AAB5 Uncompressed Size 0003D05F (249951) │ │ │ │ -1AAB9 Filename Length 0014 (20) │ │ │ │ -1AABB Extra Length 001C (28) │ │ │ │ -1AABD Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x1AABD: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -1AAD1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -1AAD3 Length 0009 (9) │ │ │ │ -1AAD5 Flags 03 (3) 'Modification Access' │ │ │ │ -1AAD6 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -1AADA Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -1AADE Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -1AAE0 Length 000B (11) │ │ │ │ -1AAE2 Version 01 (1) │ │ │ │ -1AAE3 UID Size 04 (4) │ │ │ │ -1AAE4 UID 00000000 (0) │ │ │ │ -1AAE8 GID Size 04 (4) │ │ │ │ -1AAE9 GID 00000000 (0) │ │ │ │ -1AAED PAYLOAD │ │ │ │ - │ │ │ │ -23B6C LOCAL HEADER #14 04034B50 (67324752) │ │ │ │ -23B70 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -23B71 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -23B72 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -23B74 Compression Method 0008 (8) 'Deflated' │ │ │ │ -23B76 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -23B7A CRC 94869452 (2491847762) │ │ │ │ -23B7E Compressed Size 00002A67 (10855) │ │ │ │ -23B82 Uncompressed Size 0001151F (70943) │ │ │ │ -23B86 Filename Length 0016 (22) │ │ │ │ -23B88 Extra Length 001C (28) │ │ │ │ -23B8A Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x23B8A: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -23BA0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -23BA2 Length 0009 (9) │ │ │ │ -23BA4 Flags 03 (3) 'Modification Access' │ │ │ │ -23BA5 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -23BA9 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -23BAD Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -23BAF Length 000B (11) │ │ │ │ -23BB1 Version 01 (1) │ │ │ │ -23BB2 UID Size 04 (4) │ │ │ │ -23BB3 UID 00000000 (0) │ │ │ │ -23BB7 GID Size 04 (4) │ │ │ │ -23BB8 GID 00000000 (0) │ │ │ │ -23BBC PAYLOAD │ │ │ │ - │ │ │ │ -26623 LOCAL HEADER #15 04034B50 (67324752) │ │ │ │ -26627 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -26628 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -26629 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -2662B Compression Method 0008 (8) 'Deflated' │ │ │ │ -2662D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -26631 CRC CACA090F (3402238223) │ │ │ │ -26635 Compressed Size 000014D7 (5335) │ │ │ │ -26639 Uncompressed Size 00005176 (20854) │ │ │ │ -2663D Filename Length 001D (29) │ │ │ │ -2663F Extra Length 001C (28) │ │ │ │ -26641 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x26641: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -2665E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -26660 Length 0009 (9) │ │ │ │ -26662 Flags 03 (3) 'Modification Access' │ │ │ │ -26663 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -26667 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2666B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -2666D Length 000B (11) │ │ │ │ -2666F Version 01 (1) │ │ │ │ -26670 UID Size 04 (4) │ │ │ │ -26671 UID 00000000 (0) │ │ │ │ -26675 GID Size 04 (4) │ │ │ │ -26676 GID 00000000 (0) │ │ │ │ -2667A PAYLOAD │ │ │ │ - │ │ │ │ -27B51 LOCAL HEADER #16 04034B50 (67324752) │ │ │ │ -27B55 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -27B56 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -27B57 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -27B59 Compression Method 0008 (8) 'Deflated' │ │ │ │ -27B5B Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -27B5F CRC 159F2E8C (362753676) │ │ │ │ -27B63 Compressed Size 000037FA (14330) │ │ │ │ -27B67 Uncompressed Size 0000E9F0 (59888) │ │ │ │ -27B6B Filename Length 001C (28) │ │ │ │ -27B6D Extra Length 001C (28) │ │ │ │ -27B6F Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x27B6F: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -27B8B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -27B8D Length 0009 (9) │ │ │ │ -27B8F Flags 03 (3) 'Modification Access' │ │ │ │ -27B90 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -27B94 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -27B98 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -27B9A Length 000B (11) │ │ │ │ -27B9C Version 01 (1) │ │ │ │ -27B9D UID Size 04 (4) │ │ │ │ -27B9E UID 00000000 (0) │ │ │ │ -27BA2 GID Size 04 (4) │ │ │ │ -27BA3 GID 00000000 (0) │ │ │ │ -27BA7 PAYLOAD │ │ │ │ - │ │ │ │ -2B3A1 LOCAL HEADER #17 04034B50 (67324752) │ │ │ │ -2B3A5 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -2B3A6 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -2B3A7 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -2B3A9 Compression Method 0008 (8) 'Deflated' │ │ │ │ -2B3AB Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -2B3AF CRC AD7122D2 (2909872850) │ │ │ │ -2B3B3 Compressed Size 000006A0 (1696) │ │ │ │ -2B3B7 Uncompressed Size 000011F4 (4596) │ │ │ │ -2B3BB Filename Length 001C (28) │ │ │ │ -2B3BD Extra Length 001C (28) │ │ │ │ -2B3BF Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x2B3BF: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -2B3DB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -2B3DD Length 0009 (9) │ │ │ │ -2B3DF Flags 03 (3) 'Modification Access' │ │ │ │ -2B3E0 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2B3E4 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2B3E8 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -2B3EA Length 000B (11) │ │ │ │ -2B3EC Version 01 (1) │ │ │ │ -2B3ED UID Size 04 (4) │ │ │ │ -2B3EE UID 00000000 (0) │ │ │ │ -2B3F2 GID Size 04 (4) │ │ │ │ -2B3F3 GID 00000000 (0) │ │ │ │ -2B3F7 PAYLOAD │ │ │ │ - │ │ │ │ -2BA97 LOCAL HEADER #18 04034B50 (67324752) │ │ │ │ -2BA9B Extract Zip Spec 14 (20) '2.0' │ │ │ │ -2BA9C Extract OS 00 (0) 'MS-DOS' │ │ │ │ -2BA9D General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -2BA9F Compression Method 0008 (8) 'Deflated' │ │ │ │ -2BAA1 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -2BAA5 CRC ECF17F2B (3975249707) │ │ │ │ -2BAA9 Compressed Size 00001078 (4216) │ │ │ │ -2BAAD Uncompressed Size 00004BFF (19455) │ │ │ │ -2BAB1 Filename Length 001B (27) │ │ │ │ -2BAB3 Extra Length 001C (28) │ │ │ │ -2BAB5 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x2BAB5: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -2BAD0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -2BAD2 Length 0009 (9) │ │ │ │ -2BAD4 Flags 03 (3) 'Modification Access' │ │ │ │ -2BAD5 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2BAD9 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2BADD Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -2BADF Length 000B (11) │ │ │ │ -2BAE1 Version 01 (1) │ │ │ │ -2BAE2 UID Size 04 (4) │ │ │ │ -2BAE3 UID 00000000 (0) │ │ │ │ -2BAE7 GID Size 04 (4) │ │ │ │ -2BAE8 GID 00000000 (0) │ │ │ │ -2BAEC PAYLOAD │ │ │ │ - │ │ │ │ -2CB64 LOCAL HEADER #19 04034B50 (67324752) │ │ │ │ -2CB68 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -2CB69 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -2CB6A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -2CB6C Compression Method 0008 (8) 'Deflated' │ │ │ │ -2CB6E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -2CB72 CRC FE38514B (4265103691) │ │ │ │ -2CB76 Compressed Size 000033AB (13227) │ │ │ │ -2CB7A Uncompressed Size 0000BC94 (48276) │ │ │ │ -2CB7E Filename Length 001D (29) │ │ │ │ -2CB80 Extra Length 001C (28) │ │ │ │ -2CB82 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x2CB82: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -2CB9F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -2CBA1 Length 0009 (9) │ │ │ │ -2CBA3 Flags 03 (3) 'Modification Access' │ │ │ │ -2CBA4 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2CBA8 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2CBAC Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -2CBAE Length 000B (11) │ │ │ │ -2CBB0 Version 01 (1) │ │ │ │ -2CBB1 UID Size 04 (4) │ │ │ │ -2CBB2 UID 00000000 (0) │ │ │ │ -2CBB6 GID Size 04 (4) │ │ │ │ -2CBB7 GID 00000000 (0) │ │ │ │ -2CBBB PAYLOAD │ │ │ │ - │ │ │ │ -2FF66 LOCAL HEADER #20 04034B50 (67324752) │ │ │ │ -2FF6A Extract Zip Spec 14 (20) '2.0' │ │ │ │ -2FF6B Extract OS 00 (0) 'MS-DOS' │ │ │ │ -2FF6C General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -2FF6E Compression Method 0008 (8) 'Deflated' │ │ │ │ -2FF70 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -2FF74 CRC 2D94E8CD (764733645) │ │ │ │ -2FF78 Compressed Size 00000D6B (3435) │ │ │ │ -2FF7C Uncompressed Size 00003876 (14454) │ │ │ │ -2FF80 Filename Length 001D (29) │ │ │ │ -2FF82 Extra Length 001C (28) │ │ │ │ -2FF84 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x2FF84: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -2FFA1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -2FFA3 Length 0009 (9) │ │ │ │ -2FFA5 Flags 03 (3) 'Modification Access' │ │ │ │ -2FFA6 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2FFAA Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -2FFAE Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -2FFB0 Length 000B (11) │ │ │ │ -2FFB2 Version 01 (1) │ │ │ │ -2FFB3 UID Size 04 (4) │ │ │ │ -2FFB4 UID 00000000 (0) │ │ │ │ -2FFB8 GID Size 04 (4) │ │ │ │ -2FFB9 GID 00000000 (0) │ │ │ │ -2FFBD PAYLOAD │ │ │ │ - │ │ │ │ -30D28 LOCAL HEADER #21 04034B50 (67324752) │ │ │ │ -30D2C Extract Zip Spec 14 (20) '2.0' │ │ │ │ -30D2D Extract OS 00 (0) 'MS-DOS' │ │ │ │ -30D2E General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -30D30 Compression Method 0008 (8) 'Deflated' │ │ │ │ -30D32 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -30D36 CRC 5E8395EE (1585681902) │ │ │ │ -30D3A Compressed Size 00001C6A (7274) │ │ │ │ -30D3E Uncompressed Size 0000C186 (49542) │ │ │ │ -30D42 Filename Length 001A (26) │ │ │ │ -30D44 Extra Length 001C (28) │ │ │ │ -30D46 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x30D46: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -30D60 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -30D62 Length 0009 (9) │ │ │ │ -30D64 Flags 03 (3) 'Modification Access' │ │ │ │ -30D65 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -30D69 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -30D6D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -30D6F Length 000B (11) │ │ │ │ -30D71 Version 01 (1) │ │ │ │ -30D72 UID Size 04 (4) │ │ │ │ -30D73 UID 00000000 (0) │ │ │ │ -30D77 GID Size 04 (4) │ │ │ │ -30D78 GID 00000000 (0) │ │ │ │ -30D7C PAYLOAD │ │ │ │ - │ │ │ │ -329E6 LOCAL HEADER #22 04034B50 (67324752) │ │ │ │ -329EA Extract Zip Spec 14 (20) '2.0' │ │ │ │ -329EB Extract OS 00 (0) 'MS-DOS' │ │ │ │ -329EC General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -329EE Compression Method 0008 (8) 'Deflated' │ │ │ │ -329F0 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -329F4 CRC 955F044A (2506032202) │ │ │ │ -329F8 Compressed Size 000003A3 (931) │ │ │ │ -329FC Uncompressed Size 0000088E (2190) │ │ │ │ -32A00 Filename Length 0012 (18) │ │ │ │ -32A02 Extra Length 001C (28) │ │ │ │ -32A04 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x32A04: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -32A16 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -32A18 Length 0009 (9) │ │ │ │ -32A1A Flags 03 (3) 'Modification Access' │ │ │ │ -32A1B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -32A1F Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -32A23 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -32A25 Length 000B (11) │ │ │ │ -32A27 Version 01 (1) │ │ │ │ -32A28 UID Size 04 (4) │ │ │ │ -32A29 UID 00000000 (0) │ │ │ │ -32A2D GID Size 04 (4) │ │ │ │ -32A2E GID 00000000 (0) │ │ │ │ -32A32 PAYLOAD │ │ │ │ - │ │ │ │ -32DD5 LOCAL HEADER #23 04034B50 (67324752) │ │ │ │ -32DD9 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -32DDA Extract OS 00 (0) 'MS-DOS' │ │ │ │ -32DDB General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -32DDD Compression Method 0008 (8) 'Deflated' │ │ │ │ -32DDF Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -32DE3 CRC C065C5F8 (3227895288) │ │ │ │ -32DE7 Compressed Size 000001D4 (468) │ │ │ │ -32DEB Uncompressed Size 00000311 (785) │ │ │ │ -32DEF Filename Length 0020 (32) │ │ │ │ -32DF1 Extra Length 001C (28) │ │ │ │ -32DF3 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x32DF3: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -32E13 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -32E15 Length 0009 (9) │ │ │ │ -32E17 Flags 03 (3) 'Modification Access' │ │ │ │ -32E18 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -32E1C Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -32E20 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -32E22 Length 000B (11) │ │ │ │ -32E24 Version 01 (1) │ │ │ │ -32E25 UID Size 04 (4) │ │ │ │ -32E26 UID 00000000 (0) │ │ │ │ -32E2A GID Size 04 (4) │ │ │ │ -32E2B GID 00000000 (0) │ │ │ │ -32E2F PAYLOAD │ │ │ │ - │ │ │ │ -33003 LOCAL HEADER #24 04034B50 (67324752) │ │ │ │ -33007 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -33008 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -33009 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -3300B Compression Method 0008 (8) 'Deflated' │ │ │ │ -3300D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -33011 CRC 47533CA6 (1196637350) │ │ │ │ -33015 Compressed Size 000017A6 (6054) │ │ │ │ -33019 Uncompressed Size 00009CD3 (40147) │ │ │ │ -3301D Filename Length 001B (27) │ │ │ │ -3301F Extra Length 001C (28) │ │ │ │ -33021 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x33021: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -3303C Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -3303E Length 0009 (9) │ │ │ │ -33040 Flags 03 (3) 'Modification Access' │ │ │ │ -33041 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -33045 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -33049 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -3304B Length 000B (11) │ │ │ │ -3304D Version 01 (1) │ │ │ │ -3304E UID Size 04 (4) │ │ │ │ -3304F UID 00000000 (0) │ │ │ │ -33053 GID Size 04 (4) │ │ │ │ -33054 GID 00000000 (0) │ │ │ │ -33058 PAYLOAD │ │ │ │ - │ │ │ │ -347FE LOCAL HEADER #25 04034B50 (67324752) │ │ │ │ -34802 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -34803 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -34804 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -34806 Compression Method 0008 (8) 'Deflated' │ │ │ │ -34808 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -3480C CRC 3C74E841 (1014294593) │ │ │ │ -34810 Compressed Size 00001371 (4977) │ │ │ │ -34814 Uncompressed Size 00003B66 (15206) │ │ │ │ -34818 Filename Length 0015 (21) │ │ │ │ -3481A Extra Length 001C (28) │ │ │ │ -3481C Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x3481C: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -34831 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -34833 Length 0009 (9) │ │ │ │ -34835 Flags 03 (3) 'Modification Access' │ │ │ │ -34836 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3483A Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3483E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -34840 Length 000B (11) │ │ │ │ -34842 Version 01 (1) │ │ │ │ -34843 UID Size 04 (4) │ │ │ │ -34844 UID 00000000 (0) │ │ │ │ -34848 GID Size 04 (4) │ │ │ │ -34849 GID 00000000 (0) │ │ │ │ -3484D PAYLOAD │ │ │ │ - │ │ │ │ -35BBE LOCAL HEADER #26 04034B50 (67324752) │ │ │ │ -35BC2 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -35BC3 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -35BC4 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -35BC6 Compression Method 0008 (8) 'Deflated' │ │ │ │ -35BC8 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -35BCC CRC FF345113 (4281618707) │ │ │ │ -35BD0 Compressed Size 00000AD0 (2768) │ │ │ │ -35BD4 Uncompressed Size 00002135 (8501) │ │ │ │ -35BD8 Filename Length 0011 (17) │ │ │ │ -35BDA Extra Length 001C (28) │ │ │ │ -35BDC Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x35BDC: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -35BED Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -35BEF Length 0009 (9) │ │ │ │ -35BF1 Flags 03 (3) 'Modification Access' │ │ │ │ -35BF2 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -35BF6 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -35BFA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -35BFC Length 000B (11) │ │ │ │ -35BFE Version 01 (1) │ │ │ │ -35BFF UID Size 04 (4) │ │ │ │ -35C00 UID 00000000 (0) │ │ │ │ -35C04 GID Size 04 (4) │ │ │ │ -35C05 GID 00000000 (0) │ │ │ │ -35C09 PAYLOAD │ │ │ │ - │ │ │ │ -366D9 LOCAL HEADER #27 04034B50 (67324752) │ │ │ │ -366DD Extract Zip Spec 14 (20) '2.0' │ │ │ │ -366DE Extract OS 00 (0) 'MS-DOS' │ │ │ │ -366DF General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -366E1 Compression Method 0008 (8) 'Deflated' │ │ │ │ -366E3 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -366E7 CRC C6078855 (3322382421) │ │ │ │ -366EB Compressed Size 000003FE (1022) │ │ │ │ -366EF Uncompressed Size 00000E99 (3737) │ │ │ │ -366F3 Filename Length 0014 (20) │ │ │ │ -366F5 Extra Length 001C (28) │ │ │ │ -366F7 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x366F7: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -3670B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -3670D Length 0009 (9) │ │ │ │ -3670F Flags 03 (3) 'Modification Access' │ │ │ │ -36710 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -36714 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -36718 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -3671A Length 000B (11) │ │ │ │ -3671C Version 01 (1) │ │ │ │ -3671D UID Size 04 (4) │ │ │ │ -3671E UID 00000000 (0) │ │ │ │ -36722 GID Size 04 (4) │ │ │ │ -36723 GID 00000000 (0) │ │ │ │ -36727 PAYLOAD │ │ │ │ - │ │ │ │ -36B25 LOCAL HEADER #28 04034B50 (67324752) │ │ │ │ -36B29 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -36B2A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -36B2B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -36B2D Compression Method 0008 (8) 'Deflated' │ │ │ │ -36B2F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -36B33 CRC 858C8599 (2240578969) │ │ │ │ -36B37 Compressed Size 00001262 (4706) │ │ │ │ -36B3B Uncompressed Size 00003469 (13417) │ │ │ │ -36B3F Filename Length 0014 (20) │ │ │ │ -36B41 Extra Length 001C (28) │ │ │ │ -36B43 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x36B43: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -36B57 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -36B59 Length 0009 (9) │ │ │ │ -36B5B Flags 03 (3) 'Modification Access' │ │ │ │ -36B5C Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -36B60 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -36B64 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -36B66 Length 000B (11) │ │ │ │ -36B68 Version 01 (1) │ │ │ │ -36B69 UID Size 04 (4) │ │ │ │ -36B6A UID 00000000 (0) │ │ │ │ -36B6E GID Size 04 (4) │ │ │ │ -36B6F GID 00000000 (0) │ │ │ │ -36B73 PAYLOAD │ │ │ │ - │ │ │ │ -37DD5 LOCAL HEADER #29 04034B50 (67324752) │ │ │ │ -37DD9 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -37DDA Extract OS 00 (0) 'MS-DOS' │ │ │ │ -37DDB General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -37DDD Compression Method 0008 (8) 'Deflated' │ │ │ │ -37DDF Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -37DE3 CRC 16805862 (377509986) │ │ │ │ -37DE7 Compressed Size 00000ACE (2766) │ │ │ │ -37DEB Uncompressed Size 000022FF (8959) │ │ │ │ -37DEF Filename Length 001B (27) │ │ │ │ -37DF1 Extra Length 001C (28) │ │ │ │ -37DF3 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x37DF3: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -37E0E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -37E10 Length 0009 (9) │ │ │ │ -37E12 Flags 03 (3) 'Modification Access' │ │ │ │ -37E13 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -37E17 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -37E1B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -37E1D Length 000B (11) │ │ │ │ -37E1F Version 01 (1) │ │ │ │ -37E20 UID Size 04 (4) │ │ │ │ -37E21 UID 00000000 (0) │ │ │ │ -37E25 GID Size 04 (4) │ │ │ │ -37E26 GID 00000000 (0) │ │ │ │ -37E2A PAYLOAD │ │ │ │ - │ │ │ │ -388F8 LOCAL HEADER #30 04034B50 (67324752) │ │ │ │ -388FC Extract Zip Spec 14 (20) '2.0' │ │ │ │ -388FD Extract OS 00 (0) 'MS-DOS' │ │ │ │ -388FE General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -38900 Compression Method 0008 (8) 'Deflated' │ │ │ │ -38902 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -38906 CRC E197FA52 (3784833618) │ │ │ │ -3890A Compressed Size 00000A8D (2701) │ │ │ │ -3890E Uncompressed Size 0000237A (9082) │ │ │ │ -38912 Filename Length 0013 (19) │ │ │ │ -38914 Extra Length 001C (28) │ │ │ │ -38916 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x38916: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -38929 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -3892B Length 0009 (9) │ │ │ │ -3892D Flags 03 (3) 'Modification Access' │ │ │ │ -3892E Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -38932 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -38936 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -38938 Length 000B (11) │ │ │ │ -3893A Version 01 (1) │ │ │ │ -3893B UID Size 04 (4) │ │ │ │ -3893C UID 00000000 (0) │ │ │ │ -38940 GID Size 04 (4) │ │ │ │ -38941 GID 00000000 (0) │ │ │ │ -38945 PAYLOAD │ │ │ │ - │ │ │ │ -393D2 LOCAL HEADER #31 04034B50 (67324752) │ │ │ │ -393D6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -393D7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -393D8 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -393DA Compression Method 0008 (8) 'Deflated' │ │ │ │ -393DC Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -393E0 CRC 11E96F5C (300511068) │ │ │ │ -393E4 Compressed Size 00000F47 (3911) │ │ │ │ -393E8 Uncompressed Size 000036F1 (14065) │ │ │ │ -393EC Filename Length 000F (15) │ │ │ │ -393EE Extra Length 001C (28) │ │ │ │ -393F0 Filename 'XXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x393F0: Filename 'XXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -393FF Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -39401 Length 0009 (9) │ │ │ │ -39403 Flags 03 (3) 'Modification Access' │ │ │ │ -39404 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -39408 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3940C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -3940E Length 000B (11) │ │ │ │ -39410 Version 01 (1) │ │ │ │ -39411 UID Size 04 (4) │ │ │ │ -39412 UID 00000000 (0) │ │ │ │ -39416 GID Size 04 (4) │ │ │ │ -39417 GID 00000000 (0) │ │ │ │ -3941B PAYLOAD │ │ │ │ - │ │ │ │ -3A362 LOCAL HEADER #32 04034B50 (67324752) │ │ │ │ -3A366 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -3A367 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -3A368 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -3A36A Compression Method 0008 (8) 'Deflated' │ │ │ │ -3A36C Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -3A370 CRC 0DF8D9F7 (234412535) │ │ │ │ -3A374 Compressed Size 0000066A (1642) │ │ │ │ -3A378 Uncompressed Size 000018DF (6367) │ │ │ │ -3A37C Filename Length 000F (15) │ │ │ │ -3A37E Extra Length 001C (28) │ │ │ │ -3A380 Filename 'XXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x3A380: Filename 'XXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -3A38F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -3A391 Length 0009 (9) │ │ │ │ -3A393 Flags 03 (3) 'Modification Access' │ │ │ │ -3A394 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3A398 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3A39C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -3A39E Length 000B (11) │ │ │ │ -3A3A0 Version 01 (1) │ │ │ │ -3A3A1 UID Size 04 (4) │ │ │ │ -3A3A2 UID 00000000 (0) │ │ │ │ -3A3A6 GID Size 04 (4) │ │ │ │ -3A3A7 GID 00000000 (0) │ │ │ │ -3A3AB PAYLOAD │ │ │ │ - │ │ │ │ -3AA15 LOCAL HEADER #33 04034B50 (67324752) │ │ │ │ -3AA19 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -3AA1A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -3AA1B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -3AA1D Compression Method 0008 (8) 'Deflated' │ │ │ │ -3AA1F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -3AA23 CRC 75D1DDD3 (1976688083) │ │ │ │ -3AA27 Compressed Size 00001A4A (6730) │ │ │ │ -3AA2B Uncompressed Size 000064F2 (25842) │ │ │ │ -3AA2F Filename Length 0013 (19) │ │ │ │ -3AA31 Extra Length 001C (28) │ │ │ │ -3AA33 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x3AA33: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -3AA46 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -3AA48 Length 0009 (9) │ │ │ │ -3AA4A Flags 03 (3) 'Modification Access' │ │ │ │ -3AA4B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3AA4F Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3AA53 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -3AA55 Length 000B (11) │ │ │ │ -3AA57 Version 01 (1) │ │ │ │ -3AA58 UID Size 04 (4) │ │ │ │ -3AA59 UID 00000000 (0) │ │ │ │ -3AA5D GID Size 04 (4) │ │ │ │ -3AA5E GID 00000000 (0) │ │ │ │ -3AA62 PAYLOAD │ │ │ │ - │ │ │ │ -3C4AC LOCAL HEADER #34 04034B50 (67324752) │ │ │ │ -3C4B0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -3C4B1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -3C4B2 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -3C4B4 Compression Method 0008 (8) 'Deflated' │ │ │ │ -3C4B6 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -3C4BA CRC FAA9DD12 (4205436178) │ │ │ │ -3C4BE Compressed Size 000009A6 (2470) │ │ │ │ -3C4C2 Uncompressed Size 00001B64 (7012) │ │ │ │ -3C4C6 Filename Length 0010 (16) │ │ │ │ -3C4C8 Extra Length 001C (28) │ │ │ │ -3C4CA Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x3C4CA: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -3C4DA Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -3C4DC Length 0009 (9) │ │ │ │ -3C4DE Flags 03 (3) 'Modification Access' │ │ │ │ -3C4DF Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3C4E3 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3C4E7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -3C4E9 Length 000B (11) │ │ │ │ -3C4EB Version 01 (1) │ │ │ │ -3C4EC UID Size 04 (4) │ │ │ │ -3C4ED UID 00000000 (0) │ │ │ │ -3C4F1 GID Size 04 (4) │ │ │ │ -3C4F2 GID 00000000 (0) │ │ │ │ -3C4F6 PAYLOAD │ │ │ │ - │ │ │ │ -3CE9C LOCAL HEADER #35 04034B50 (67324752) │ │ │ │ -3CEA0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -3CEA1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -3CEA2 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -3CEA4 Compression Method 0008 (8) 'Deflated' │ │ │ │ -3CEA6 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -3CEAA CRC FEC4FE23 (4274322979) │ │ │ │ -3CEAE Compressed Size 000006B7 (1719) │ │ │ │ -3CEB2 Uncompressed Size 00001565 (5477) │ │ │ │ -3CEB6 Filename Length 0012 (18) │ │ │ │ -3CEB8 Extra Length 001C (28) │ │ │ │ -3CEBA Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x3CEBA: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -3CECC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -3CECE Length 0009 (9) │ │ │ │ -3CED0 Flags 03 (3) 'Modification Access' │ │ │ │ -3CED1 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3CED5 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3CED9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -3CEDB Length 000B (11) │ │ │ │ -3CEDD Version 01 (1) │ │ │ │ -3CEDE UID Size 04 (4) │ │ │ │ -3CEDF UID 00000000 (0) │ │ │ │ -3CEE3 GID Size 04 (4) │ │ │ │ -3CEE4 GID 00000000 (0) │ │ │ │ -3CEE8 PAYLOAD │ │ │ │ - │ │ │ │ -3D59F LOCAL HEADER #36 04034B50 (67324752) │ │ │ │ -3D5A3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -3D5A4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -3D5A5 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -3D5A7 Compression Method 0008 (8) 'Deflated' │ │ │ │ -3D5A9 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -3D5AD CRC EA42306E (3930206318) │ │ │ │ -3D5B1 Compressed Size 00002A12 (10770) │ │ │ │ -3D5B5 Uncompressed Size 0000B1C5 (45509) │ │ │ │ -3D5B9 Filename Length 0010 (16) │ │ │ │ -3D5BB Extra Length 001C (28) │ │ │ │ -3D5BD Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x3D5BD: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -3D5CD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -3D5CF Length 0009 (9) │ │ │ │ -3D5D1 Flags 03 (3) 'Modification Access' │ │ │ │ -3D5D2 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3D5D6 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -3D5DA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -3D5DC Length 000B (11) │ │ │ │ -3D5DE Version 01 (1) │ │ │ │ -3D5DF UID Size 04 (4) │ │ │ │ -3D5E0 UID 00000000 (0) │ │ │ │ -3D5E4 GID Size 04 (4) │ │ │ │ -3D5E5 GID 00000000 (0) │ │ │ │ -3D5E9 PAYLOAD │ │ │ │ - │ │ │ │ -3FFFB LOCAL HEADER #37 04034B50 (67324752) │ │ │ │ -3FFFF Extract Zip Spec 14 (20) '2.0' │ │ │ │ -40000 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -40001 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -40003 Compression Method 0008 (8) 'Deflated' │ │ │ │ -40005 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -40009 CRC E1C2C8C2 (3787638978) │ │ │ │ -4000D Compressed Size 00001E89 (7817) │ │ │ │ -40011 Uncompressed Size 00009AAA (39594) │ │ │ │ -40015 Filename Length 0012 (18) │ │ │ │ -40017 Extra Length 001C (28) │ │ │ │ -40019 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x40019: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -4002B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -4002D Length 0009 (9) │ │ │ │ -4002F Flags 03 (3) 'Modification Access' │ │ │ │ -40030 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -40034 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -40038 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -4003A Length 000B (11) │ │ │ │ -4003C Version 01 (1) │ │ │ │ -4003D UID Size 04 (4) │ │ │ │ -4003E UID 00000000 (0) │ │ │ │ -40042 GID Size 04 (4) │ │ │ │ -40043 GID 00000000 (0) │ │ │ │ -40047 PAYLOAD │ │ │ │ - │ │ │ │ -41ED0 LOCAL HEADER #38 04034B50 (67324752) │ │ │ │ -41ED4 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -41ED5 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -41ED6 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -41ED8 Compression Method 0008 (8) 'Deflated' │ │ │ │ -41EDA Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -41EDE CRC C2426F84 (3259133828) │ │ │ │ -41EE2 Compressed Size 00001477 (5239) │ │ │ │ -41EE6 Uncompressed Size 00007ACF (31439) │ │ │ │ -41EEA Filename Length 0018 (24) │ │ │ │ -41EEC Extra Length 001C (28) │ │ │ │ -41EEE Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x41EEE: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -41F06 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -41F08 Length 0009 (9) │ │ │ │ -41F0A Flags 03 (3) 'Modification Access' │ │ │ │ -41F0B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -41F0F Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -41F13 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -41F15 Length 000B (11) │ │ │ │ -41F17 Version 01 (1) │ │ │ │ -41F18 UID Size 04 (4) │ │ │ │ -41F19 UID 00000000 (0) │ │ │ │ -41F1D GID Size 04 (4) │ │ │ │ -41F1E GID 00000000 (0) │ │ │ │ -41F22 PAYLOAD │ │ │ │ - │ │ │ │ -43399 LOCAL HEADER #39 04034B50 (67324752) │ │ │ │ -4339D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -4339E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -4339F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -433A1 Compression Method 0008 (8) 'Deflated' │ │ │ │ -433A3 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -433A7 CRC C591B054 (3314659412) │ │ │ │ -433AB Compressed Size 000018D1 (6353) │ │ │ │ -433AF Uncompressed Size 0000A7F4 (42996) │ │ │ │ -433B3 Filename Length 001F (31) │ │ │ │ -433B5 Extra Length 001C (28) │ │ │ │ -433B7 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x433B7: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -433D6 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -433D8 Length 0009 (9) │ │ │ │ -433DA Flags 03 (3) 'Modification Access' │ │ │ │ -433DB Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -433DF Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -433E3 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -433E5 Length 000B (11) │ │ │ │ -433E7 Version 01 (1) │ │ │ │ -433E8 UID Size 04 (4) │ │ │ │ -433E9 UID 00000000 (0) │ │ │ │ -433ED GID Size 04 (4) │ │ │ │ -433EE GID 00000000 (0) │ │ │ │ -433F2 PAYLOAD │ │ │ │ - │ │ │ │ -44CC3 LOCAL HEADER #40 04034B50 (67324752) │ │ │ │ -44CC7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -44CC8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -44CC9 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -44CCB Compression Method 0008 (8) 'Deflated' │ │ │ │ -44CCD Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -44CD1 CRC 59BC913A (1505530170) │ │ │ │ -44CD5 Compressed Size 000003F7 (1015) │ │ │ │ -44CD9 Uncompressed Size 000008A3 (2211) │ │ │ │ -44CDD Filename Length 001E (30) │ │ │ │ -44CDF Extra Length 001C (28) │ │ │ │ -44CE1 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x44CE1: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -44CFF Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -44D01 Length 0009 (9) │ │ │ │ -44D03 Flags 03 (3) 'Modification Access' │ │ │ │ -44D04 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -44D08 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -44D0C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -44D0E Length 000B (11) │ │ │ │ -44D10 Version 01 (1) │ │ │ │ -44D11 UID Size 04 (4) │ │ │ │ -44D12 UID 00000000 (0) │ │ │ │ -44D16 GID Size 04 (4) │ │ │ │ -44D17 GID 00000000 (0) │ │ │ │ -44D1B PAYLOAD │ │ │ │ - │ │ │ │ -45112 LOCAL HEADER #41 04034B50 (67324752) │ │ │ │ -45116 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -45117 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -45118 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -4511A Compression Method 0008 (8) 'Deflated' │ │ │ │ -4511C Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -45120 CRC 1C972FAC (479670188) │ │ │ │ -45124 Compressed Size 00004293 (17043) │ │ │ │ -45128 Uncompressed Size 0000D8DC (55516) │ │ │ │ -4512C Filename Length 0013 (19) │ │ │ │ -4512E Extra Length 001C (28) │ │ │ │ -45130 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x45130: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -45143 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -45145 Length 0009 (9) │ │ │ │ -45147 Flags 03 (3) 'Modification Access' │ │ │ │ -45148 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4514C Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -45150 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -45152 Length 000B (11) │ │ │ │ -45154 Version 01 (1) │ │ │ │ -45155 UID Size 04 (4) │ │ │ │ -45156 UID 00000000 (0) │ │ │ │ -4515A GID Size 04 (4) │ │ │ │ -4515B GID 00000000 (0) │ │ │ │ -4515F PAYLOAD │ │ │ │ - │ │ │ │ -493F2 LOCAL HEADER #42 04034B50 (67324752) │ │ │ │ -493F6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -493F7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -493F8 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -493FA Compression Method 0008 (8) 'Deflated' │ │ │ │ -493FC Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -49400 CRC 9BE35018 (2615365656) │ │ │ │ -49404 Compressed Size 000026C3 (9923) │ │ │ │ -49408 Uncompressed Size 00006E45 (28229) │ │ │ │ -4940C Filename Length 0019 (25) │ │ │ │ -4940E Extra Length 001C (28) │ │ │ │ -49410 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x49410: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -49429 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -4942B Length 0009 (9) │ │ │ │ -4942D Flags 03 (3) 'Modification Access' │ │ │ │ -4942E Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -49432 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -49436 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -49438 Length 000B (11) │ │ │ │ -4943A Version 01 (1) │ │ │ │ -4943B UID Size 04 (4) │ │ │ │ -4943C UID 00000000 (0) │ │ │ │ -49440 GID Size 04 (4) │ │ │ │ -49441 GID 00000000 (0) │ │ │ │ -49445 PAYLOAD │ │ │ │ - │ │ │ │ -4BB08 LOCAL HEADER #43 04034B50 (67324752) │ │ │ │ -4BB0C Extract Zip Spec 14 (20) '2.0' │ │ │ │ -4BB0D Extract OS 00 (0) 'MS-DOS' │ │ │ │ -4BB0E General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -4BB10 Compression Method 0008 (8) 'Deflated' │ │ │ │ -4BB12 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -4BB16 CRC 8AC46E96 (2328129174) │ │ │ │ -4BB1A Compressed Size 00002739 (10041) │ │ │ │ -4BB1E Uncompressed Size 00008B83 (35715) │ │ │ │ -4BB22 Filename Length 0019 (25) │ │ │ │ -4BB24 Extra Length 001C (28) │ │ │ │ -4BB26 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x4BB26: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -4BB3F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -4BB41 Length 0009 (9) │ │ │ │ -4BB43 Flags 03 (3) 'Modification Access' │ │ │ │ -4BB44 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4BB48 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4BB4C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -4BB4E Length 000B (11) │ │ │ │ -4BB50 Version 01 (1) │ │ │ │ -4BB51 UID Size 04 (4) │ │ │ │ -4BB52 UID 00000000 (0) │ │ │ │ -4BB56 GID Size 04 (4) │ │ │ │ -4BB57 GID 00000000 (0) │ │ │ │ -4BB5B PAYLOAD │ │ │ │ - │ │ │ │ -4E294 LOCAL HEADER #44 04034B50 (67324752) │ │ │ │ -4E298 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -4E299 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -4E29A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -4E29C Compression Method 0008 (8) 'Deflated' │ │ │ │ -4E29E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -4E2A2 CRC 816EB60A (2171516426) │ │ │ │ -4E2A6 Compressed Size 00000CF0 (3312) │ │ │ │ -4E2AA Uncompressed Size 0000517A (20858) │ │ │ │ -4E2AE Filename Length 0021 (33) │ │ │ │ -4E2B0 Extra Length 001C (28) │ │ │ │ -4E2B2 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x4E2B2: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -4E2D3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -4E2D5 Length 0009 (9) │ │ │ │ -4E2D7 Flags 03 (3) 'Modification Access' │ │ │ │ -4E2D8 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4E2DC Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4E2E0 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -4E2E2 Length 000B (11) │ │ │ │ -4E2E4 Version 01 (1) │ │ │ │ -4E2E5 UID Size 04 (4) │ │ │ │ -4E2E6 UID 00000000 (0) │ │ │ │ -4E2EA GID Size 04 (4) │ │ │ │ -4E2EB GID 00000000 (0) │ │ │ │ -4E2EF PAYLOAD │ │ │ │ - │ │ │ │ -4EFDF LOCAL HEADER #45 04034B50 (67324752) │ │ │ │ -4EFE3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -4EFE4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -4EFE5 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -4EFE7 Compression Method 0008 (8) 'Deflated' │ │ │ │ -4EFE9 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -4EFED CRC 0463353E (73610558) │ │ │ │ -4EFF1 Compressed Size 00000468 (1128) │ │ │ │ -4EFF5 Uncompressed Size 00000931 (2353) │ │ │ │ -4EFF9 Filename Length 001B (27) │ │ │ │ -4EFFB Extra Length 001C (28) │ │ │ │ -4EFFD Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x4EFFD: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -4F018 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -4F01A Length 0009 (9) │ │ │ │ -4F01C Flags 03 (3) 'Modification Access' │ │ │ │ -4F01D Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4F021 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4F025 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -4F027 Length 000B (11) │ │ │ │ -4F029 Version 01 (1) │ │ │ │ -4F02A UID Size 04 (4) │ │ │ │ -4F02B UID 00000000 (0) │ │ │ │ -4F02F GID Size 04 (4) │ │ │ │ -4F030 GID 00000000 (0) │ │ │ │ -4F034 PAYLOAD │ │ │ │ - │ │ │ │ -4F49C LOCAL HEADER #46 04034B50 (67324752) │ │ │ │ -4F4A0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -4F4A1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -4F4A2 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -4F4A4 Compression Method 0008 (8) 'Deflated' │ │ │ │ -4F4A6 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -4F4AA CRC A0BBCEF2 (2696662770) │ │ │ │ -4F4AE Compressed Size 000016F0 (5872) │ │ │ │ -4F4B2 Uncompressed Size 00007A6D (31341) │ │ │ │ -4F4B6 Filename Length 001F (31) │ │ │ │ -4F4B8 Extra Length 001C (28) │ │ │ │ -4F4BA Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x4F4BA: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -4F4D9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -4F4DB Length 0009 (9) │ │ │ │ -4F4DD Flags 03 (3) 'Modification Access' │ │ │ │ -4F4DE Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4F4E2 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -4F4E6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -4F4E8 Length 000B (11) │ │ │ │ -4F4EA Version 01 (1) │ │ │ │ -4F4EB UID Size 04 (4) │ │ │ │ -4F4EC UID 00000000 (0) │ │ │ │ -4F4F0 GID Size 04 (4) │ │ │ │ -4F4F1 GID 00000000 (0) │ │ │ │ -4F4F5 PAYLOAD │ │ │ │ - │ │ │ │ -50BE5 LOCAL HEADER #47 04034B50 (67324752) │ │ │ │ -50BE9 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -50BEA Extract OS 00 (0) 'MS-DOS' │ │ │ │ -50BEB General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -50BED Compression Method 0008 (8) 'Deflated' │ │ │ │ -50BEF Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -50BF3 CRC BCCE6C21 (3167644705) │ │ │ │ -50BF7 Compressed Size 00004173 (16755) │ │ │ │ -50BFB Uncompressed Size 0001CF93 (118675) │ │ │ │ -50BFF Filename Length 0010 (16) │ │ │ │ -50C01 Extra Length 001C (28) │ │ │ │ -50C03 Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x50C03: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -50C13 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -50C15 Length 0009 (9) │ │ │ │ -50C17 Flags 03 (3) 'Modification Access' │ │ │ │ -50C18 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -50C1C Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -50C20 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -50C22 Length 000B (11) │ │ │ │ -50C24 Version 01 (1) │ │ │ │ -50C25 UID Size 04 (4) │ │ │ │ -50C26 UID 00000000 (0) │ │ │ │ -50C2A GID Size 04 (4) │ │ │ │ -50C2B GID 00000000 (0) │ │ │ │ -50C2F PAYLOAD │ │ │ │ - │ │ │ │ -54DA2 LOCAL HEADER #48 04034B50 (67324752) │ │ │ │ -54DA6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -54DA7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -54DA8 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -54DAA Compression Method 0008 (8) 'Deflated' │ │ │ │ -54DAC Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -54DB0 CRC 1D57686C (492267628) │ │ │ │ -54DB4 Compressed Size 00000A93 (2707) │ │ │ │ -54DB8 Uncompressed Size 00002105 (8453) │ │ │ │ -54DBC Filename Length 0014 (20) │ │ │ │ -54DBE Extra Length 001C (28) │ │ │ │ -54DC0 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x54DC0: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -54DD4 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -54DD6 Length 0009 (9) │ │ │ │ -54DD8 Flags 03 (3) 'Modification Access' │ │ │ │ -54DD9 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -54DDD Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -54DE1 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -54DE3 Length 000B (11) │ │ │ │ -54DE5 Version 01 (1) │ │ │ │ -54DE6 UID Size 04 (4) │ │ │ │ -54DE7 UID 00000000 (0) │ │ │ │ -54DEB GID Size 04 (4) │ │ │ │ -54DEC GID 00000000 (0) │ │ │ │ -54DF0 PAYLOAD │ │ │ │ - │ │ │ │ -55883 LOCAL HEADER #49 04034B50 (67324752) │ │ │ │ -55887 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -55888 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -55889 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -5588B Compression Method 0008 (8) 'Deflated' │ │ │ │ -5588D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -55891 CRC 4F5C62E6 (1331454694) │ │ │ │ -55895 Compressed Size 0000AC9A (44186) │ │ │ │ -55899 Uncompressed Size 0003E418 (255000) │ │ │ │ -5589D Filename Length 0017 (23) │ │ │ │ -5589F Extra Length 001C (28) │ │ │ │ -558A1 Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x558A1: Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -558B8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -558BA Length 0009 (9) │ │ │ │ -558BC Flags 03 (3) 'Modification Access' │ │ │ │ -558BD Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -558C1 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -558C5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -558C7 Length 000B (11) │ │ │ │ -558C9 Version 01 (1) │ │ │ │ -558CA UID Size 04 (4) │ │ │ │ -558CB UID 00000000 (0) │ │ │ │ -558CF GID Size 04 (4) │ │ │ │ -558D0 GID 00000000 (0) │ │ │ │ -558D4 PAYLOAD │ │ │ │ - │ │ │ │ -6056E LOCAL HEADER #50 04034B50 (67324752) │ │ │ │ -60572 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -60573 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -60574 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -60576 Compression Method 0008 (8) 'Deflated' │ │ │ │ -60578 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -6057C CRC 086861EB (141058539) │ │ │ │ -60580 Compressed Size 00000401 (1025) │ │ │ │ -60584 Uncompressed Size 0000093D (2365) │ │ │ │ -60588 Filename Length 0013 (19) │ │ │ │ -6058A Extra Length 001C (28) │ │ │ │ -6058C Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x6058C: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -6059F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -605A1 Length 0009 (9) │ │ │ │ -605A3 Flags 03 (3) 'Modification Access' │ │ │ │ -605A4 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -605A8 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -605AC Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -605AE Length 000B (11) │ │ │ │ -605B0 Version 01 (1) │ │ │ │ -605B1 UID Size 04 (4) │ │ │ │ -605B2 UID 00000000 (0) │ │ │ │ -605B6 GID Size 04 (4) │ │ │ │ -605B7 GID 00000000 (0) │ │ │ │ -605BB PAYLOAD │ │ │ │ - │ │ │ │ -609BC LOCAL HEADER #51 04034B50 (67324752) │ │ │ │ -609C0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -609C1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -609C2 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -609C4 Compression Method 0008 (8) 'Deflated' │ │ │ │ -609C6 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -609CA CRC BA580F4A (3126333258) │ │ │ │ -609CE Compressed Size 000014E3 (5347) │ │ │ │ -609D2 Uncompressed Size 0000687B (26747) │ │ │ │ -609D6 Filename Length 0012 (18) │ │ │ │ -609D8 Extra Length 001C (28) │ │ │ │ -609DA Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x609DA: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -609EC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -609EE Length 0009 (9) │ │ │ │ -609F0 Flags 03 (3) 'Modification Access' │ │ │ │ -609F1 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -609F5 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -609F9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -609FB Length 000B (11) │ │ │ │ -609FD Version 01 (1) │ │ │ │ -609FE UID Size 04 (4) │ │ │ │ -609FF UID 00000000 (0) │ │ │ │ -60A03 GID Size 04 (4) │ │ │ │ -60A04 GID 00000000 (0) │ │ │ │ -60A08 PAYLOAD │ │ │ │ - │ │ │ │ -61EEB LOCAL HEADER #52 04034B50 (67324752) │ │ │ │ -61EEF Extract Zip Spec 14 (20) '2.0' │ │ │ │ -61EF0 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -61EF1 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -61EF3 Compression Method 0008 (8) 'Deflated' │ │ │ │ -61EF5 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -61EF9 CRC 497392B3 (1232310963) │ │ │ │ -61EFD Compressed Size 000011EC (4588) │ │ │ │ -61F01 Uncompressed Size 000040F5 (16629) │ │ │ │ -61F05 Filename Length 0012 (18) │ │ │ │ -61F07 Extra Length 001C (28) │ │ │ │ -61F09 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x61F09: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -61F1B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -61F1D Length 0009 (9) │ │ │ │ -61F1F Flags 03 (3) 'Modification Access' │ │ │ │ -61F20 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -61F24 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -61F28 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -61F2A Length 000B (11) │ │ │ │ -61F2C Version 01 (1) │ │ │ │ -61F2D UID Size 04 (4) │ │ │ │ -61F2E UID 00000000 (0) │ │ │ │ -61F32 GID Size 04 (4) │ │ │ │ -61F33 GID 00000000 (0) │ │ │ │ -61F37 PAYLOAD │ │ │ │ - │ │ │ │ -63123 LOCAL HEADER #53 04034B50 (67324752) │ │ │ │ -63127 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -63128 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -63129 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -6312B Compression Method 0008 (8) 'Deflated' │ │ │ │ -6312D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -63131 CRC C1D3CAEC (3251882732) │ │ │ │ -63135 Compressed Size 000009DA (2522) │ │ │ │ -63139 Uncompressed Size 00003529 (13609) │ │ │ │ -6313D Filename Length 0019 (25) │ │ │ │ -6313F Extra Length 001C (28) │ │ │ │ -63141 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x63141: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -6315A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -6315C Length 0009 (9) │ │ │ │ -6315E Flags 03 (3) 'Modification Access' │ │ │ │ -6315F Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -63163 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -63167 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -63169 Length 000B (11) │ │ │ │ -6316B Version 01 (1) │ │ │ │ -6316C UID Size 04 (4) │ │ │ │ -6316D UID 00000000 (0) │ │ │ │ -63171 GID Size 04 (4) │ │ │ │ -63172 GID 00000000 (0) │ │ │ │ -63176 PAYLOAD │ │ │ │ - │ │ │ │ -63B50 LOCAL HEADER #54 04034B50 (67324752) │ │ │ │ -63B54 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -63B55 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -63B56 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -63B58 Compression Method 0008 (8) 'Deflated' │ │ │ │ -63B5A Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -63B5E CRC AB9F9615 (2879362581) │ │ │ │ -63B62 Compressed Size 000018AF (6319) │ │ │ │ -63B66 Uncompressed Size 0000A605 (42501) │ │ │ │ -63B6A Filename Length 0019 (25) │ │ │ │ -63B6C Extra Length 001C (28) │ │ │ │ -63B6E Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x63B6E: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -63B87 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -63B89 Length 0009 (9) │ │ │ │ -63B8B Flags 03 (3) 'Modification Access' │ │ │ │ -63B8C Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -63B90 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -63B94 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -63B96 Length 000B (11) │ │ │ │ -63B98 Version 01 (1) │ │ │ │ -63B99 UID Size 04 (4) │ │ │ │ -63B9A UID 00000000 (0) │ │ │ │ -63B9E GID Size 04 (4) │ │ │ │ -63B9F GID 00000000 (0) │ │ │ │ -63BA3 PAYLOAD │ │ │ │ - │ │ │ │ -65452 LOCAL HEADER #55 04034B50 (67324752) │ │ │ │ -65456 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -65457 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -65458 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -6545A Compression Method 0008 (8) 'Deflated' │ │ │ │ -6545C Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -65460 CRC D193B2B7 (3516117687) │ │ │ │ -65464 Compressed Size 0000177E (6014) │ │ │ │ -65468 Uncompressed Size 0000472C (18220) │ │ │ │ -6546C Filename Length 0014 (20) │ │ │ │ -6546E Extra Length 001C (28) │ │ │ │ -65470 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x65470: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -65484 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -65486 Length 0009 (9) │ │ │ │ -65488 Flags 03 (3) 'Modification Access' │ │ │ │ -65489 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6548D Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -65491 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -65493 Length 000B (11) │ │ │ │ -65495 Version 01 (1) │ │ │ │ -65496 UID Size 04 (4) │ │ │ │ -65497 UID 00000000 (0) │ │ │ │ -6549B GID Size 04 (4) │ │ │ │ -6549C GID 00000000 (0) │ │ │ │ -654A0 PAYLOAD │ │ │ │ - │ │ │ │ -66C1E LOCAL HEADER #56 04034B50 (67324752) │ │ │ │ -66C22 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -66C23 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -66C24 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -66C26 Compression Method 0008 (8) 'Deflated' │ │ │ │ -66C28 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -66C2C CRC 85800620 (2239759904) │ │ │ │ -66C30 Compressed Size 0000040B (1035) │ │ │ │ -66C34 Uncompressed Size 00000825 (2085) │ │ │ │ -66C38 Filename Length 001C (28) │ │ │ │ -66C3A Extra Length 001C (28) │ │ │ │ -66C3C Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x66C3C: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -66C58 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -66C5A Length 0009 (9) │ │ │ │ -66C5C Flags 03 (3) 'Modification Access' │ │ │ │ -66C5D Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -66C61 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -66C65 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -66C67 Length 000B (11) │ │ │ │ -66C69 Version 01 (1) │ │ │ │ -66C6A UID Size 04 (4) │ │ │ │ -66C6B UID 00000000 (0) │ │ │ │ -66C6F GID Size 04 (4) │ │ │ │ -66C70 GID 00000000 (0) │ │ │ │ -66C74 PAYLOAD │ │ │ │ - │ │ │ │ -6707F LOCAL HEADER #57 04034B50 (67324752) │ │ │ │ -67083 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -67084 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -67085 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -67087 Compression Method 0008 (8) 'Deflated' │ │ │ │ -67089 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -6708D CRC BADD7CAB (3135077547) │ │ │ │ -67091 Compressed Size 00002481 (9345) │ │ │ │ -67095 Uncompressed Size 0000B56F (46447) │ │ │ │ -67099 Filename Length 001F (31) │ │ │ │ -6709B Extra Length 001C (28) │ │ │ │ -6709D Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x6709D: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -670BC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -670BE Length 0009 (9) │ │ │ │ -670C0 Flags 03 (3) 'Modification Access' │ │ │ │ -670C1 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -670C5 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -670C9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -670CB Length 000B (11) │ │ │ │ -670CD Version 01 (1) │ │ │ │ -670CE UID Size 04 (4) │ │ │ │ -670CF UID 00000000 (0) │ │ │ │ -670D3 GID Size 04 (4) │ │ │ │ -670D4 GID 00000000 (0) │ │ │ │ -670D8 PAYLOAD │ │ │ │ - │ │ │ │ -69559 LOCAL HEADER #58 04034B50 (67324752) │ │ │ │ -6955D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -6955E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -6955F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -69561 Compression Method 0008 (8) 'Deflated' │ │ │ │ -69563 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -69567 CRC A7EDAC0E (2817371150) │ │ │ │ -6956B Compressed Size 00000E80 (3712) │ │ │ │ -6956F Uncompressed Size 000052D9 (21209) │ │ │ │ -69573 Filename Length 001F (31) │ │ │ │ -69575 Extra Length 001C (28) │ │ │ │ -69577 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x69577: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -69596 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -69598 Length 0009 (9) │ │ │ │ -6959A Flags 03 (3) 'Modification Access' │ │ │ │ -6959B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6959F Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -695A3 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -695A5 Length 000B (11) │ │ │ │ -695A7 Version 01 (1) │ │ │ │ -695A8 UID Size 04 (4) │ │ │ │ -695A9 UID 00000000 (0) │ │ │ │ -695AD GID Size 04 (4) │ │ │ │ -695AE GID 00000000 (0) │ │ │ │ -695B2 PAYLOAD │ │ │ │ - │ │ │ │ -6A432 LOCAL HEADER #59 04034B50 (67324752) │ │ │ │ -6A436 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -6A437 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -6A438 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -6A43A Compression Method 0008 (8) 'Deflated' │ │ │ │ -6A43C Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -6A440 CRC 584D44F7 (1481458935) │ │ │ │ -6A444 Compressed Size 00000A44 (2628) │ │ │ │ -6A448 Uncompressed Size 0000247A (9338) │ │ │ │ -6A44C Filename Length 0013 (19) │ │ │ │ -6A44E Extra Length 001C (28) │ │ │ │ -6A450 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x6A450: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -6A463 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -6A465 Length 0009 (9) │ │ │ │ -6A467 Flags 03 (3) 'Modification Access' │ │ │ │ -6A468 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6A46C Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6A470 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -6A472 Length 000B (11) │ │ │ │ -6A474 Version 01 (1) │ │ │ │ -6A475 UID Size 04 (4) │ │ │ │ -6A476 UID 00000000 (0) │ │ │ │ -6A47A GID Size 04 (4) │ │ │ │ -6A47B GID 00000000 (0) │ │ │ │ -6A47F PAYLOAD │ │ │ │ - │ │ │ │ -6AEC3 LOCAL HEADER #60 04034B50 (67324752) │ │ │ │ -6AEC7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -6AEC8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -6AEC9 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -6AECB Compression Method 0008 (8) 'Deflated' │ │ │ │ -6AECD Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -6AED1 CRC 6B4694FC (1799787772) │ │ │ │ -6AED5 Compressed Size 0000248A (9354) │ │ │ │ -6AED9 Uncompressed Size 0000B84C (47180) │ │ │ │ -6AEDD Filename Length 0019 (25) │ │ │ │ -6AEDF Extra Length 001C (28) │ │ │ │ -6AEE1 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x6AEE1: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -6AEFA Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -6AEFC Length 0009 (9) │ │ │ │ -6AEFE Flags 03 (3) 'Modification Access' │ │ │ │ -6AEFF Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6AF03 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6AF07 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -6AF09 Length 000B (11) │ │ │ │ -6AF0B Version 01 (1) │ │ │ │ -6AF0C UID Size 04 (4) │ │ │ │ -6AF0D UID 00000000 (0) │ │ │ │ -6AF11 GID Size 04 (4) │ │ │ │ -6AF12 GID 00000000 (0) │ │ │ │ -6AF16 PAYLOAD │ │ │ │ - │ │ │ │ -6D3A0 LOCAL HEADER #61 04034B50 (67324752) │ │ │ │ -6D3A4 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -6D3A5 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -6D3A6 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -6D3A8 Compression Method 0008 (8) 'Deflated' │ │ │ │ -6D3AA Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -6D3AE CRC 17DF12EC (400495340) │ │ │ │ -6D3B2 Compressed Size 00000EFA (3834) │ │ │ │ -6D3B6 Uncompressed Size 00003A2C (14892) │ │ │ │ -6D3BA Filename Length 0024 (36) │ │ │ │ -6D3BC Extra Length 001C (28) │ │ │ │ -6D3BE Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x6D3BE: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -6D3E2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -6D3E4 Length 0009 (9) │ │ │ │ -6D3E6 Flags 03 (3) 'Modification Access' │ │ │ │ -6D3E7 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6D3EB Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6D3EF Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -6D3F1 Length 000B (11) │ │ │ │ -6D3F3 Version 01 (1) │ │ │ │ -6D3F4 UID Size 04 (4) │ │ │ │ -6D3F5 UID 00000000 (0) │ │ │ │ -6D3F9 GID Size 04 (4) │ │ │ │ -6D3FA GID 00000000 (0) │ │ │ │ -6D3FE PAYLOAD │ │ │ │ - │ │ │ │ -6E2F8 LOCAL HEADER #62 04034B50 (67324752) │ │ │ │ -6E2FC Extract Zip Spec 14 (20) '2.0' │ │ │ │ -6E2FD Extract OS 00 (0) 'MS-DOS' │ │ │ │ -6E2FE General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -6E300 Compression Method 0008 (8) 'Deflated' │ │ │ │ -6E302 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -6E306 CRC D30DC617 (3540895255) │ │ │ │ -6E30A Compressed Size 00001AC1 (6849) │ │ │ │ -6E30E Uncompressed Size 00005EDC (24284) │ │ │ │ -6E312 Filename Length 0017 (23) │ │ │ │ -6E314 Extra Length 001C (28) │ │ │ │ -6E316 Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x6E316: Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -6E32D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -6E32F Length 0009 (9) │ │ │ │ -6E331 Flags 03 (3) 'Modification Access' │ │ │ │ -6E332 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6E336 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6E33A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -6E33C Length 000B (11) │ │ │ │ -6E33E Version 01 (1) │ │ │ │ -6E33F UID Size 04 (4) │ │ │ │ -6E340 UID 00000000 (0) │ │ │ │ -6E344 GID Size 04 (4) │ │ │ │ -6E345 GID 00000000 (0) │ │ │ │ -6E349 PAYLOAD │ │ │ │ - │ │ │ │ -6FE0A LOCAL HEADER #63 04034B50 (67324752) │ │ │ │ -6FE0E Extract Zip Spec 14 (20) '2.0' │ │ │ │ -6FE0F Extract OS 00 (0) 'MS-DOS' │ │ │ │ -6FE10 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -6FE12 Compression Method 0008 (8) 'Deflated' │ │ │ │ -6FE14 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -6FE18 CRC 11E32AF1 (300100337) │ │ │ │ -6FE1C Compressed Size 00000ED3 (3795) │ │ │ │ -6FE20 Uncompressed Size 000038E2 (14562) │ │ │ │ -6FE24 Filename Length 0023 (35) │ │ │ │ -6FE26 Extra Length 001C (28) │ │ │ │ -6FE28 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x6FE28: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -6FE4B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -6FE4D Length 0009 (9) │ │ │ │ -6FE4F Flags 03 (3) 'Modification Access' │ │ │ │ -6FE50 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6FE54 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -6FE58 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -6FE5A Length 000B (11) │ │ │ │ -6FE5C Version 01 (1) │ │ │ │ -6FE5D UID Size 04 (4) │ │ │ │ -6FE5E UID 00000000 (0) │ │ │ │ -6FE62 GID Size 04 (4) │ │ │ │ -6FE63 GID 00000000 (0) │ │ │ │ -6FE67 PAYLOAD │ │ │ │ - │ │ │ │ -70D3A LOCAL HEADER #64 04034B50 (67324752) │ │ │ │ -70D3E Extract Zip Spec 14 (20) '2.0' │ │ │ │ -70D3F Extract OS 00 (0) 'MS-DOS' │ │ │ │ -70D40 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -70D42 Compression Method 0008 (8) 'Deflated' │ │ │ │ -70D44 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -70D48 CRC 2DB7929F (767005343) │ │ │ │ -70D4C Compressed Size 00000113 (275) │ │ │ │ -70D50 Uncompressed Size 000001F3 (499) │ │ │ │ -70D54 Filename Length 001B (27) │ │ │ │ -70D56 Extra Length 001C (28) │ │ │ │ -70D58 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x70D58: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -70D73 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -70D75 Length 0009 (9) │ │ │ │ -70D77 Flags 03 (3) 'Modification Access' │ │ │ │ -70D78 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -70D7C Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -70D80 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -70D82 Length 000B (11) │ │ │ │ -70D84 Version 01 (1) │ │ │ │ -70D85 UID Size 04 (4) │ │ │ │ -70D86 UID 00000000 (0) │ │ │ │ -70D8A GID Size 04 (4) │ │ │ │ -70D8B GID 00000000 (0) │ │ │ │ -70D8F PAYLOAD │ │ │ │ - │ │ │ │ -70EA2 LOCAL HEADER #65 04034B50 (67324752) │ │ │ │ -70EA6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -70EA7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -70EA8 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -70EAA Compression Method 0008 (8) 'Deflated' │ │ │ │ -70EAC Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -70EB0 CRC AEE78AD0 (2934409936) │ │ │ │ -70EB4 Compressed Size 00001890 (6288) │ │ │ │ -70EB8 Uncompressed Size 00008FAC (36780) │ │ │ │ -70EBC Filename Length 001D (29) │ │ │ │ -70EBE Extra Length 001C (28) │ │ │ │ -70EC0 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x70EC0: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -70EDD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -70EDF Length 0009 (9) │ │ │ │ -70EE1 Flags 03 (3) 'Modification Access' │ │ │ │ -70EE2 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -70EE6 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -70EEA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -70EEC Length 000B (11) │ │ │ │ -70EEE Version 01 (1) │ │ │ │ -70EEF UID Size 04 (4) │ │ │ │ -70EF0 UID 00000000 (0) │ │ │ │ -70EF4 GID Size 04 (4) │ │ │ │ -70EF5 GID 00000000 (0) │ │ │ │ -70EF9 PAYLOAD │ │ │ │ - │ │ │ │ -72789 LOCAL HEADER #66 04034B50 (67324752) │ │ │ │ -7278D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -7278E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -7278F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -72791 Compression Method 0008 (8) 'Deflated' │ │ │ │ -72793 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -72797 CRC BFC41586 (3217298822) │ │ │ │ -7279B Compressed Size 0000164D (5709) │ │ │ │ -7279F Uncompressed Size 00003A9B (15003) │ │ │ │ -727A3 Filename Length 0015 (21) │ │ │ │ -727A5 Extra Length 001C (28) │ │ │ │ -727A7 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x727A7: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -727BC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -727BE Length 0009 (9) │ │ │ │ -727C0 Flags 03 (3) 'Modification Access' │ │ │ │ -727C1 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -727C5 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -727C9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -727CB Length 000B (11) │ │ │ │ -727CD Version 01 (1) │ │ │ │ -727CE UID Size 04 (4) │ │ │ │ -727CF UID 00000000 (0) │ │ │ │ -727D3 GID Size 04 (4) │ │ │ │ -727D4 GID 00000000 (0) │ │ │ │ -727D8 PAYLOAD │ │ │ │ - │ │ │ │ -73E25 LOCAL HEADER #67 04034B50 (67324752) │ │ │ │ -73E29 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -73E2A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -73E2B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -73E2D Compression Method 0008 (8) 'Deflated' │ │ │ │ -73E2F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -73E33 CRC E62AC5E2 (3861562850) │ │ │ │ -73E37 Compressed Size 00003B4F (15183) │ │ │ │ -73E3B Uncompressed Size 0001185B (71771) │ │ │ │ -73E3F Filename Length 0016 (22) │ │ │ │ -73E41 Extra Length 001C (28) │ │ │ │ -73E43 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x73E43: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -73E59 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -73E5B Length 0009 (9) │ │ │ │ -73E5D Flags 03 (3) 'Modification Access' │ │ │ │ -73E5E Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -73E62 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -73E66 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -73E68 Length 000B (11) │ │ │ │ -73E6A Version 01 (1) │ │ │ │ -73E6B UID Size 04 (4) │ │ │ │ -73E6C UID 00000000 (0) │ │ │ │ -73E70 GID Size 04 (4) │ │ │ │ -73E71 GID 00000000 (0) │ │ │ │ -73E75 PAYLOAD │ │ │ │ - │ │ │ │ -779C4 LOCAL HEADER #68 04034B50 (67324752) │ │ │ │ -779C8 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -779C9 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -779CA General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -779CC Compression Method 0008 (8) 'Deflated' │ │ │ │ -779CE Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -779D2 CRC 8D31A4DB (2368840923) │ │ │ │ -779D6 Compressed Size 00003E88 (16008) │ │ │ │ -779DA Uncompressed Size 0001C17B (115067) │ │ │ │ -779DE Filename Length 0019 (25) │ │ │ │ -779E0 Extra Length 001C (28) │ │ │ │ -779E2 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x779E2: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -779FB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -779FD Length 0009 (9) │ │ │ │ -779FF Flags 03 (3) 'Modification Access' │ │ │ │ -77A00 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -77A04 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -77A08 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -77A0A Length 000B (11) │ │ │ │ -77A0C Version 01 (1) │ │ │ │ -77A0D UID Size 04 (4) │ │ │ │ -77A0E UID 00000000 (0) │ │ │ │ -77A12 GID Size 04 (4) │ │ │ │ -77A13 GID 00000000 (0) │ │ │ │ -77A17 PAYLOAD │ │ │ │ - │ │ │ │ -7B89F LOCAL HEADER #69 04034B50 (67324752) │ │ │ │ -7B8A3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -7B8A4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -7B8A5 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -7B8A7 Compression Method 0008 (8) 'Deflated' │ │ │ │ -7B8A9 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -7B8AD CRC 5E5B35D9 (1583035865) │ │ │ │ -7B8B1 Compressed Size 00000835 (2101) │ │ │ │ -7B8B5 Uncompressed Size 00003383 (13187) │ │ │ │ -7B8B9 Filename Length 0011 (17) │ │ │ │ -7B8BB Extra Length 001C (28) │ │ │ │ -7B8BD Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x7B8BD: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -7B8CE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -7B8D0 Length 0009 (9) │ │ │ │ -7B8D2 Flags 03 (3) 'Modification Access' │ │ │ │ -7B8D3 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -7B8D7 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -7B8DB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -7B8DD Length 000B (11) │ │ │ │ -7B8DF Version 01 (1) │ │ │ │ -7B8E0 UID Size 04 (4) │ │ │ │ -7B8E1 UID 00000000 (0) │ │ │ │ -7B8E5 GID Size 04 (4) │ │ │ │ -7B8E6 GID 00000000 (0) │ │ │ │ -7B8EA PAYLOAD │ │ │ │ - │ │ │ │ -7C11F LOCAL HEADER #70 04034B50 (67324752) │ │ │ │ -7C123 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -7C124 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -7C125 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -7C127 Compression Method 0008 (8) 'Deflated' │ │ │ │ -7C129 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -7C12D CRC 00F8EEFF (16314111) │ │ │ │ -7C131 Compressed Size 00005185 (20869) │ │ │ │ -7C135 Uncompressed Size 0001FB6C (129900) │ │ │ │ -7C139 Filename Length 0015 (21) │ │ │ │ -7C13B Extra Length 001C (28) │ │ │ │ -7C13D Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x7C13D: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -7C152 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -7C154 Length 0009 (9) │ │ │ │ -7C156 Flags 03 (3) 'Modification Access' │ │ │ │ -7C157 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -7C15B Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -7C15F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -7C161 Length 000B (11) │ │ │ │ -7C163 Version 01 (1) │ │ │ │ -7C164 UID Size 04 (4) │ │ │ │ -7C165 UID 00000000 (0) │ │ │ │ -7C169 GID Size 04 (4) │ │ │ │ -7C16A GID 00000000 (0) │ │ │ │ -7C16E PAYLOAD │ │ │ │ - │ │ │ │ -812F3 LOCAL HEADER #71 04034B50 (67324752) │ │ │ │ -812F7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -812F8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -812F9 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -812FB Compression Method 0008 (8) 'Deflated' │ │ │ │ -812FD Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -81301 CRC CA092E13 (3389599251) │ │ │ │ -81305 Compressed Size 00001B03 (6915) │ │ │ │ -81309 Uncompressed Size 000081CF (33231) │ │ │ │ -8130D Filename Length 0019 (25) │ │ │ │ -8130F Extra Length 001C (28) │ │ │ │ -81311 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x81311: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -8132A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -8132C Length 0009 (9) │ │ │ │ -8132E Flags 03 (3) 'Modification Access' │ │ │ │ -8132F Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -81333 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -81337 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -81339 Length 000B (11) │ │ │ │ -8133B Version 01 (1) │ │ │ │ -8133C UID Size 04 (4) │ │ │ │ -8133D UID 00000000 (0) │ │ │ │ -81341 GID Size 04 (4) │ │ │ │ -81342 GID 00000000 (0) │ │ │ │ -81346 PAYLOAD │ │ │ │ - │ │ │ │ -82E49 LOCAL HEADER #72 04034B50 (67324752) │ │ │ │ -82E4D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -82E4E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -82E4F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -82E51 Compression Method 0008 (8) 'Deflated' │ │ │ │ -82E53 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -82E57 CRC A52E2FD0 (2771267536) │ │ │ │ -82E5B Compressed Size 00000D97 (3479) │ │ │ │ -82E5F Uncompressed Size 00002E9F (11935) │ │ │ │ -82E63 Filename Length 0018 (24) │ │ │ │ -82E65 Extra Length 001C (28) │ │ │ │ -82E67 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x82E67: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -82E7F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -82E81 Length 0009 (9) │ │ │ │ -82E83 Flags 03 (3) 'Modification Access' │ │ │ │ -82E84 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -82E88 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -82E8C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -82E8E Length 000B (11) │ │ │ │ -82E90 Version 01 (1) │ │ │ │ -82E91 UID Size 04 (4) │ │ │ │ -82E92 UID 00000000 (0) │ │ │ │ -82E96 GID Size 04 (4) │ │ │ │ -82E97 GID 00000000 (0) │ │ │ │ -82E9B PAYLOAD │ │ │ │ - │ │ │ │ -83C32 LOCAL HEADER #73 04034B50 (67324752) │ │ │ │ -83C36 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -83C37 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -83C38 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -83C3A Compression Method 0008 (8) 'Deflated' │ │ │ │ -83C3C Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -83C40 CRC 0252247A (38937722) │ │ │ │ -83C44 Compressed Size 000001E1 (481) │ │ │ │ -83C48 Uncompressed Size 00000323 (803) │ │ │ │ -83C4C Filename Length 0011 (17) │ │ │ │ -83C4E Extra Length 001C (28) │ │ │ │ -83C50 Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x83C50: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -83C61 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -83C63 Length 0009 (9) │ │ │ │ -83C65 Flags 03 (3) 'Modification Access' │ │ │ │ -83C66 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -83C6A Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -83C6E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -83C70 Length 000B (11) │ │ │ │ -83C72 Version 01 (1) │ │ │ │ -83C73 UID Size 04 (4) │ │ │ │ -83C74 UID 00000000 (0) │ │ │ │ -83C78 GID Size 04 (4) │ │ │ │ -83C79 GID 00000000 (0) │ │ │ │ -83C7D PAYLOAD │ │ │ │ - │ │ │ │ -83E5E LOCAL HEADER #74 04034B50 (67324752) │ │ │ │ -83E62 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -83E63 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -83E64 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -83E66 Compression Method 0008 (8) 'Deflated' │ │ │ │ -83E68 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -83E6C CRC 05901E89 (93331081) │ │ │ │ -83E70 Compressed Size 000006C2 (1730) │ │ │ │ -83E74 Uncompressed Size 00001439 (5177) │ │ │ │ -83E78 Filename Length 0019 (25) │ │ │ │ -83E7A Extra Length 001C (28) │ │ │ │ -83E7C Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x83E7C: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -83E95 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -83E97 Length 0009 (9) │ │ │ │ -83E99 Flags 03 (3) 'Modification Access' │ │ │ │ -83E9A Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -83E9E Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -83EA2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -83EA4 Length 000B (11) │ │ │ │ -83EA6 Version 01 (1) │ │ │ │ -83EA7 UID Size 04 (4) │ │ │ │ -83EA8 UID 00000000 (0) │ │ │ │ -83EAC GID Size 04 (4) │ │ │ │ -83EAD GID 00000000 (0) │ │ │ │ -83EB1 PAYLOAD │ │ │ │ - │ │ │ │ -84573 LOCAL HEADER #75 04034B50 (67324752) │ │ │ │ -84577 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -84578 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -84579 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -8457B Compression Method 0008 (8) 'Deflated' │ │ │ │ -8457D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -84581 CRC DB50D6EE (3679508206) │ │ │ │ -84585 Compressed Size 00001B8A (7050) │ │ │ │ -84589 Uncompressed Size 00009F03 (40707) │ │ │ │ -8458D Filename Length 0018 (24) │ │ │ │ -8458F Extra Length 001C (28) │ │ │ │ -84591 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x84591: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -845A9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -845AB Length 0009 (9) │ │ │ │ -845AD Flags 03 (3) 'Modification Access' │ │ │ │ -845AE Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -845B2 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -845B6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -845B8 Length 000B (11) │ │ │ │ -845BA Version 01 (1) │ │ │ │ -845BB UID Size 04 (4) │ │ │ │ -845BC UID 00000000 (0) │ │ │ │ -845C0 GID Size 04 (4) │ │ │ │ -845C1 GID 00000000 (0) │ │ │ │ -845C5 PAYLOAD │ │ │ │ - │ │ │ │ -8614F LOCAL HEADER #76 04034B50 (67324752) │ │ │ │ -86153 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -86154 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -86155 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -86157 Compression Method 0008 (8) 'Deflated' │ │ │ │ -86159 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -8615D CRC 085D1D21 (140320033) │ │ │ │ -86161 Compressed Size 000016F9 (5881) │ │ │ │ -86165 Uncompressed Size 00008AB6 (35510) │ │ │ │ -86169 Filename Length 0012 (18) │ │ │ │ -8616B Extra Length 001C (28) │ │ │ │ -8616D Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x8616D: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -8617F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -86181 Length 0009 (9) │ │ │ │ -86183 Flags 03 (3) 'Modification Access' │ │ │ │ -86184 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -86188 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8618C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -8618E Length 000B (11) │ │ │ │ -86190 Version 01 (1) │ │ │ │ -86191 UID Size 04 (4) │ │ │ │ -86192 UID 00000000 (0) │ │ │ │ -86196 GID Size 04 (4) │ │ │ │ -86197 GID 00000000 (0) │ │ │ │ -8619B PAYLOAD │ │ │ │ - │ │ │ │ -87894 LOCAL HEADER #77 04034B50 (67324752) │ │ │ │ -87898 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -87899 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -8789A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -8789C Compression Method 0008 (8) 'Deflated' │ │ │ │ -8789E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -878A2 CRC 3A43D1F6 (977523190) │ │ │ │ -878A6 Compressed Size 00001E10 (7696) │ │ │ │ -878AA Uncompressed Size 00008803 (34819) │ │ │ │ -878AE Filename Length 0016 (22) │ │ │ │ -878B0 Extra Length 001C (28) │ │ │ │ -878B2 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x878B2: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -878C8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -878CA Length 0009 (9) │ │ │ │ -878CC Flags 03 (3) 'Modification Access' │ │ │ │ -878CD Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -878D1 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -878D5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -878D7 Length 000B (11) │ │ │ │ -878D9 Version 01 (1) │ │ │ │ -878DA UID Size 04 (4) │ │ │ │ -878DB UID 00000000 (0) │ │ │ │ -878DF GID Size 04 (4) │ │ │ │ -878E0 GID 00000000 (0) │ │ │ │ -878E4 PAYLOAD │ │ │ │ - │ │ │ │ -896F4 LOCAL HEADER #78 04034B50 (67324752) │ │ │ │ -896F8 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -896F9 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -896FA General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -896FC Compression Method 0008 (8) 'Deflated' │ │ │ │ -896FE Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -89702 CRC 094F3A57 (156187223) │ │ │ │ -89706 Compressed Size 000029A7 (10663) │ │ │ │ -8970A Uncompressed Size 0000D04F (53327) │ │ │ │ -8970E Filename Length 001A (26) │ │ │ │ -89710 Extra Length 001C (28) │ │ │ │ -89712 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x89712: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -8972C Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -8972E Length 0009 (9) │ │ │ │ -89730 Flags 03 (3) 'Modification Access' │ │ │ │ -89731 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -89735 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -89739 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -8973B Length 000B (11) │ │ │ │ -8973D Version 01 (1) │ │ │ │ -8973E UID Size 04 (4) │ │ │ │ -8973F UID 00000000 (0) │ │ │ │ -89743 GID Size 04 (4) │ │ │ │ -89744 GID 00000000 (0) │ │ │ │ -89748 PAYLOAD │ │ │ │ - │ │ │ │ -8C0EF LOCAL HEADER #79 04034B50 (67324752) │ │ │ │ -8C0F3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -8C0F4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -8C0F5 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -8C0F7 Compression Method 0008 (8) 'Deflated' │ │ │ │ -8C0F9 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -8C0FD CRC 90CE98C5 (2429458629) │ │ │ │ -8C101 Compressed Size 000009AC (2476) │ │ │ │ -8C105 Uncompressed Size 00001DB6 (7606) │ │ │ │ -8C109 Filename Length 0018 (24) │ │ │ │ -8C10B Extra Length 001C (28) │ │ │ │ -8C10D Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x8C10D: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -8C125 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -8C127 Length 0009 (9) │ │ │ │ -8C129 Flags 03 (3) 'Modification Access' │ │ │ │ -8C12A Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8C12E Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8C132 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -8C134 Length 000B (11) │ │ │ │ -8C136 Version 01 (1) │ │ │ │ -8C137 UID Size 04 (4) │ │ │ │ -8C138 UID 00000000 (0) │ │ │ │ -8C13C GID Size 04 (4) │ │ │ │ -8C13D GID 00000000 (0) │ │ │ │ -8C141 PAYLOAD │ │ │ │ - │ │ │ │ -8CAED LOCAL HEADER #80 04034B50 (67324752) │ │ │ │ -8CAF1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -8CAF2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -8CAF3 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -8CAF5 Compression Method 0008 (8) 'Deflated' │ │ │ │ -8CAF7 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -8CAFB CRC F5E2129F (4125233823) │ │ │ │ -8CAFF Compressed Size 000016BC (5820) │ │ │ │ -8CB03 Uncompressed Size 000016CD (5837) │ │ │ │ -8CB07 Filename Length 0015 (21) │ │ │ │ -8CB09 Extra Length 001C (28) │ │ │ │ -8CB0B Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x8CB0B: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -8CB20 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -8CB22 Length 0009 (9) │ │ │ │ -8CB24 Flags 03 (3) 'Modification Access' │ │ │ │ -8CB25 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8CB29 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8CB2D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -8CB2F Length 000B (11) │ │ │ │ -8CB31 Version 01 (1) │ │ │ │ -8CB32 UID Size 04 (4) │ │ │ │ -8CB33 UID 00000000 (0) │ │ │ │ -8CB37 GID Size 04 (4) │ │ │ │ -8CB38 GID 00000000 (0) │ │ │ │ -8CB3C PAYLOAD │ │ │ │ - │ │ │ │ -8E1F8 LOCAL HEADER #81 04034B50 (67324752) │ │ │ │ -8E1FC Extract Zip Spec 14 (20) '2.0' │ │ │ │ -8E1FD Extract OS 00 (0) 'MS-DOS' │ │ │ │ -8E1FE General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -8E200 Compression Method 0008 (8) 'Deflated' │ │ │ │ -8E202 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -8E206 CRC F5E2129F (4125233823) │ │ │ │ -8E20A Compressed Size 000016BC (5820) │ │ │ │ -8E20E Uncompressed Size 000016CD (5837) │ │ │ │ -8E212 Filename Length 001C (28) │ │ │ │ -8E214 Extra Length 001C (28) │ │ │ │ -8E216 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x8E216: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -8E232 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -8E234 Length 0009 (9) │ │ │ │ -8E236 Flags 03 (3) 'Modification Access' │ │ │ │ -8E237 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8E23B Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8E23F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -8E241 Length 000B (11) │ │ │ │ -8E243 Version 01 (1) │ │ │ │ -8E244 UID Size 04 (4) │ │ │ │ -8E245 UID 00000000 (0) │ │ │ │ -8E249 GID Size 04 (4) │ │ │ │ -8E24A GID 00000000 (0) │ │ │ │ -8E24E PAYLOAD │ │ │ │ - │ │ │ │ -8F90A LOCAL HEADER #82 04034B50 (67324752) │ │ │ │ -8F90E Extract Zip Spec 0A (10) '1.0' │ │ │ │ -8F90F Extract OS 00 (0) 'MS-DOS' │ │ │ │ -8F910 General Purpose Flag 0000 (0) │ │ │ │ -8F912 Compression Method 0000 (0) 'Stored' │ │ │ │ -8F914 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -8F918 CRC FC95F24B (4237685323) │ │ │ │ -8F91C Compressed Size 00001B84 (7044) │ │ │ │ -8F920 Uncompressed Size 00001B84 (7044) │ │ │ │ -8F924 Filename Length 0016 (22) │ │ │ │ -8F926 Extra Length 001C (28) │ │ │ │ -8F928 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x8F928: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -8F93E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -8F940 Length 0009 (9) │ │ │ │ -8F942 Flags 03 (3) 'Modification Access' │ │ │ │ -8F943 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8F947 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -8F94B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -8F94D Length 000B (11) │ │ │ │ -8F94F Version 01 (1) │ │ │ │ -8F950 UID Size 04 (4) │ │ │ │ -8F951 UID 00000000 (0) │ │ │ │ -8F955 GID Size 04 (4) │ │ │ │ -8F956 GID 00000000 (0) │ │ │ │ -8F95A PAYLOAD │ │ │ │ - │ │ │ │ -914DE LOCAL HEADER #83 04034B50 (67324752) │ │ │ │ -914E2 Extract Zip Spec 0A (10) '1.0' │ │ │ │ -914E3 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -914E4 General Purpose Flag 0000 (0) │ │ │ │ -914E6 Compression Method 0000 (0) 'Stored' │ │ │ │ -914E8 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -914EC CRC D0D71F86 (3503759238) │ │ │ │ -914F0 Compressed Size 00000B7B (2939) │ │ │ │ -914F4 Uncompressed Size 00000B7B (2939) │ │ │ │ -914F8 Filename Length 0016 (22) │ │ │ │ -914FA Extra Length 001C (28) │ │ │ │ -914FC Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x914FC: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -91512 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -91514 Length 0009 (9) │ │ │ │ -91516 Flags 03 (3) 'Modification Access' │ │ │ │ -91517 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9151B Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9151F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -91521 Length 000B (11) │ │ │ │ -91523 Version 01 (1) │ │ │ │ -91524 UID Size 04 (4) │ │ │ │ -91525 UID 00000000 (0) │ │ │ │ -91529 GID Size 04 (4) │ │ │ │ -9152A GID 00000000 (0) │ │ │ │ -9152E PAYLOAD │ │ │ │ - │ │ │ │ -920A9 LOCAL HEADER #84 04034B50 (67324752) │ │ │ │ -920AD Extract Zip Spec 0A (10) '1.0' │ │ │ │ -920AE Extract OS 00 (0) 'MS-DOS' │ │ │ │ -920AF General Purpose Flag 0000 (0) │ │ │ │ -920B1 Compression Method 0000 (0) 'Stored' │ │ │ │ -920B3 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -920B7 CRC FFF9C4D2 (4294558930) │ │ │ │ -920BB Compressed Size 0000138F (5007) │ │ │ │ -920BF Uncompressed Size 0000138F (5007) │ │ │ │ -920C3 Filename Length 0016 (22) │ │ │ │ -920C5 Extra Length 001C (28) │ │ │ │ -920C7 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x920C7: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -920DD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -920DF Length 0009 (9) │ │ │ │ -920E1 Flags 03 (3) 'Modification Access' │ │ │ │ -920E2 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -920E6 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -920EA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -920EC Length 000B (11) │ │ │ │ -920EE Version 01 (1) │ │ │ │ -920EF UID Size 04 (4) │ │ │ │ -920F0 UID 00000000 (0) │ │ │ │ -920F4 GID Size 04 (4) │ │ │ │ -920F5 GID 00000000 (0) │ │ │ │ -920F9 PAYLOAD │ │ │ │ - │ │ │ │ -93488 LOCAL HEADER #85 04034B50 (67324752) │ │ │ │ -9348C Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9348D Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9348E General Purpose Flag 0000 (0) │ │ │ │ -93490 Compression Method 0000 (0) 'Stored' │ │ │ │ -93492 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -93496 CRC A1037E8E (2701360782) │ │ │ │ -9349A Compressed Size 0000145E (5214) │ │ │ │ -9349E Uncompressed Size 0000145E (5214) │ │ │ │ -934A2 Filename Length 0016 (22) │ │ │ │ -934A4 Extra Length 001C (28) │ │ │ │ -934A6 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x934A6: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -934BC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -934BE Length 0009 (9) │ │ │ │ -934C0 Flags 03 (3) 'Modification Access' │ │ │ │ -934C1 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -934C5 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -934C9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -934CB Length 000B (11) │ │ │ │ -934CD Version 01 (1) │ │ │ │ -934CE UID Size 04 (4) │ │ │ │ -934CF UID 00000000 (0) │ │ │ │ -934D3 GID Size 04 (4) │ │ │ │ -934D4 GID 00000000 (0) │ │ │ │ -934D8 PAYLOAD │ │ │ │ - │ │ │ │ -94936 LOCAL HEADER #86 04034B50 (67324752) │ │ │ │ -9493A Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9493B Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9493C General Purpose Flag 0000 (0) │ │ │ │ -9493E Compression Method 0000 (0) 'Stored' │ │ │ │ -94940 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -94944 CRC 5E9E64F1 (1587438833) │ │ │ │ -94948 Compressed Size 000008EC (2284) │ │ │ │ -9494C Uncompressed Size 000008EC (2284) │ │ │ │ -94950 Filename Length 0016 (22) │ │ │ │ -94952 Extra Length 001C (28) │ │ │ │ -94954 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x94954: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9496A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9496C Length 0009 (9) │ │ │ │ -9496E Flags 03 (3) 'Modification Access' │ │ │ │ -9496F Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -94973 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -94977 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -94979 Length 000B (11) │ │ │ │ -9497B Version 01 (1) │ │ │ │ -9497C UID Size 04 (4) │ │ │ │ -9497D UID 00000000 (0) │ │ │ │ -94981 GID Size 04 (4) │ │ │ │ -94982 GID 00000000 (0) │ │ │ │ -94986 PAYLOAD │ │ │ │ - │ │ │ │ -95272 LOCAL HEADER #87 04034B50 (67324752) │ │ │ │ -95276 Extract Zip Spec 0A (10) '1.0' │ │ │ │ -95277 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -95278 General Purpose Flag 0000 (0) │ │ │ │ -9527A Compression Method 0000 (0) 'Stored' │ │ │ │ -9527C Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -95280 CRC 42E340AB (1122189483) │ │ │ │ -95284 Compressed Size 00001F2E (7982) │ │ │ │ -95288 Uncompressed Size 00001F2E (7982) │ │ │ │ -9528C Filename Length 001E (30) │ │ │ │ -9528E Extra Length 001C (28) │ │ │ │ -95290 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x95290: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -952AE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -952B0 Length 0009 (9) │ │ │ │ -952B2 Flags 03 (3) 'Modification Access' │ │ │ │ -952B3 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -952B7 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -952BB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -952BD Length 000B (11) │ │ │ │ -952BF Version 01 (1) │ │ │ │ -952C0 UID Size 04 (4) │ │ │ │ -952C1 UID 00000000 (0) │ │ │ │ -952C5 GID Size 04 (4) │ │ │ │ -952C6 GID 00000000 (0) │ │ │ │ -952CA PAYLOAD │ │ │ │ - │ │ │ │ -971F8 LOCAL HEADER #88 04034B50 (67324752) │ │ │ │ -971FC Extract Zip Spec 14 (20) '2.0' │ │ │ │ -971FD Extract OS 00 (0) 'MS-DOS' │ │ │ │ -971FE General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -97200 Compression Method 0008 (8) 'Deflated' │ │ │ │ -97202 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -97206 CRC 6B709B8E (1802541966) │ │ │ │ -9720A Compressed Size 00003D6F (15727) │ │ │ │ -9720E Uncompressed Size 00016649 (91721) │ │ │ │ -97212 Filename Length 001A (26) │ │ │ │ -97214 Extra Length 001C (28) │ │ │ │ -97216 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x97216: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -97230 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -97232 Length 0009 (9) │ │ │ │ -97234 Flags 03 (3) 'Modification Access' │ │ │ │ -97235 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -97239 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9723D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9723F Length 000B (11) │ │ │ │ -97241 Version 01 (1) │ │ │ │ -97242 UID Size 04 (4) │ │ │ │ -97243 UID 00000000 (0) │ │ │ │ -97247 GID Size 04 (4) │ │ │ │ -97248 GID 00000000 (0) │ │ │ │ -9724C PAYLOAD │ │ │ │ - │ │ │ │ -9AFBB LOCAL HEADER #89 04034B50 (67324752) │ │ │ │ -9AFBF Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9AFC0 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9AFC1 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9AFC3 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9AFC5 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9AFC9 CRC 17236CC3 (388197571) │ │ │ │ -9AFCD Compressed Size 000029C2 (10690) │ │ │ │ -9AFD1 Uncompressed Size 0000BA6A (47722) │ │ │ │ -9AFD5 Filename Length 0018 (24) │ │ │ │ -9AFD7 Extra Length 001C (28) │ │ │ │ -9AFD9 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9AFD9: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9AFF1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9AFF3 Length 0009 (9) │ │ │ │ -9AFF5 Flags 03 (3) 'Modification Access' │ │ │ │ -9AFF6 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9AFFA Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9AFFE Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9B000 Length 000B (11) │ │ │ │ -9B002 Version 01 (1) │ │ │ │ -9B003 UID Size 04 (4) │ │ │ │ -9B004 UID 00000000 (0) │ │ │ │ -9B008 GID Size 04 (4) │ │ │ │ -9B009 GID 00000000 (0) │ │ │ │ -9B00D PAYLOAD │ │ │ │ - │ │ │ │ -9D9CF LOCAL HEADER #90 04034B50 (67324752) │ │ │ │ -9D9D3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9D9D4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9D9D5 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9D9D7 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9D9D9 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9D9DD CRC DCB3B516 (3702764822) │ │ │ │ -9D9E1 Compressed Size 000000AE (174) │ │ │ │ -9D9E5 Uncompressed Size 000000FC (252) │ │ │ │ -9D9E9 Filename Length 0016 (22) │ │ │ │ -9D9EB Extra Length 001C (28) │ │ │ │ -9D9ED Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9D9ED: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DA03 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DA05 Length 0009 (9) │ │ │ │ -9DA07 Flags 03 (3) 'Modification Access' │ │ │ │ -9DA08 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DA0C Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DA10 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DA12 Length 000B (11) │ │ │ │ -9DA14 Version 01 (1) │ │ │ │ -9DA15 UID Size 04 (4) │ │ │ │ -9DA16 UID 00000000 (0) │ │ │ │ -9DA1A GID Size 04 (4) │ │ │ │ -9DA1B GID 00000000 (0) │ │ │ │ -9DA1F PAYLOAD XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX │ │ │ │ +16F39 LOCAL HEADER #12 04034B50 (67324752) │ │ │ │ +16F3D Extract Zip Spec 14 (20) '2.0' │ │ │ │ +16F3E Extract OS 00 (0) 'MS-DOS' │ │ │ │ +16F3F General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +16F41 Compression Method 0008 (8) 'Deflated' │ │ │ │ +16F43 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +16F47 CRC 466D7134 (1181577524) │ │ │ │ +16F4B Compressed Size 00003B1F (15135) │ │ │ │ +16F4F Uncompressed Size 0001B2A0 (111264) │ │ │ │ +16F53 Filename Length 0015 (21) │ │ │ │ +16F55 Extra Length 001C (28) │ │ │ │ +16F57 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x16F57: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +16F6C Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +16F6E Length 0009 (9) │ │ │ │ +16F70 Flags 03 (3) 'Modification Access' │ │ │ │ +16F71 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +16F75 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +16F79 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +16F7B Length 000B (11) │ │ │ │ +16F7D Version 01 (1) │ │ │ │ +16F7E UID Size 04 (4) │ │ │ │ +16F7F UID 00000000 (0) │ │ │ │ +16F83 GID Size 04 (4) │ │ │ │ +16F84 GID 00000000 (0) │ │ │ │ +16F88 PAYLOAD │ │ │ │ + │ │ │ │ +1AAA7 LOCAL HEADER #13 04034B50 (67324752) │ │ │ │ +1AAAB Extract Zip Spec 14 (20) '2.0' │ │ │ │ +1AAAC Extract OS 00 (0) 'MS-DOS' │ │ │ │ +1AAAD General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +1AAAF Compression Method 0008 (8) 'Deflated' │ │ │ │ +1AAB1 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +1AAB5 CRC 1614FD9C (370474396) │ │ │ │ +1AAB9 Compressed Size 0000908C (37004) │ │ │ │ +1AABD Uncompressed Size 0003D05F (249951) │ │ │ │ +1AAC1 Filename Length 0014 (20) │ │ │ │ +1AAC3 Extra Length 001C (28) │ │ │ │ +1AAC5 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x1AAC5: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +1AAD9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +1AADB Length 0009 (9) │ │ │ │ +1AADD Flags 03 (3) 'Modification Access' │ │ │ │ +1AADE Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +1AAE2 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +1AAE6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +1AAE8 Length 000B (11) │ │ │ │ +1AAEA Version 01 (1) │ │ │ │ +1AAEB UID Size 04 (4) │ │ │ │ +1AAEC UID 00000000 (0) │ │ │ │ +1AAF0 GID Size 04 (4) │ │ │ │ +1AAF1 GID 00000000 (0) │ │ │ │ +1AAF5 PAYLOAD │ │ │ │ + │ │ │ │ +23B81 LOCAL HEADER #14 04034B50 (67324752) │ │ │ │ +23B85 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +23B86 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +23B87 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +23B89 Compression Method 0008 (8) 'Deflated' │ │ │ │ +23B8B Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +23B8F CRC 1689E155 (378134869) │ │ │ │ +23B93 Compressed Size 00002A65 (10853) │ │ │ │ +23B97 Uncompressed Size 0001151F (70943) │ │ │ │ +23B9B Filename Length 0016 (22) │ │ │ │ +23B9D Extra Length 001C (28) │ │ │ │ +23B9F Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x23B9F: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +23BB5 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +23BB7 Length 0009 (9) │ │ │ │ +23BB9 Flags 03 (3) 'Modification Access' │ │ │ │ +23BBA Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +23BBE Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +23BC2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +23BC4 Length 000B (11) │ │ │ │ +23BC6 Version 01 (1) │ │ │ │ +23BC7 UID Size 04 (4) │ │ │ │ +23BC8 UID 00000000 (0) │ │ │ │ +23BCC GID Size 04 (4) │ │ │ │ +23BCD GID 00000000 (0) │ │ │ │ +23BD1 PAYLOAD │ │ │ │ + │ │ │ │ +26636 LOCAL HEADER #15 04034B50 (67324752) │ │ │ │ +2663A Extract Zip Spec 14 (20) '2.0' │ │ │ │ +2663B Extract OS 00 (0) 'MS-DOS' │ │ │ │ +2663C General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +2663E Compression Method 0008 (8) 'Deflated' │ │ │ │ +26640 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +26644 CRC F2ECAFFC (4075597820) │ │ │ │ +26648 Compressed Size 000014D6 (5334) │ │ │ │ +2664C Uncompressed Size 00005176 (20854) │ │ │ │ +26650 Filename Length 001D (29) │ │ │ │ +26652 Extra Length 001C (28) │ │ │ │ +26654 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x26654: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +26671 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +26673 Length 0009 (9) │ │ │ │ +26675 Flags 03 (3) 'Modification Access' │ │ │ │ +26676 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2667A Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2667E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +26680 Length 000B (11) │ │ │ │ +26682 Version 01 (1) │ │ │ │ +26683 UID Size 04 (4) │ │ │ │ +26684 UID 00000000 (0) │ │ │ │ +26688 GID Size 04 (4) │ │ │ │ +26689 GID 00000000 (0) │ │ │ │ +2668D PAYLOAD │ │ │ │ + │ │ │ │ +27B63 LOCAL HEADER #16 04034B50 (67324752) │ │ │ │ +27B67 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +27B68 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +27B69 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +27B6B Compression Method 0008 (8) 'Deflated' │ │ │ │ +27B6D Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +27B71 CRC 2D343D18 (758398232) │ │ │ │ +27B75 Compressed Size 000037F8 (14328) │ │ │ │ +27B79 Uncompressed Size 0000E9F0 (59888) │ │ │ │ +27B7D Filename Length 001C (28) │ │ │ │ +27B7F Extra Length 001C (28) │ │ │ │ +27B81 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x27B81: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +27B9D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +27B9F Length 0009 (9) │ │ │ │ +27BA1 Flags 03 (3) 'Modification Access' │ │ │ │ +27BA2 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +27BA6 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +27BAA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +27BAC Length 000B (11) │ │ │ │ +27BAE Version 01 (1) │ │ │ │ +27BAF UID Size 04 (4) │ │ │ │ +27BB0 UID 00000000 (0) │ │ │ │ +27BB4 GID Size 04 (4) │ │ │ │ +27BB5 GID 00000000 (0) │ │ │ │ +27BB9 PAYLOAD │ │ │ │ + │ │ │ │ +2B3B1 LOCAL HEADER #17 04034B50 (67324752) │ │ │ │ +2B3B5 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +2B3B6 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +2B3B7 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +2B3B9 Compression Method 0008 (8) 'Deflated' │ │ │ │ +2B3BB Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +2B3BF CRC AD7122D2 (2909872850) │ │ │ │ +2B3C3 Compressed Size 000006A0 (1696) │ │ │ │ +2B3C7 Uncompressed Size 000011F4 (4596) │ │ │ │ +2B3CB Filename Length 001C (28) │ │ │ │ +2B3CD Extra Length 001C (28) │ │ │ │ +2B3CF Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x2B3CF: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +2B3EB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +2B3ED Length 0009 (9) │ │ │ │ +2B3EF Flags 03 (3) 'Modification Access' │ │ │ │ +2B3F0 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2B3F4 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2B3F8 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +2B3FA Length 000B (11) │ │ │ │ +2B3FC Version 01 (1) │ │ │ │ +2B3FD UID Size 04 (4) │ │ │ │ +2B3FE UID 00000000 (0) │ │ │ │ +2B402 GID Size 04 (4) │ │ │ │ +2B403 GID 00000000 (0) │ │ │ │ +2B407 PAYLOAD │ │ │ │ + │ │ │ │ +2BAA7 LOCAL HEADER #18 04034B50 (67324752) │ │ │ │ +2BAAB Extract Zip Spec 14 (20) '2.0' │ │ │ │ +2BAAC Extract OS 00 (0) 'MS-DOS' │ │ │ │ +2BAAD General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +2BAAF Compression Method 0008 (8) 'Deflated' │ │ │ │ +2BAB1 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +2BAB5 CRC 0C323935 (204618037) │ │ │ │ +2BAB9 Compressed Size 00001080 (4224) │ │ │ │ +2BABD Uncompressed Size 00004BFF (19455) │ │ │ │ +2BAC1 Filename Length 001B (27) │ │ │ │ +2BAC3 Extra Length 001C (28) │ │ │ │ +2BAC5 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x2BAC5: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +2BAE0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +2BAE2 Length 0009 (9) │ │ │ │ +2BAE4 Flags 03 (3) 'Modification Access' │ │ │ │ +2BAE5 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2BAE9 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2BAED Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +2BAEF Length 000B (11) │ │ │ │ +2BAF1 Version 01 (1) │ │ │ │ +2BAF2 UID Size 04 (4) │ │ │ │ +2BAF3 UID 00000000 (0) │ │ │ │ +2BAF7 GID Size 04 (4) │ │ │ │ +2BAF8 GID 00000000 (0) │ │ │ │ +2BAFC PAYLOAD │ │ │ │ + │ │ │ │ +2CB7C LOCAL HEADER #19 04034B50 (67324752) │ │ │ │ +2CB80 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +2CB81 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +2CB82 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +2CB84 Compression Method 0008 (8) 'Deflated' │ │ │ │ +2CB86 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +2CB8A CRC C330469B (3274720923) │ │ │ │ +2CB8E Compressed Size 000033AC (13228) │ │ │ │ +2CB92 Uncompressed Size 0000BC94 (48276) │ │ │ │ +2CB96 Filename Length 001D (29) │ │ │ │ +2CB98 Extra Length 001C (28) │ │ │ │ +2CB9A Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x2CB9A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +2CBB7 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +2CBB9 Length 0009 (9) │ │ │ │ +2CBBB Flags 03 (3) 'Modification Access' │ │ │ │ +2CBBC Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2CBC0 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2CBC4 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +2CBC6 Length 000B (11) │ │ │ │ +2CBC8 Version 01 (1) │ │ │ │ +2CBC9 UID Size 04 (4) │ │ │ │ +2CBCA UID 00000000 (0) │ │ │ │ +2CBCE GID Size 04 (4) │ │ │ │ +2CBCF GID 00000000 (0) │ │ │ │ +2CBD3 PAYLOAD │ │ │ │ + │ │ │ │ +2FF7F LOCAL HEADER #20 04034B50 (67324752) │ │ │ │ +2FF83 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +2FF84 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +2FF85 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +2FF87 Compression Method 0008 (8) 'Deflated' │ │ │ │ +2FF89 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +2FF8D CRC C2F13C75 (3270589557) │ │ │ │ +2FF91 Compressed Size 00000D69 (3433) │ │ │ │ +2FF95 Uncompressed Size 00003876 (14454) │ │ │ │ +2FF99 Filename Length 001D (29) │ │ │ │ +2FF9B Extra Length 001C (28) │ │ │ │ +2FF9D Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x2FF9D: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +2FFBA Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +2FFBC Length 0009 (9) │ │ │ │ +2FFBE Flags 03 (3) 'Modification Access' │ │ │ │ +2FFBF Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2FFC3 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +2FFC7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +2FFC9 Length 000B (11) │ │ │ │ +2FFCB Version 01 (1) │ │ │ │ +2FFCC UID Size 04 (4) │ │ │ │ +2FFCD UID 00000000 (0) │ │ │ │ +2FFD1 GID Size 04 (4) │ │ │ │ +2FFD2 GID 00000000 (0) │ │ │ │ +2FFD6 PAYLOAD │ │ │ │ + │ │ │ │ +30D3F LOCAL HEADER #21 04034B50 (67324752) │ │ │ │ +30D43 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +30D44 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +30D45 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +30D47 Compression Method 0008 (8) 'Deflated' │ │ │ │ +30D49 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +30D4D CRC BA736463 (3128124515) │ │ │ │ +30D51 Compressed Size 00001C6B (7275) │ │ │ │ +30D55 Uncompressed Size 0000C186 (49542) │ │ │ │ +30D59 Filename Length 001A (26) │ │ │ │ +30D5B Extra Length 001C (28) │ │ │ │ +30D5D Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x30D5D: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +30D77 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +30D79 Length 0009 (9) │ │ │ │ +30D7B Flags 03 (3) 'Modification Access' │ │ │ │ +30D7C Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +30D80 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +30D84 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +30D86 Length 000B (11) │ │ │ │ +30D88 Version 01 (1) │ │ │ │ +30D89 UID Size 04 (4) │ │ │ │ +30D8A UID 00000000 (0) │ │ │ │ +30D8E GID Size 04 (4) │ │ │ │ +30D8F GID 00000000 (0) │ │ │ │ +30D93 PAYLOAD │ │ │ │ + │ │ │ │ +329FE LOCAL HEADER #22 04034B50 (67324752) │ │ │ │ +32A02 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +32A03 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +32A04 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +32A06 Compression Method 0008 (8) 'Deflated' │ │ │ │ +32A08 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +32A0C CRC 955F044A (2506032202) │ │ │ │ +32A10 Compressed Size 000003A3 (931) │ │ │ │ +32A14 Uncompressed Size 0000088E (2190) │ │ │ │ +32A18 Filename Length 0012 (18) │ │ │ │ +32A1A Extra Length 001C (28) │ │ │ │ +32A1C Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x32A1C: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +32A2E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +32A30 Length 0009 (9) │ │ │ │ +32A32 Flags 03 (3) 'Modification Access' │ │ │ │ +32A33 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +32A37 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +32A3B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +32A3D Length 000B (11) │ │ │ │ +32A3F Version 01 (1) │ │ │ │ +32A40 UID Size 04 (4) │ │ │ │ +32A41 UID 00000000 (0) │ │ │ │ +32A45 GID Size 04 (4) │ │ │ │ +32A46 GID 00000000 (0) │ │ │ │ +32A4A PAYLOAD │ │ │ │ + │ │ │ │ +32DED LOCAL HEADER #23 04034B50 (67324752) │ │ │ │ +32DF1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +32DF2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +32DF3 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +32DF5 Compression Method 0008 (8) 'Deflated' │ │ │ │ +32DF7 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +32DFB CRC C065C5F8 (3227895288) │ │ │ │ +32DFF Compressed Size 000001D4 (468) │ │ │ │ +32E03 Uncompressed Size 00000311 (785) │ │ │ │ +32E07 Filename Length 0020 (32) │ │ │ │ +32E09 Extra Length 001C (28) │ │ │ │ +32E0B Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x32E0B: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +32E2B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +32E2D Length 0009 (9) │ │ │ │ +32E2F Flags 03 (3) 'Modification Access' │ │ │ │ +32E30 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +32E34 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +32E38 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +32E3A Length 000B (11) │ │ │ │ +32E3C Version 01 (1) │ │ │ │ +32E3D UID Size 04 (4) │ │ │ │ +32E3E UID 00000000 (0) │ │ │ │ +32E42 GID Size 04 (4) │ │ │ │ +32E43 GID 00000000 (0) │ │ │ │ +32E47 PAYLOAD │ │ │ │ + │ │ │ │ +3301B LOCAL HEADER #24 04034B50 (67324752) │ │ │ │ +3301F Extract Zip Spec 14 (20) '2.0' │ │ │ │ +33020 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +33021 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +33023 Compression Method 0008 (8) 'Deflated' │ │ │ │ +33025 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +33029 CRC 48CF098B (1221527947) │ │ │ │ +3302D Compressed Size 000017A7 (6055) │ │ │ │ +33031 Uncompressed Size 00009CD3 (40147) │ │ │ │ +33035 Filename Length 001B (27) │ │ │ │ +33037 Extra Length 001C (28) │ │ │ │ +33039 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x33039: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +33054 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +33056 Length 0009 (9) │ │ │ │ +33058 Flags 03 (3) 'Modification Access' │ │ │ │ +33059 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3305D Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +33061 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +33063 Length 000B (11) │ │ │ │ +33065 Version 01 (1) │ │ │ │ +33066 UID Size 04 (4) │ │ │ │ +33067 UID 00000000 (0) │ │ │ │ +3306B GID Size 04 (4) │ │ │ │ +3306C GID 00000000 (0) │ │ │ │ +33070 PAYLOAD │ │ │ │ + │ │ │ │ +34817 LOCAL HEADER #25 04034B50 (67324752) │ │ │ │ +3481B Extract Zip Spec 14 (20) '2.0' │ │ │ │ +3481C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +3481D General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +3481F Compression Method 0008 (8) 'Deflated' │ │ │ │ +34821 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +34825 CRC 3C74E841 (1014294593) │ │ │ │ +34829 Compressed Size 00001371 (4977) │ │ │ │ +3482D Uncompressed Size 00003B66 (15206) │ │ │ │ +34831 Filename Length 0015 (21) │ │ │ │ +34833 Extra Length 001C (28) │ │ │ │ +34835 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x34835: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +3484A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +3484C Length 0009 (9) │ │ │ │ +3484E Flags 03 (3) 'Modification Access' │ │ │ │ +3484F Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +34853 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +34857 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +34859 Length 000B (11) │ │ │ │ +3485B Version 01 (1) │ │ │ │ +3485C UID Size 04 (4) │ │ │ │ +3485D UID 00000000 (0) │ │ │ │ +34861 GID Size 04 (4) │ │ │ │ +34862 GID 00000000 (0) │ │ │ │ +34866 PAYLOAD │ │ │ │ + │ │ │ │ +35BD7 LOCAL HEADER #26 04034B50 (67324752) │ │ │ │ +35BDB Extract Zip Spec 14 (20) '2.0' │ │ │ │ +35BDC Extract OS 00 (0) 'MS-DOS' │ │ │ │ +35BDD General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +35BDF Compression Method 0008 (8) 'Deflated' │ │ │ │ +35BE1 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +35BE5 CRC FF345113 (4281618707) │ │ │ │ +35BE9 Compressed Size 00000AD0 (2768) │ │ │ │ +35BED Uncompressed Size 00002135 (8501) │ │ │ │ +35BF1 Filename Length 0011 (17) │ │ │ │ +35BF3 Extra Length 001C (28) │ │ │ │ +35BF5 Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x35BF5: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +35C06 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +35C08 Length 0009 (9) │ │ │ │ +35C0A Flags 03 (3) 'Modification Access' │ │ │ │ +35C0B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +35C0F Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +35C13 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +35C15 Length 000B (11) │ │ │ │ +35C17 Version 01 (1) │ │ │ │ +35C18 UID Size 04 (4) │ │ │ │ +35C19 UID 00000000 (0) │ │ │ │ +35C1D GID Size 04 (4) │ │ │ │ +35C1E GID 00000000 (0) │ │ │ │ +35C22 PAYLOAD │ │ │ │ + │ │ │ │ +366F2 LOCAL HEADER #27 04034B50 (67324752) │ │ │ │ +366F6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +366F7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +366F8 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +366FA Compression Method 0008 (8) 'Deflated' │ │ │ │ +366FC Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +36700 CRC 07458E40 (121998912) │ │ │ │ +36704 Compressed Size 000003FD (1021) │ │ │ │ +36708 Uncompressed Size 00000E99 (3737) │ │ │ │ +3670C Filename Length 0014 (20) │ │ │ │ +3670E Extra Length 001C (28) │ │ │ │ +36710 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x36710: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +36724 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +36726 Length 0009 (9) │ │ │ │ +36728 Flags 03 (3) 'Modification Access' │ │ │ │ +36729 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3672D Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +36731 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +36733 Length 000B (11) │ │ │ │ +36735 Version 01 (1) │ │ │ │ +36736 UID Size 04 (4) │ │ │ │ +36737 UID 00000000 (0) │ │ │ │ +3673B GID Size 04 (4) │ │ │ │ +3673C GID 00000000 (0) │ │ │ │ +36740 PAYLOAD │ │ │ │ + │ │ │ │ +36B3D LOCAL HEADER #28 04034B50 (67324752) │ │ │ │ +36B41 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +36B42 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +36B43 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +36B45 Compression Method 0008 (8) 'Deflated' │ │ │ │ +36B47 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +36B4B CRC 858C8599 (2240578969) │ │ │ │ +36B4F Compressed Size 00001262 (4706) │ │ │ │ +36B53 Uncompressed Size 00003469 (13417) │ │ │ │ +36B57 Filename Length 0014 (20) │ │ │ │ +36B59 Extra Length 001C (28) │ │ │ │ +36B5B Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x36B5B: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +36B6F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +36B71 Length 0009 (9) │ │ │ │ +36B73 Flags 03 (3) 'Modification Access' │ │ │ │ +36B74 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +36B78 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +36B7C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +36B7E Length 000B (11) │ │ │ │ +36B80 Version 01 (1) │ │ │ │ +36B81 UID Size 04 (4) │ │ │ │ +36B82 UID 00000000 (0) │ │ │ │ +36B86 GID Size 04 (4) │ │ │ │ +36B87 GID 00000000 (0) │ │ │ │ +36B8B PAYLOAD │ │ │ │ + │ │ │ │ +37DED LOCAL HEADER #29 04034B50 (67324752) │ │ │ │ +37DF1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +37DF2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +37DF3 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +37DF5 Compression Method 0008 (8) 'Deflated' │ │ │ │ +37DF7 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +37DFB CRC 020FABEC (34581484) │ │ │ │ +37DFF Compressed Size 00000ACD (2765) │ │ │ │ +37E03 Uncompressed Size 000022FF (8959) │ │ │ │ +37E07 Filename Length 001B (27) │ │ │ │ +37E09 Extra Length 001C (28) │ │ │ │ +37E0B Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x37E0B: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +37E26 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +37E28 Length 0009 (9) │ │ │ │ +37E2A Flags 03 (3) 'Modification Access' │ │ │ │ +37E2B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +37E2F Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +37E33 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +37E35 Length 000B (11) │ │ │ │ +37E37 Version 01 (1) │ │ │ │ +37E38 UID Size 04 (4) │ │ │ │ +37E39 UID 00000000 (0) │ │ │ │ +37E3D GID Size 04 (4) │ │ │ │ +37E3E GID 00000000 (0) │ │ │ │ +37E42 PAYLOAD │ │ │ │ + │ │ │ │ +3890F LOCAL HEADER #30 04034B50 (67324752) │ │ │ │ +38913 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +38914 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +38915 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +38917 Compression Method 0008 (8) 'Deflated' │ │ │ │ +38919 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +3891D CRC 9539B70D (2503587597) │ │ │ │ +38921 Compressed Size 00000A8E (2702) │ │ │ │ +38925 Uncompressed Size 0000237A (9082) │ │ │ │ +38929 Filename Length 0013 (19) │ │ │ │ +3892B Extra Length 001C (28) │ │ │ │ +3892D Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x3892D: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +38940 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +38942 Length 0009 (9) │ │ │ │ +38944 Flags 03 (3) 'Modification Access' │ │ │ │ +38945 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +38949 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3894D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +3894F Length 000B (11) │ │ │ │ +38951 Version 01 (1) │ │ │ │ +38952 UID Size 04 (4) │ │ │ │ +38953 UID 00000000 (0) │ │ │ │ +38957 GID Size 04 (4) │ │ │ │ +38958 GID 00000000 (0) │ │ │ │ +3895C PAYLOAD │ │ │ │ + │ │ │ │ +393EA LOCAL HEADER #31 04034B50 (67324752) │ │ │ │ +393EE Extract Zip Spec 14 (20) '2.0' │ │ │ │ +393EF Extract OS 00 (0) 'MS-DOS' │ │ │ │ +393F0 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +393F2 Compression Method 0008 (8) 'Deflated' │ │ │ │ +393F4 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +393F8 CRC AE91DBDB (2928794587) │ │ │ │ +393FC Compressed Size 00000F49 (3913) │ │ │ │ +39400 Uncompressed Size 000036F1 (14065) │ │ │ │ +39404 Filename Length 000F (15) │ │ │ │ +39406 Extra Length 001C (28) │ │ │ │ +39408 Filename 'XXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x39408: Filename 'XXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +39417 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +39419 Length 0009 (9) │ │ │ │ +3941B Flags 03 (3) 'Modification Access' │ │ │ │ +3941C Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +39420 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +39424 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +39426 Length 000B (11) │ │ │ │ +39428 Version 01 (1) │ │ │ │ +39429 UID Size 04 (4) │ │ │ │ +3942A UID 00000000 (0) │ │ │ │ +3942E GID Size 04 (4) │ │ │ │ +3942F GID 00000000 (0) │ │ │ │ +39433 PAYLOAD │ │ │ │ + │ │ │ │ +3A37C LOCAL HEADER #32 04034B50 (67324752) │ │ │ │ +3A380 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +3A381 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +3A382 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +3A384 Compression Method 0008 (8) 'Deflated' │ │ │ │ +3A386 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +3A38A CRC 0DF8D9F7 (234412535) │ │ │ │ +3A38E Compressed Size 0000066A (1642) │ │ │ │ +3A392 Uncompressed Size 000018DF (6367) │ │ │ │ +3A396 Filename Length 000F (15) │ │ │ │ +3A398 Extra Length 001C (28) │ │ │ │ +3A39A Filename 'XXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x3A39A: Filename 'XXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +3A3A9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +3A3AB Length 0009 (9) │ │ │ │ +3A3AD Flags 03 (3) 'Modification Access' │ │ │ │ +3A3AE Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3A3B2 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3A3B6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +3A3B8 Length 000B (11) │ │ │ │ +3A3BA Version 01 (1) │ │ │ │ +3A3BB UID Size 04 (4) │ │ │ │ +3A3BC UID 00000000 (0) │ │ │ │ +3A3C0 GID Size 04 (4) │ │ │ │ +3A3C1 GID 00000000 (0) │ │ │ │ +3A3C5 PAYLOAD │ │ │ │ + │ │ │ │ +3AA2F LOCAL HEADER #33 04034B50 (67324752) │ │ │ │ +3AA33 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +3AA34 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +3AA35 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +3AA37 Compression Method 0008 (8) 'Deflated' │ │ │ │ +3AA39 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +3AA3D CRC 62BEE432 (1656677426) │ │ │ │ +3AA41 Compressed Size 00001A46 (6726) │ │ │ │ +3AA45 Uncompressed Size 000064F2 (25842) │ │ │ │ +3AA49 Filename Length 0013 (19) │ │ │ │ +3AA4B Extra Length 001C (28) │ │ │ │ +3AA4D Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x3AA4D: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +3AA60 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +3AA62 Length 0009 (9) │ │ │ │ +3AA64 Flags 03 (3) 'Modification Access' │ │ │ │ +3AA65 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3AA69 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3AA6D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +3AA6F Length 000B (11) │ │ │ │ +3AA71 Version 01 (1) │ │ │ │ +3AA72 UID Size 04 (4) │ │ │ │ +3AA73 UID 00000000 (0) │ │ │ │ +3AA77 GID Size 04 (4) │ │ │ │ +3AA78 GID 00000000 (0) │ │ │ │ +3AA7C PAYLOAD │ │ │ │ + │ │ │ │ +3C4C2 LOCAL HEADER #34 04034B50 (67324752) │ │ │ │ +3C4C6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +3C4C7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +3C4C8 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +3C4CA Compression Method 0008 (8) 'Deflated' │ │ │ │ +3C4CC Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +3C4D0 CRC FAA9DD12 (4205436178) │ │ │ │ +3C4D4 Compressed Size 000009A6 (2470) │ │ │ │ +3C4D8 Uncompressed Size 00001B64 (7012) │ │ │ │ +3C4DC Filename Length 0010 (16) │ │ │ │ +3C4DE Extra Length 001C (28) │ │ │ │ +3C4E0 Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x3C4E0: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +3C4F0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +3C4F2 Length 0009 (9) │ │ │ │ +3C4F4 Flags 03 (3) 'Modification Access' │ │ │ │ +3C4F5 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3C4F9 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3C4FD Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +3C4FF Length 000B (11) │ │ │ │ +3C501 Version 01 (1) │ │ │ │ +3C502 UID Size 04 (4) │ │ │ │ +3C503 UID 00000000 (0) │ │ │ │ +3C507 GID Size 04 (4) │ │ │ │ +3C508 GID 00000000 (0) │ │ │ │ +3C50C PAYLOAD │ │ │ │ + │ │ │ │ +3CEB2 LOCAL HEADER #35 04034B50 (67324752) │ │ │ │ +3CEB6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +3CEB7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +3CEB8 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +3CEBA Compression Method 0008 (8) 'Deflated' │ │ │ │ +3CEBC Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +3CEC0 CRC FEC4FE23 (4274322979) │ │ │ │ +3CEC4 Compressed Size 000006B7 (1719) │ │ │ │ +3CEC8 Uncompressed Size 00001565 (5477) │ │ │ │ +3CECC Filename Length 0012 (18) │ │ │ │ +3CECE Extra Length 001C (28) │ │ │ │ +3CED0 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x3CED0: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +3CEE2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +3CEE4 Length 0009 (9) │ │ │ │ +3CEE6 Flags 03 (3) 'Modification Access' │ │ │ │ +3CEE7 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3CEEB Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3CEEF Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +3CEF1 Length 000B (11) │ │ │ │ +3CEF3 Version 01 (1) │ │ │ │ +3CEF4 UID Size 04 (4) │ │ │ │ +3CEF5 UID 00000000 (0) │ │ │ │ +3CEF9 GID Size 04 (4) │ │ │ │ +3CEFA GID 00000000 (0) │ │ │ │ +3CEFE PAYLOAD │ │ │ │ + │ │ │ │ +3D5B5 LOCAL HEADER #36 04034B50 (67324752) │ │ │ │ +3D5B9 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +3D5BA Extract OS 00 (0) 'MS-DOS' │ │ │ │ +3D5BB General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +3D5BD Compression Method 0008 (8) 'Deflated' │ │ │ │ +3D5BF Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +3D5C3 CRC 2516A309 (622240521) │ │ │ │ +3D5C7 Compressed Size 00002A14 (10772) │ │ │ │ +3D5CB Uncompressed Size 0000B1C5 (45509) │ │ │ │ +3D5CF Filename Length 0010 (16) │ │ │ │ +3D5D1 Extra Length 001C (28) │ │ │ │ +3D5D3 Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x3D5D3: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +3D5E3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +3D5E5 Length 0009 (9) │ │ │ │ +3D5E7 Flags 03 (3) 'Modification Access' │ │ │ │ +3D5E8 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3D5EC Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +3D5F0 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +3D5F2 Length 000B (11) │ │ │ │ +3D5F4 Version 01 (1) │ │ │ │ +3D5F5 UID Size 04 (4) │ │ │ │ +3D5F6 UID 00000000 (0) │ │ │ │ +3D5FA GID Size 04 (4) │ │ │ │ +3D5FB GID 00000000 (0) │ │ │ │ +3D5FF PAYLOAD │ │ │ │ + │ │ │ │ +40013 LOCAL HEADER #37 04034B50 (67324752) │ │ │ │ +40017 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +40018 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +40019 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +4001B Compression Method 0008 (8) 'Deflated' │ │ │ │ +4001D Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +40021 CRC 501928CE (1343826126) │ │ │ │ +40025 Compressed Size 00001E8A (7818) │ │ │ │ +40029 Uncompressed Size 00009AAA (39594) │ │ │ │ +4002D Filename Length 0012 (18) │ │ │ │ +4002F Extra Length 001C (28) │ │ │ │ +40031 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x40031: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +40043 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +40045 Length 0009 (9) │ │ │ │ +40047 Flags 03 (3) 'Modification Access' │ │ │ │ +40048 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4004C Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +40050 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +40052 Length 000B (11) │ │ │ │ +40054 Version 01 (1) │ │ │ │ +40055 UID Size 04 (4) │ │ │ │ +40056 UID 00000000 (0) │ │ │ │ +4005A GID Size 04 (4) │ │ │ │ +4005B GID 00000000 (0) │ │ │ │ +4005F PAYLOAD │ │ │ │ + │ │ │ │ +41EE9 LOCAL HEADER #38 04034B50 (67324752) │ │ │ │ +41EED Extract Zip Spec 14 (20) '2.0' │ │ │ │ +41EEE Extract OS 00 (0) 'MS-DOS' │ │ │ │ +41EEF General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +41EF1 Compression Method 0008 (8) 'Deflated' │ │ │ │ +41EF3 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +41EF7 CRC FB7154A3 (4218508451) │ │ │ │ +41EFB Compressed Size 00001479 (5241) │ │ │ │ +41EFF Uncompressed Size 00007ACF (31439) │ │ │ │ +41F03 Filename Length 0018 (24) │ │ │ │ +41F05 Extra Length 001C (28) │ │ │ │ +41F07 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x41F07: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +41F1F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +41F21 Length 0009 (9) │ │ │ │ +41F23 Flags 03 (3) 'Modification Access' │ │ │ │ +41F24 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +41F28 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +41F2C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +41F2E Length 000B (11) │ │ │ │ +41F30 Version 01 (1) │ │ │ │ +41F31 UID Size 04 (4) │ │ │ │ +41F32 UID 00000000 (0) │ │ │ │ +41F36 GID Size 04 (4) │ │ │ │ +41F37 GID 00000000 (0) │ │ │ │ +41F3B PAYLOAD │ │ │ │ + │ │ │ │ +433B4 LOCAL HEADER #39 04034B50 (67324752) │ │ │ │ +433B8 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +433B9 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +433BA General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +433BC Compression Method 0008 (8) 'Deflated' │ │ │ │ +433BE Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +433C2 CRC 5FAB8EF0 (1605078768) │ │ │ │ +433C6 Compressed Size 000018D0 (6352) │ │ │ │ +433CA Uncompressed Size 0000A7F4 (42996) │ │ │ │ +433CE Filename Length 001F (31) │ │ │ │ +433D0 Extra Length 001C (28) │ │ │ │ +433D2 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x433D2: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +433F1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +433F3 Length 0009 (9) │ │ │ │ +433F5 Flags 03 (3) 'Modification Access' │ │ │ │ +433F6 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +433FA Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +433FE Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +43400 Length 000B (11) │ │ │ │ +43402 Version 01 (1) │ │ │ │ +43403 UID Size 04 (4) │ │ │ │ +43404 UID 00000000 (0) │ │ │ │ +43408 GID Size 04 (4) │ │ │ │ +43409 GID 00000000 (0) │ │ │ │ +4340D PAYLOAD │ │ │ │ + │ │ │ │ +44CDD LOCAL HEADER #40 04034B50 (67324752) │ │ │ │ +44CE1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +44CE2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +44CE3 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +44CE5 Compression Method 0008 (8) 'Deflated' │ │ │ │ +44CE7 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +44CEB CRC 59BC913A (1505530170) │ │ │ │ +44CEF Compressed Size 000003F7 (1015) │ │ │ │ +44CF3 Uncompressed Size 000008A3 (2211) │ │ │ │ +44CF7 Filename Length 001E (30) │ │ │ │ +44CF9 Extra Length 001C (28) │ │ │ │ +44CFB Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x44CFB: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +44D19 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +44D1B Length 0009 (9) │ │ │ │ +44D1D Flags 03 (3) 'Modification Access' │ │ │ │ +44D1E Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +44D22 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +44D26 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +44D28 Length 000B (11) │ │ │ │ +44D2A Version 01 (1) │ │ │ │ +44D2B UID Size 04 (4) │ │ │ │ +44D2C UID 00000000 (0) │ │ │ │ +44D30 GID Size 04 (4) │ │ │ │ +44D31 GID 00000000 (0) │ │ │ │ +44D35 PAYLOAD │ │ │ │ + │ │ │ │ +4512C LOCAL HEADER #41 04034B50 (67324752) │ │ │ │ +45130 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +45131 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +45132 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +45134 Compression Method 0008 (8) 'Deflated' │ │ │ │ +45136 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +4513A CRC 1C972FAC (479670188) │ │ │ │ +4513E Compressed Size 00004293 (17043) │ │ │ │ +45142 Uncompressed Size 0000D8DC (55516) │ │ │ │ +45146 Filename Length 0013 (19) │ │ │ │ +45148 Extra Length 001C (28) │ │ │ │ +4514A Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x4514A: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +4515D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +4515F Length 0009 (9) │ │ │ │ +45161 Flags 03 (3) 'Modification Access' │ │ │ │ +45162 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +45166 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4516A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +4516C Length 000B (11) │ │ │ │ +4516E Version 01 (1) │ │ │ │ +4516F UID Size 04 (4) │ │ │ │ +45170 UID 00000000 (0) │ │ │ │ +45174 GID Size 04 (4) │ │ │ │ +45175 GID 00000000 (0) │ │ │ │ +45179 PAYLOAD │ │ │ │ + │ │ │ │ +4940C LOCAL HEADER #42 04034B50 (67324752) │ │ │ │ +49410 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +49411 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +49412 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +49414 Compression Method 0008 (8) 'Deflated' │ │ │ │ +49416 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +4941A CRC E2874F49 (3800518473) │ │ │ │ +4941E Compressed Size 000026C5 (9925) │ │ │ │ +49422 Uncompressed Size 00006E45 (28229) │ │ │ │ +49426 Filename Length 0019 (25) │ │ │ │ +49428 Extra Length 001C (28) │ │ │ │ +4942A Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x4942A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +49443 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +49445 Length 0009 (9) │ │ │ │ +49447 Flags 03 (3) 'Modification Access' │ │ │ │ +49448 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4944C Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +49450 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +49452 Length 000B (11) │ │ │ │ +49454 Version 01 (1) │ │ │ │ +49455 UID Size 04 (4) │ │ │ │ +49456 UID 00000000 (0) │ │ │ │ +4945A GID Size 04 (4) │ │ │ │ +4945B GID 00000000 (0) │ │ │ │ +4945F PAYLOAD │ │ │ │ + │ │ │ │ +4BB24 LOCAL HEADER #43 04034B50 (67324752) │ │ │ │ +4BB28 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +4BB29 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +4BB2A General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +4BB2C Compression Method 0008 (8) 'Deflated' │ │ │ │ +4BB2E Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +4BB32 CRC 8AC46E96 (2328129174) │ │ │ │ +4BB36 Compressed Size 00002739 (10041) │ │ │ │ +4BB3A Uncompressed Size 00008B83 (35715) │ │ │ │ +4BB3E Filename Length 0019 (25) │ │ │ │ +4BB40 Extra Length 001C (28) │ │ │ │ +4BB42 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x4BB42: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +4BB5B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +4BB5D Length 0009 (9) │ │ │ │ +4BB5F Flags 03 (3) 'Modification Access' │ │ │ │ +4BB60 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4BB64 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4BB68 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +4BB6A Length 000B (11) │ │ │ │ +4BB6C Version 01 (1) │ │ │ │ +4BB6D UID Size 04 (4) │ │ │ │ +4BB6E UID 00000000 (0) │ │ │ │ +4BB72 GID Size 04 (4) │ │ │ │ +4BB73 GID 00000000 (0) │ │ │ │ +4BB77 PAYLOAD │ │ │ │ + │ │ │ │ +4E2B0 LOCAL HEADER #44 04034B50 (67324752) │ │ │ │ +4E2B4 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +4E2B5 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +4E2B6 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +4E2B8 Compression Method 0008 (8) 'Deflated' │ │ │ │ +4E2BA Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +4E2BE CRC 331975F0 (857306608) │ │ │ │ +4E2C2 Compressed Size 00000CF0 (3312) │ │ │ │ +4E2C6 Uncompressed Size 0000517A (20858) │ │ │ │ +4E2CA Filename Length 0021 (33) │ │ │ │ +4E2CC Extra Length 001C (28) │ │ │ │ +4E2CE Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x4E2CE: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +4E2EF Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +4E2F1 Length 0009 (9) │ │ │ │ +4E2F3 Flags 03 (3) 'Modification Access' │ │ │ │ +4E2F4 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4E2F8 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4E2FC Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +4E2FE Length 000B (11) │ │ │ │ +4E300 Version 01 (1) │ │ │ │ +4E301 UID Size 04 (4) │ │ │ │ +4E302 UID 00000000 (0) │ │ │ │ +4E306 GID Size 04 (4) │ │ │ │ +4E307 GID 00000000 (0) │ │ │ │ +4E30B PAYLOAD │ │ │ │ + │ │ │ │ +4EFFB LOCAL HEADER #45 04034B50 (67324752) │ │ │ │ +4EFFF Extract Zip Spec 14 (20) '2.0' │ │ │ │ +4F000 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +4F001 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +4F003 Compression Method 0008 (8) 'Deflated' │ │ │ │ +4F005 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +4F009 CRC 0463353E (73610558) │ │ │ │ +4F00D Compressed Size 00000468 (1128) │ │ │ │ +4F011 Uncompressed Size 00000931 (2353) │ │ │ │ +4F015 Filename Length 001B (27) │ │ │ │ +4F017 Extra Length 001C (28) │ │ │ │ +4F019 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x4F019: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +4F034 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +4F036 Length 0009 (9) │ │ │ │ +4F038 Flags 03 (3) 'Modification Access' │ │ │ │ +4F039 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4F03D Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4F041 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +4F043 Length 000B (11) │ │ │ │ +4F045 Version 01 (1) │ │ │ │ +4F046 UID Size 04 (4) │ │ │ │ +4F047 UID 00000000 (0) │ │ │ │ +4F04B GID Size 04 (4) │ │ │ │ +4F04C GID 00000000 (0) │ │ │ │ +4F050 PAYLOAD │ │ │ │ + │ │ │ │ +4F4B8 LOCAL HEADER #46 04034B50 (67324752) │ │ │ │ +4F4BC Extract Zip Spec 14 (20) '2.0' │ │ │ │ +4F4BD Extract OS 00 (0) 'MS-DOS' │ │ │ │ +4F4BE General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +4F4C0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +4F4C2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +4F4C6 CRC 87EEE08A (2280579210) │ │ │ │ +4F4CA Compressed Size 000016F3 (5875) │ │ │ │ +4F4CE Uncompressed Size 00007A6D (31341) │ │ │ │ +4F4D2 Filename Length 001F (31) │ │ │ │ +4F4D4 Extra Length 001C (28) │ │ │ │ +4F4D6 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x4F4D6: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +4F4F5 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +4F4F7 Length 0009 (9) │ │ │ │ +4F4F9 Flags 03 (3) 'Modification Access' │ │ │ │ +4F4FA Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4F4FE Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +4F502 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +4F504 Length 000B (11) │ │ │ │ +4F506 Version 01 (1) │ │ │ │ +4F507 UID Size 04 (4) │ │ │ │ +4F508 UID 00000000 (0) │ │ │ │ +4F50C GID Size 04 (4) │ │ │ │ +4F50D GID 00000000 (0) │ │ │ │ +4F511 PAYLOAD │ │ │ │ + │ │ │ │ +50C04 LOCAL HEADER #47 04034B50 (67324752) │ │ │ │ +50C08 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +50C09 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +50C0A General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +50C0C Compression Method 0008 (8) 'Deflated' │ │ │ │ +50C0E Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +50C12 CRC 936CB7B6 (2473375670) │ │ │ │ +50C16 Compressed Size 00004170 (16752) │ │ │ │ +50C1A Uncompressed Size 0001CF93 (118675) │ │ │ │ +50C1E Filename Length 0010 (16) │ │ │ │ +50C20 Extra Length 001C (28) │ │ │ │ +50C22 Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x50C22: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +50C32 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +50C34 Length 0009 (9) │ │ │ │ +50C36 Flags 03 (3) 'Modification Access' │ │ │ │ +50C37 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +50C3B Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +50C3F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +50C41 Length 000B (11) │ │ │ │ +50C43 Version 01 (1) │ │ │ │ +50C44 UID Size 04 (4) │ │ │ │ +50C45 UID 00000000 (0) │ │ │ │ +50C49 GID Size 04 (4) │ │ │ │ +50C4A GID 00000000 (0) │ │ │ │ +50C4E PAYLOAD │ │ │ │ + │ │ │ │ +54DBE LOCAL HEADER #48 04034B50 (67324752) │ │ │ │ +54DC2 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +54DC3 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +54DC4 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +54DC6 Compression Method 0008 (8) 'Deflated' │ │ │ │ +54DC8 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +54DCC CRC 1D57686C (492267628) │ │ │ │ +54DD0 Compressed Size 00000A93 (2707) │ │ │ │ +54DD4 Uncompressed Size 00002105 (8453) │ │ │ │ +54DD8 Filename Length 0014 (20) │ │ │ │ +54DDA Extra Length 001C (28) │ │ │ │ +54DDC Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x54DDC: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +54DF0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +54DF2 Length 0009 (9) │ │ │ │ +54DF4 Flags 03 (3) 'Modification Access' │ │ │ │ +54DF5 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +54DF9 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +54DFD Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +54DFF Length 000B (11) │ │ │ │ +54E01 Version 01 (1) │ │ │ │ +54E02 UID Size 04 (4) │ │ │ │ +54E03 UID 00000000 (0) │ │ │ │ +54E07 GID Size 04 (4) │ │ │ │ +54E08 GID 00000000 (0) │ │ │ │ +54E0C PAYLOAD │ │ │ │ + │ │ │ │ +5589F LOCAL HEADER #49 04034B50 (67324752) │ │ │ │ +558A3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +558A4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +558A5 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +558A7 Compression Method 0008 (8) 'Deflated' │ │ │ │ +558A9 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +558AD CRC 39338677 (959678071) │ │ │ │ +558B1 Compressed Size 0000ACA1 (44193) │ │ │ │ +558B5 Uncompressed Size 0003E418 (255000) │ │ │ │ +558B9 Filename Length 0017 (23) │ │ │ │ +558BB Extra Length 001C (28) │ │ │ │ +558BD Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x558BD: Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +558D4 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +558D6 Length 0009 (9) │ │ │ │ +558D8 Flags 03 (3) 'Modification Access' │ │ │ │ +558D9 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +558DD Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +558E1 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +558E3 Length 000B (11) │ │ │ │ +558E5 Version 01 (1) │ │ │ │ +558E6 UID Size 04 (4) │ │ │ │ +558E7 UID 00000000 (0) │ │ │ │ +558EB GID Size 04 (4) │ │ │ │ +558EC GID 00000000 (0) │ │ │ │ +558F0 PAYLOAD │ │ │ │ + │ │ │ │ +60591 LOCAL HEADER #50 04034B50 (67324752) │ │ │ │ +60595 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +60596 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +60597 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +60599 Compression Method 0008 (8) 'Deflated' │ │ │ │ +6059B Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +6059F CRC AAB1E936 (2863786294) │ │ │ │ +605A3 Compressed Size 00000401 (1025) │ │ │ │ +605A7 Uncompressed Size 0000093D (2365) │ │ │ │ +605AB Filename Length 0013 (19) │ │ │ │ +605AD Extra Length 001C (28) │ │ │ │ +605AF Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x605AF: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +605C2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +605C4 Length 0009 (9) │ │ │ │ +605C6 Flags 03 (3) 'Modification Access' │ │ │ │ +605C7 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +605CB Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +605CF Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +605D1 Length 000B (11) │ │ │ │ +605D3 Version 01 (1) │ │ │ │ +605D4 UID Size 04 (4) │ │ │ │ +605D5 UID 00000000 (0) │ │ │ │ +605D9 GID Size 04 (4) │ │ │ │ +605DA GID 00000000 (0) │ │ │ │ +605DE PAYLOAD │ │ │ │ + │ │ │ │ +609DF LOCAL HEADER #51 04034B50 (67324752) │ │ │ │ +609E3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +609E4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +609E5 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +609E7 Compression Method 0008 (8) 'Deflated' │ │ │ │ +609E9 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +609ED CRC 766E7C2E (1986952238) │ │ │ │ +609F1 Compressed Size 000014E6 (5350) │ │ │ │ +609F5 Uncompressed Size 0000687B (26747) │ │ │ │ +609F9 Filename Length 0012 (18) │ │ │ │ +609FB Extra Length 001C (28) │ │ │ │ +609FD Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x609FD: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +60A0F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +60A11 Length 0009 (9) │ │ │ │ +60A13 Flags 03 (3) 'Modification Access' │ │ │ │ +60A14 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +60A18 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +60A1C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +60A1E Length 000B (11) │ │ │ │ +60A20 Version 01 (1) │ │ │ │ +60A21 UID Size 04 (4) │ │ │ │ +60A22 UID 00000000 (0) │ │ │ │ +60A26 GID Size 04 (4) │ │ │ │ +60A27 GID 00000000 (0) │ │ │ │ +60A2B PAYLOAD │ │ │ │ + │ │ │ │ +61F11 LOCAL HEADER #52 04034B50 (67324752) │ │ │ │ +61F15 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +61F16 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +61F17 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +61F19 Compression Method 0008 (8) 'Deflated' │ │ │ │ +61F1B Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +61F1F CRC A23B6E88 (2721803912) │ │ │ │ +61F23 Compressed Size 000011EB (4587) │ │ │ │ +61F27 Uncompressed Size 000040F5 (16629) │ │ │ │ +61F2B Filename Length 0012 (18) │ │ │ │ +61F2D Extra Length 001C (28) │ │ │ │ +61F2F Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x61F2F: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +61F41 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +61F43 Length 0009 (9) │ │ │ │ +61F45 Flags 03 (3) 'Modification Access' │ │ │ │ +61F46 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +61F4A Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +61F4E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +61F50 Length 000B (11) │ │ │ │ +61F52 Version 01 (1) │ │ │ │ +61F53 UID Size 04 (4) │ │ │ │ +61F54 UID 00000000 (0) │ │ │ │ +61F58 GID Size 04 (4) │ │ │ │ +61F59 GID 00000000 (0) │ │ │ │ +61F5D PAYLOAD │ │ │ │ + │ │ │ │ +63148 LOCAL HEADER #53 04034B50 (67324752) │ │ │ │ +6314C Extract Zip Spec 14 (20) '2.0' │ │ │ │ +6314D Extract OS 00 (0) 'MS-DOS' │ │ │ │ +6314E General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +63150 Compression Method 0008 (8) 'Deflated' │ │ │ │ +63152 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +63156 CRC B74DC8B5 (3075328181) │ │ │ │ +6315A Compressed Size 000009DA (2522) │ │ │ │ +6315E Uncompressed Size 00003529 (13609) │ │ │ │ +63162 Filename Length 0019 (25) │ │ │ │ +63164 Extra Length 001C (28) │ │ │ │ +63166 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x63166: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +6317F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +63181 Length 0009 (9) │ │ │ │ +63183 Flags 03 (3) 'Modification Access' │ │ │ │ +63184 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +63188 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6318C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +6318E Length 000B (11) │ │ │ │ +63190 Version 01 (1) │ │ │ │ +63191 UID Size 04 (4) │ │ │ │ +63192 UID 00000000 (0) │ │ │ │ +63196 GID Size 04 (4) │ │ │ │ +63197 GID 00000000 (0) │ │ │ │ +6319B PAYLOAD │ │ │ │ + │ │ │ │ +63B75 LOCAL HEADER #54 04034B50 (67324752) │ │ │ │ +63B79 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +63B7A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +63B7B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +63B7D Compression Method 0008 (8) 'Deflated' │ │ │ │ +63B7F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +63B83 CRC FADEA3F2 (4208894962) │ │ │ │ +63B87 Compressed Size 000018B3 (6323) │ │ │ │ +63B8B Uncompressed Size 0000A605 (42501) │ │ │ │ +63B8F Filename Length 0019 (25) │ │ │ │ +63B91 Extra Length 001C (28) │ │ │ │ +63B93 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x63B93: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +63BAC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +63BAE Length 0009 (9) │ │ │ │ +63BB0 Flags 03 (3) 'Modification Access' │ │ │ │ +63BB1 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +63BB5 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +63BB9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +63BBB Length 000B (11) │ │ │ │ +63BBD Version 01 (1) │ │ │ │ +63BBE UID Size 04 (4) │ │ │ │ +63BBF UID 00000000 (0) │ │ │ │ +63BC3 GID Size 04 (4) │ │ │ │ +63BC4 GID 00000000 (0) │ │ │ │ +63BC8 PAYLOAD │ │ │ │ + │ │ │ │ +6547B LOCAL HEADER #55 04034B50 (67324752) │ │ │ │ +6547F Extract Zip Spec 14 (20) '2.0' │ │ │ │ +65480 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +65481 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +65483 Compression Method 0008 (8) 'Deflated' │ │ │ │ +65485 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +65489 CRC D193B2B7 (3516117687) │ │ │ │ +6548D Compressed Size 0000177E (6014) │ │ │ │ +65491 Uncompressed Size 0000472C (18220) │ │ │ │ +65495 Filename Length 0014 (20) │ │ │ │ +65497 Extra Length 001C (28) │ │ │ │ +65499 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x65499: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +654AD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +654AF Length 0009 (9) │ │ │ │ +654B1 Flags 03 (3) 'Modification Access' │ │ │ │ +654B2 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +654B6 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +654BA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +654BC Length 000B (11) │ │ │ │ +654BE Version 01 (1) │ │ │ │ +654BF UID Size 04 (4) │ │ │ │ +654C0 UID 00000000 (0) │ │ │ │ +654C4 GID Size 04 (4) │ │ │ │ +654C5 GID 00000000 (0) │ │ │ │ +654C9 PAYLOAD │ │ │ │ + │ │ │ │ +66C47 LOCAL HEADER #56 04034B50 (67324752) │ │ │ │ +66C4B Extract Zip Spec 14 (20) '2.0' │ │ │ │ +66C4C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +66C4D General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +66C4F Compression Method 0008 (8) 'Deflated' │ │ │ │ +66C51 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +66C55 CRC 85800620 (2239759904) │ │ │ │ +66C59 Compressed Size 0000040B (1035) │ │ │ │ +66C5D Uncompressed Size 00000825 (2085) │ │ │ │ +66C61 Filename Length 001C (28) │ │ │ │ +66C63 Extra Length 001C (28) │ │ │ │ +66C65 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x66C65: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +66C81 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +66C83 Length 0009 (9) │ │ │ │ +66C85 Flags 03 (3) 'Modification Access' │ │ │ │ +66C86 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +66C8A Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +66C8E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +66C90 Length 000B (11) │ │ │ │ +66C92 Version 01 (1) │ │ │ │ +66C93 UID Size 04 (4) │ │ │ │ +66C94 UID 00000000 (0) │ │ │ │ +66C98 GID Size 04 (4) │ │ │ │ +66C99 GID 00000000 (0) │ │ │ │ +66C9D PAYLOAD │ │ │ │ + │ │ │ │ +670A8 LOCAL HEADER #57 04034B50 (67324752) │ │ │ │ +670AC Extract Zip Spec 14 (20) '2.0' │ │ │ │ +670AD Extract OS 00 (0) 'MS-DOS' │ │ │ │ +670AE General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +670B0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +670B2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +670B6 CRC FC7A4A6B (4235872875) │ │ │ │ +670BA Compressed Size 00002482 (9346) │ │ │ │ +670BE Uncompressed Size 0000B56F (46447) │ │ │ │ +670C2 Filename Length 001F (31) │ │ │ │ +670C4 Extra Length 001C (28) │ │ │ │ +670C6 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x670C6: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +670E5 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +670E7 Length 0009 (9) │ │ │ │ +670E9 Flags 03 (3) 'Modification Access' │ │ │ │ +670EA Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +670EE Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +670F2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +670F4 Length 000B (11) │ │ │ │ +670F6 Version 01 (1) │ │ │ │ +670F7 UID Size 04 (4) │ │ │ │ +670F8 UID 00000000 (0) │ │ │ │ +670FC GID Size 04 (4) │ │ │ │ +670FD GID 00000000 (0) │ │ │ │ +67101 PAYLOAD │ │ │ │ + │ │ │ │ +69583 LOCAL HEADER #58 04034B50 (67324752) │ │ │ │ +69587 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +69588 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +69589 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +6958B Compression Method 0008 (8) 'Deflated' │ │ │ │ +6958D Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +69591 CRC 80A4F66C (2158294636) │ │ │ │ +69595 Compressed Size 00000E7E (3710) │ │ │ │ +69599 Uncompressed Size 000052D9 (21209) │ │ │ │ +6959D Filename Length 001F (31) │ │ │ │ +6959F Extra Length 001C (28) │ │ │ │ +695A1 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x695A1: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +695C0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +695C2 Length 0009 (9) │ │ │ │ +695C4 Flags 03 (3) 'Modification Access' │ │ │ │ +695C5 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +695C9 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +695CD Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +695CF Length 000B (11) │ │ │ │ +695D1 Version 01 (1) │ │ │ │ +695D2 UID Size 04 (4) │ │ │ │ +695D3 UID 00000000 (0) │ │ │ │ +695D7 GID Size 04 (4) │ │ │ │ +695D8 GID 00000000 (0) │ │ │ │ +695DC PAYLOAD │ │ │ │ + │ │ │ │ +6A45A LOCAL HEADER #59 04034B50 (67324752) │ │ │ │ +6A45E Extract Zip Spec 14 (20) '2.0' │ │ │ │ +6A45F Extract OS 00 (0) 'MS-DOS' │ │ │ │ +6A460 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +6A462 Compression Method 0008 (8) 'Deflated' │ │ │ │ +6A464 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +6A468 CRC 89B6DCE4 (2310462692) │ │ │ │ +6A46C Compressed Size 00000A45 (2629) │ │ │ │ +6A470 Uncompressed Size 0000247A (9338) │ │ │ │ +6A474 Filename Length 0013 (19) │ │ │ │ +6A476 Extra Length 001C (28) │ │ │ │ +6A478 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x6A478: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +6A48B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +6A48D Length 0009 (9) │ │ │ │ +6A48F Flags 03 (3) 'Modification Access' │ │ │ │ +6A490 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6A494 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6A498 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +6A49A Length 000B (11) │ │ │ │ +6A49C Version 01 (1) │ │ │ │ +6A49D UID Size 04 (4) │ │ │ │ +6A49E UID 00000000 (0) │ │ │ │ +6A4A2 GID Size 04 (4) │ │ │ │ +6A4A3 GID 00000000 (0) │ │ │ │ +6A4A7 PAYLOAD │ │ │ │ + │ │ │ │ +6AEEC LOCAL HEADER #60 04034B50 (67324752) │ │ │ │ +6AEF0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +6AEF1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +6AEF2 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +6AEF4 Compression Method 0008 (8) 'Deflated' │ │ │ │ +6AEF6 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +6AEFA CRC 88B4664B (2293524043) │ │ │ │ +6AEFE Compressed Size 0000248A (9354) │ │ │ │ +6AF02 Uncompressed Size 0000B84C (47180) │ │ │ │ +6AF06 Filename Length 0019 (25) │ │ │ │ +6AF08 Extra Length 001C (28) │ │ │ │ +6AF0A Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x6AF0A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +6AF23 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +6AF25 Length 0009 (9) │ │ │ │ +6AF27 Flags 03 (3) 'Modification Access' │ │ │ │ +6AF28 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6AF2C Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6AF30 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +6AF32 Length 000B (11) │ │ │ │ +6AF34 Version 01 (1) │ │ │ │ +6AF35 UID Size 04 (4) │ │ │ │ +6AF36 UID 00000000 (0) │ │ │ │ +6AF3A GID Size 04 (4) │ │ │ │ +6AF3B GID 00000000 (0) │ │ │ │ +6AF3F PAYLOAD │ │ │ │ + │ │ │ │ +6D3C9 LOCAL HEADER #61 04034B50 (67324752) │ │ │ │ +6D3CD Extract Zip Spec 14 (20) '2.0' │ │ │ │ +6D3CE Extract OS 00 (0) 'MS-DOS' │ │ │ │ +6D3CF General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +6D3D1 Compression Method 0008 (8) 'Deflated' │ │ │ │ +6D3D3 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +6D3D7 CRC 75B88221 (1975026209) │ │ │ │ +6D3DB Compressed Size 00000EF8 (3832) │ │ │ │ +6D3DF Uncompressed Size 00003A2C (14892) │ │ │ │ +6D3E3 Filename Length 0024 (36) │ │ │ │ +6D3E5 Extra Length 001C (28) │ │ │ │ +6D3E7 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x6D3E7: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +6D40B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +6D40D Length 0009 (9) │ │ │ │ +6D40F Flags 03 (3) 'Modification Access' │ │ │ │ +6D410 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6D414 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6D418 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +6D41A Length 000B (11) │ │ │ │ +6D41C Version 01 (1) │ │ │ │ +6D41D UID Size 04 (4) │ │ │ │ +6D41E UID 00000000 (0) │ │ │ │ +6D422 GID Size 04 (4) │ │ │ │ +6D423 GID 00000000 (0) │ │ │ │ +6D427 PAYLOAD │ │ │ │ + │ │ │ │ +6E31F LOCAL HEADER #62 04034B50 (67324752) │ │ │ │ +6E323 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +6E324 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +6E325 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +6E327 Compression Method 0008 (8) 'Deflated' │ │ │ │ +6E329 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +6E32D CRC 7318E4E5 (1931011301) │ │ │ │ +6E331 Compressed Size 00001AC0 (6848) │ │ │ │ +6E335 Uncompressed Size 00005EDC (24284) │ │ │ │ +6E339 Filename Length 0017 (23) │ │ │ │ +6E33B Extra Length 001C (28) │ │ │ │ +6E33D Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x6E33D: Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +6E354 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +6E356 Length 0009 (9) │ │ │ │ +6E358 Flags 03 (3) 'Modification Access' │ │ │ │ +6E359 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6E35D Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6E361 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +6E363 Length 000B (11) │ │ │ │ +6E365 Version 01 (1) │ │ │ │ +6E366 UID Size 04 (4) │ │ │ │ +6E367 UID 00000000 (0) │ │ │ │ +6E36B GID Size 04 (4) │ │ │ │ +6E36C GID 00000000 (0) │ │ │ │ +6E370 PAYLOAD │ │ │ │ + │ │ │ │ +6FE30 LOCAL HEADER #63 04034B50 (67324752) │ │ │ │ +6FE34 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +6FE35 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +6FE36 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +6FE38 Compression Method 0008 (8) 'Deflated' │ │ │ │ +6FE3A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +6FE3E CRC 11E32AF1 (300100337) │ │ │ │ +6FE42 Compressed Size 00000ED3 (3795) │ │ │ │ +6FE46 Uncompressed Size 000038E2 (14562) │ │ │ │ +6FE4A Filename Length 0023 (35) │ │ │ │ +6FE4C Extra Length 001C (28) │ │ │ │ +6FE4E Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x6FE4E: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +6FE71 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +6FE73 Length 0009 (9) │ │ │ │ +6FE75 Flags 03 (3) 'Modification Access' │ │ │ │ +6FE76 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6FE7A Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +6FE7E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +6FE80 Length 000B (11) │ │ │ │ +6FE82 Version 01 (1) │ │ │ │ +6FE83 UID Size 04 (4) │ │ │ │ +6FE84 UID 00000000 (0) │ │ │ │ +6FE88 GID Size 04 (4) │ │ │ │ +6FE89 GID 00000000 (0) │ │ │ │ +6FE8D PAYLOAD │ │ │ │ + │ │ │ │ +70D60 LOCAL HEADER #64 04034B50 (67324752) │ │ │ │ +70D64 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +70D65 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +70D66 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +70D68 Compression Method 0008 (8) 'Deflated' │ │ │ │ +70D6A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +70D6E CRC 2DB7929F (767005343) │ │ │ │ +70D72 Compressed Size 00000113 (275) │ │ │ │ +70D76 Uncompressed Size 000001F3 (499) │ │ │ │ +70D7A Filename Length 001B (27) │ │ │ │ +70D7C Extra Length 001C (28) │ │ │ │ +70D7E Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x70D7E: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +70D99 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +70D9B Length 0009 (9) │ │ │ │ +70D9D Flags 03 (3) 'Modification Access' │ │ │ │ +70D9E Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +70DA2 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +70DA6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +70DA8 Length 000B (11) │ │ │ │ +70DAA Version 01 (1) │ │ │ │ +70DAB UID Size 04 (4) │ │ │ │ +70DAC UID 00000000 (0) │ │ │ │ +70DB0 GID Size 04 (4) │ │ │ │ +70DB1 GID 00000000 (0) │ │ │ │ +70DB5 PAYLOAD │ │ │ │ + │ │ │ │ +70EC8 LOCAL HEADER #65 04034B50 (67324752) │ │ │ │ +70ECC Extract Zip Spec 14 (20) '2.0' │ │ │ │ +70ECD Extract OS 00 (0) 'MS-DOS' │ │ │ │ +70ECE General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +70ED0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +70ED2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +70ED6 CRC 75F3F7DB (1978922971) │ │ │ │ +70EDA Compressed Size 0000188E (6286) │ │ │ │ +70EDE Uncompressed Size 00008FAC (36780) │ │ │ │ +70EE2 Filename Length 001D (29) │ │ │ │ +70EE4 Extra Length 001C (28) │ │ │ │ +70EE6 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x70EE6: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +70F03 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +70F05 Length 0009 (9) │ │ │ │ +70F07 Flags 03 (3) 'Modification Access' │ │ │ │ +70F08 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +70F0C Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +70F10 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +70F12 Length 000B (11) │ │ │ │ +70F14 Version 01 (1) │ │ │ │ +70F15 UID Size 04 (4) │ │ │ │ +70F16 UID 00000000 (0) │ │ │ │ +70F1A GID Size 04 (4) │ │ │ │ +70F1B GID 00000000 (0) │ │ │ │ +70F1F PAYLOAD │ │ │ │ + │ │ │ │ +727AD LOCAL HEADER #66 04034B50 (67324752) │ │ │ │ +727B1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +727B2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +727B3 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +727B5 Compression Method 0008 (8) 'Deflated' │ │ │ │ +727B7 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +727BB CRC BFC41586 (3217298822) │ │ │ │ +727BF Compressed Size 0000164D (5709) │ │ │ │ +727C3 Uncompressed Size 00003A9B (15003) │ │ │ │ +727C7 Filename Length 0015 (21) │ │ │ │ +727C9 Extra Length 001C (28) │ │ │ │ +727CB Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x727CB: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +727E0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +727E2 Length 0009 (9) │ │ │ │ +727E4 Flags 03 (3) 'Modification Access' │ │ │ │ +727E5 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +727E9 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +727ED Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +727EF Length 000B (11) │ │ │ │ +727F1 Version 01 (1) │ │ │ │ +727F2 UID Size 04 (4) │ │ │ │ +727F3 UID 00000000 (0) │ │ │ │ +727F7 GID Size 04 (4) │ │ │ │ +727F8 GID 00000000 (0) │ │ │ │ +727FC PAYLOAD │ │ │ │ + │ │ │ │ +73E49 LOCAL HEADER #67 04034B50 (67324752) │ │ │ │ +73E4D Extract Zip Spec 14 (20) '2.0' │ │ │ │ +73E4E Extract OS 00 (0) 'MS-DOS' │ │ │ │ +73E4F General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +73E51 Compression Method 0008 (8) 'Deflated' │ │ │ │ +73E53 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +73E57 CRC 03068C70 (50760816) │ │ │ │ +73E5B Compressed Size 00003B4C (15180) │ │ │ │ +73E5F Uncompressed Size 0001185B (71771) │ │ │ │ +73E63 Filename Length 0016 (22) │ │ │ │ +73E65 Extra Length 001C (28) │ │ │ │ +73E67 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x73E67: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +73E7D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +73E7F Length 0009 (9) │ │ │ │ +73E81 Flags 03 (3) 'Modification Access' │ │ │ │ +73E82 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +73E86 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +73E8A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +73E8C Length 000B (11) │ │ │ │ +73E8E Version 01 (1) │ │ │ │ +73E8F UID Size 04 (4) │ │ │ │ +73E90 UID 00000000 (0) │ │ │ │ +73E94 GID Size 04 (4) │ │ │ │ +73E95 GID 00000000 (0) │ │ │ │ +73E99 PAYLOAD │ │ │ │ + │ │ │ │ +779E5 LOCAL HEADER #68 04034B50 (67324752) │ │ │ │ +779E9 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +779EA Extract OS 00 (0) 'MS-DOS' │ │ │ │ +779EB General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +779ED Compression Method 0008 (8) 'Deflated' │ │ │ │ +779EF Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +779F3 CRC A66FBF68 (2792341352) │ │ │ │ +779F7 Compressed Size 00003E84 (16004) │ │ │ │ +779FB Uncompressed Size 0001C17B (115067) │ │ │ │ +779FF Filename Length 0019 (25) │ │ │ │ +77A01 Extra Length 001C (28) │ │ │ │ +77A03 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x77A03: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +77A1C Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +77A1E Length 0009 (9) │ │ │ │ +77A20 Flags 03 (3) 'Modification Access' │ │ │ │ +77A21 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +77A25 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +77A29 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +77A2B Length 000B (11) │ │ │ │ +77A2D Version 01 (1) │ │ │ │ +77A2E UID Size 04 (4) │ │ │ │ +77A2F UID 00000000 (0) │ │ │ │ +77A33 GID Size 04 (4) │ │ │ │ +77A34 GID 00000000 (0) │ │ │ │ +77A38 PAYLOAD │ │ │ │ + │ │ │ │ +7B8BC LOCAL HEADER #69 04034B50 (67324752) │ │ │ │ +7B8C0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +7B8C1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +7B8C2 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +7B8C4 Compression Method 0008 (8) 'Deflated' │ │ │ │ +7B8C6 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +7B8CA CRC F178C158 (4051222872) │ │ │ │ +7B8CE Compressed Size 0000083B (2107) │ │ │ │ +7B8D2 Uncompressed Size 00003383 (13187) │ │ │ │ +7B8D6 Filename Length 0011 (17) │ │ │ │ +7B8D8 Extra Length 001C (28) │ │ │ │ +7B8DA Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x7B8DA: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +7B8EB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +7B8ED Length 0009 (9) │ │ │ │ +7B8EF Flags 03 (3) 'Modification Access' │ │ │ │ +7B8F0 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +7B8F4 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +7B8F8 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +7B8FA Length 000B (11) │ │ │ │ +7B8FC Version 01 (1) │ │ │ │ +7B8FD UID Size 04 (4) │ │ │ │ +7B8FE UID 00000000 (0) │ │ │ │ +7B902 GID Size 04 (4) │ │ │ │ +7B903 GID 00000000 (0) │ │ │ │ +7B907 PAYLOAD │ │ │ │ + │ │ │ │ +7C142 LOCAL HEADER #70 04034B50 (67324752) │ │ │ │ +7C146 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +7C147 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +7C148 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +7C14A Compression Method 0008 (8) 'Deflated' │ │ │ │ +7C14C Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +7C150 CRC B51C9A39 (3038550585) │ │ │ │ +7C154 Compressed Size 00005186 (20870) │ │ │ │ +7C158 Uncompressed Size 0001FB6C (129900) │ │ │ │ +7C15C Filename Length 0015 (21) │ │ │ │ +7C15E Extra Length 001C (28) │ │ │ │ +7C160 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x7C160: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +7C175 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +7C177 Length 0009 (9) │ │ │ │ +7C179 Flags 03 (3) 'Modification Access' │ │ │ │ +7C17A Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +7C17E Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +7C182 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +7C184 Length 000B (11) │ │ │ │ +7C186 Version 01 (1) │ │ │ │ +7C187 UID Size 04 (4) │ │ │ │ +7C188 UID 00000000 (0) │ │ │ │ +7C18C GID Size 04 (4) │ │ │ │ +7C18D GID 00000000 (0) │ │ │ │ +7C191 PAYLOAD │ │ │ │ + │ │ │ │ +81317 LOCAL HEADER #71 04034B50 (67324752) │ │ │ │ +8131B Extract Zip Spec 14 (20) '2.0' │ │ │ │ +8131C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +8131D General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +8131F Compression Method 0008 (8) 'Deflated' │ │ │ │ +81321 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +81325 CRC F4A29658 (4104296024) │ │ │ │ +81329 Compressed Size 00001B08 (6920) │ │ │ │ +8132D Uncompressed Size 000081CF (33231) │ │ │ │ +81331 Filename Length 0019 (25) │ │ │ │ +81333 Extra Length 001C (28) │ │ │ │ +81335 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x81335: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +8134E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +81350 Length 0009 (9) │ │ │ │ +81352 Flags 03 (3) 'Modification Access' │ │ │ │ +81353 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +81357 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8135B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +8135D Length 000B (11) │ │ │ │ +8135F Version 01 (1) │ │ │ │ +81360 UID Size 04 (4) │ │ │ │ +81361 UID 00000000 (0) │ │ │ │ +81365 GID Size 04 (4) │ │ │ │ +81366 GID 00000000 (0) │ │ │ │ +8136A PAYLOAD │ │ │ │ + │ │ │ │ +82E72 LOCAL HEADER #72 04034B50 (67324752) │ │ │ │ +82E76 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +82E77 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +82E78 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +82E7A Compression Method 0008 (8) 'Deflated' │ │ │ │ +82E7C Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +82E80 CRC 30082DE4 (805842404) │ │ │ │ +82E84 Compressed Size 00000D96 (3478) │ │ │ │ +82E88 Uncompressed Size 00002E9F (11935) │ │ │ │ +82E8C Filename Length 0018 (24) │ │ │ │ +82E8E Extra Length 001C (28) │ │ │ │ +82E90 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x82E90: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +82EA8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +82EAA Length 0009 (9) │ │ │ │ +82EAC Flags 03 (3) 'Modification Access' │ │ │ │ +82EAD Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +82EB1 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +82EB5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +82EB7 Length 000B (11) │ │ │ │ +82EB9 Version 01 (1) │ │ │ │ +82EBA UID Size 04 (4) │ │ │ │ +82EBB UID 00000000 (0) │ │ │ │ +82EBF GID Size 04 (4) │ │ │ │ +82EC0 GID 00000000 (0) │ │ │ │ +82EC4 PAYLOAD │ │ │ │ + │ │ │ │ +83C5A LOCAL HEADER #73 04034B50 (67324752) │ │ │ │ +83C5E Extract Zip Spec 14 (20) '2.0' │ │ │ │ +83C5F Extract OS 00 (0) 'MS-DOS' │ │ │ │ +83C60 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +83C62 Compression Method 0008 (8) 'Deflated' │ │ │ │ +83C64 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +83C68 CRC 0252247A (38937722) │ │ │ │ +83C6C Compressed Size 000001E1 (481) │ │ │ │ +83C70 Uncompressed Size 00000323 (803) │ │ │ │ +83C74 Filename Length 0011 (17) │ │ │ │ +83C76 Extra Length 001C (28) │ │ │ │ +83C78 Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x83C78: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +83C89 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +83C8B Length 0009 (9) │ │ │ │ +83C8D Flags 03 (3) 'Modification Access' │ │ │ │ +83C8E Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +83C92 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +83C96 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +83C98 Length 000B (11) │ │ │ │ +83C9A Version 01 (1) │ │ │ │ +83C9B UID Size 04 (4) │ │ │ │ +83C9C UID 00000000 (0) │ │ │ │ +83CA0 GID Size 04 (4) │ │ │ │ +83CA1 GID 00000000 (0) │ │ │ │ +83CA5 PAYLOAD │ │ │ │ + │ │ │ │ +83E86 LOCAL HEADER #74 04034B50 (67324752) │ │ │ │ +83E8A Extract Zip Spec 14 (20) '2.0' │ │ │ │ +83E8B Extract OS 00 (0) 'MS-DOS' │ │ │ │ +83E8C General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +83E8E Compression Method 0008 (8) 'Deflated' │ │ │ │ +83E90 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +83E94 CRC 05901E89 (93331081) │ │ │ │ +83E98 Compressed Size 000006C2 (1730) │ │ │ │ +83E9C Uncompressed Size 00001439 (5177) │ │ │ │ +83EA0 Filename Length 0019 (25) │ │ │ │ +83EA2 Extra Length 001C (28) │ │ │ │ +83EA4 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x83EA4: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +83EBD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +83EBF Length 0009 (9) │ │ │ │ +83EC1 Flags 03 (3) 'Modification Access' │ │ │ │ +83EC2 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +83EC6 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +83ECA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +83ECC Length 000B (11) │ │ │ │ +83ECE Version 01 (1) │ │ │ │ +83ECF UID Size 04 (4) │ │ │ │ +83ED0 UID 00000000 (0) │ │ │ │ +83ED4 GID Size 04 (4) │ │ │ │ +83ED5 GID 00000000 (0) │ │ │ │ +83ED9 PAYLOAD │ │ │ │ + │ │ │ │ +8459B LOCAL HEADER #75 04034B50 (67324752) │ │ │ │ +8459F Extract Zip Spec 14 (20) '2.0' │ │ │ │ +845A0 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +845A1 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +845A3 Compression Method 0008 (8) 'Deflated' │ │ │ │ +845A5 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +845A9 CRC 473A93FE (1195021310) │ │ │ │ +845AD Compressed Size 00001B8B (7051) │ │ │ │ +845B1 Uncompressed Size 00009F03 (40707) │ │ │ │ +845B5 Filename Length 0018 (24) │ │ │ │ +845B7 Extra Length 001C (28) │ │ │ │ +845B9 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x845B9: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +845D1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +845D3 Length 0009 (9) │ │ │ │ +845D5 Flags 03 (3) 'Modification Access' │ │ │ │ +845D6 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +845DA Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +845DE Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +845E0 Length 000B (11) │ │ │ │ +845E2 Version 01 (1) │ │ │ │ +845E3 UID Size 04 (4) │ │ │ │ +845E4 UID 00000000 (0) │ │ │ │ +845E8 GID Size 04 (4) │ │ │ │ +845E9 GID 00000000 (0) │ │ │ │ +845ED PAYLOAD │ │ │ │ + │ │ │ │ +86178 LOCAL HEADER #76 04034B50 (67324752) │ │ │ │ +8617C Extract Zip Spec 14 (20) '2.0' │ │ │ │ +8617D Extract OS 00 (0) 'MS-DOS' │ │ │ │ +8617E General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +86180 Compression Method 0008 (8) 'Deflated' │ │ │ │ +86182 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +86186 CRC EC5C68E2 (3965479138) │ │ │ │ +8618A Compressed Size 000016FD (5885) │ │ │ │ +8618E Uncompressed Size 00008AB6 (35510) │ │ │ │ +86192 Filename Length 0012 (18) │ │ │ │ +86194 Extra Length 001C (28) │ │ │ │ +86196 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x86196: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +861A8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +861AA Length 0009 (9) │ │ │ │ +861AC Flags 03 (3) 'Modification Access' │ │ │ │ +861AD Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +861B1 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +861B5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +861B7 Length 000B (11) │ │ │ │ +861B9 Version 01 (1) │ │ │ │ +861BA UID Size 04 (4) │ │ │ │ +861BB UID 00000000 (0) │ │ │ │ +861BF GID Size 04 (4) │ │ │ │ +861C0 GID 00000000 (0) │ │ │ │ +861C4 PAYLOAD │ │ │ │ + │ │ │ │ +878C1 LOCAL HEADER #77 04034B50 (67324752) │ │ │ │ +878C5 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +878C6 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +878C7 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +878C9 Compression Method 0008 (8) 'Deflated' │ │ │ │ +878CB Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +878CF CRC BCE56D7C (3169152380) │ │ │ │ +878D3 Compressed Size 00001E11 (7697) │ │ │ │ +878D7 Uncompressed Size 00008803 (34819) │ │ │ │ +878DB Filename Length 0016 (22) │ │ │ │ +878DD Extra Length 001C (28) │ │ │ │ +878DF Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x878DF: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +878F5 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +878F7 Length 0009 (9) │ │ │ │ +878F9 Flags 03 (3) 'Modification Access' │ │ │ │ +878FA Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +878FE Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +87902 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +87904 Length 000B (11) │ │ │ │ +87906 Version 01 (1) │ │ │ │ +87907 UID Size 04 (4) │ │ │ │ +87908 UID 00000000 (0) │ │ │ │ +8790C GID Size 04 (4) │ │ │ │ +8790D GID 00000000 (0) │ │ │ │ +87911 PAYLOAD │ │ │ │ + │ │ │ │ +89722 LOCAL HEADER #78 04034B50 (67324752) │ │ │ │ +89726 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +89727 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +89728 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +8972A Compression Method 0008 (8) 'Deflated' │ │ │ │ +8972C Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +89730 CRC 20D8554A (551048522) │ │ │ │ +89734 Compressed Size 000029A6 (10662) │ │ │ │ +89738 Uncompressed Size 0000D04F (53327) │ │ │ │ +8973C Filename Length 001A (26) │ │ │ │ +8973E Extra Length 001C (28) │ │ │ │ +89740 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x89740: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +8975A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +8975C Length 0009 (9) │ │ │ │ +8975E Flags 03 (3) 'Modification Access' │ │ │ │ +8975F Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +89763 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +89767 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +89769 Length 000B (11) │ │ │ │ +8976B Version 01 (1) │ │ │ │ +8976C UID Size 04 (4) │ │ │ │ +8976D UID 00000000 (0) │ │ │ │ +89771 GID Size 04 (4) │ │ │ │ +89772 GID 00000000 (0) │ │ │ │ +89776 PAYLOAD │ │ │ │ + │ │ │ │ +8C11C LOCAL HEADER #79 04034B50 (67324752) │ │ │ │ +8C120 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +8C121 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +8C122 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +8C124 Compression Method 0008 (8) 'Deflated' │ │ │ │ +8C126 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +8C12A CRC 75E3F6F2 (1977874162) │ │ │ │ +8C12E Compressed Size 000009AC (2476) │ │ │ │ +8C132 Uncompressed Size 00001DB6 (7606) │ │ │ │ +8C136 Filename Length 0018 (24) │ │ │ │ +8C138 Extra Length 001C (28) │ │ │ │ +8C13A Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x8C13A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +8C152 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +8C154 Length 0009 (9) │ │ │ │ +8C156 Flags 03 (3) 'Modification Access' │ │ │ │ +8C157 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8C15B Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8C15F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +8C161 Length 000B (11) │ │ │ │ +8C163 Version 01 (1) │ │ │ │ +8C164 UID Size 04 (4) │ │ │ │ +8C165 UID 00000000 (0) │ │ │ │ +8C169 GID Size 04 (4) │ │ │ │ +8C16A GID 00000000 (0) │ │ │ │ +8C16E PAYLOAD │ │ │ │ + │ │ │ │ +8CB1A LOCAL HEADER #80 04034B50 (67324752) │ │ │ │ +8CB1E Extract Zip Spec 14 (20) '2.0' │ │ │ │ +8CB1F Extract OS 00 (0) 'MS-DOS' │ │ │ │ +8CB20 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +8CB22 Compression Method 0008 (8) 'Deflated' │ │ │ │ +8CB24 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +8CB28 CRC F5E2129F (4125233823) │ │ │ │ +8CB2C Compressed Size 000016BC (5820) │ │ │ │ +8CB30 Uncompressed Size 000016CD (5837) │ │ │ │ +8CB34 Filename Length 0015 (21) │ │ │ │ +8CB36 Extra Length 001C (28) │ │ │ │ +8CB38 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x8CB38: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +8CB4D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +8CB4F Length 0009 (9) │ │ │ │ +8CB51 Flags 03 (3) 'Modification Access' │ │ │ │ +8CB52 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8CB56 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8CB5A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +8CB5C Length 000B (11) │ │ │ │ +8CB5E Version 01 (1) │ │ │ │ +8CB5F UID Size 04 (4) │ │ │ │ +8CB60 UID 00000000 (0) │ │ │ │ +8CB64 GID Size 04 (4) │ │ │ │ +8CB65 GID 00000000 (0) │ │ │ │ +8CB69 PAYLOAD │ │ │ │ + │ │ │ │ +8E225 LOCAL HEADER #81 04034B50 (67324752) │ │ │ │ +8E229 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +8E22A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +8E22B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +8E22D Compression Method 0008 (8) 'Deflated' │ │ │ │ +8E22F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +8E233 CRC F5E2129F (4125233823) │ │ │ │ +8E237 Compressed Size 000016BC (5820) │ │ │ │ +8E23B Uncompressed Size 000016CD (5837) │ │ │ │ +8E23F Filename Length 001C (28) │ │ │ │ +8E241 Extra Length 001C (28) │ │ │ │ +8E243 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x8E243: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +8E25F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +8E261 Length 0009 (9) │ │ │ │ +8E263 Flags 03 (3) 'Modification Access' │ │ │ │ +8E264 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8E268 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8E26C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +8E26E Length 000B (11) │ │ │ │ +8E270 Version 01 (1) │ │ │ │ +8E271 UID Size 04 (4) │ │ │ │ +8E272 UID 00000000 (0) │ │ │ │ +8E276 GID Size 04 (4) │ │ │ │ +8E277 GID 00000000 (0) │ │ │ │ +8E27B PAYLOAD │ │ │ │ + │ │ │ │ +8F937 LOCAL HEADER #82 04034B50 (67324752) │ │ │ │ +8F93B Extract Zip Spec 0A (10) '1.0' │ │ │ │ +8F93C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +8F93D General Purpose Flag 0000 (0) │ │ │ │ +8F93F Compression Method 0000 (0) 'Stored' │ │ │ │ +8F941 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +8F945 CRC FC95F24B (4237685323) │ │ │ │ +8F949 Compressed Size 00001B84 (7044) │ │ │ │ +8F94D Uncompressed Size 00001B84 (7044) │ │ │ │ +8F951 Filename Length 0016 (22) │ │ │ │ +8F953 Extra Length 001C (28) │ │ │ │ +8F955 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x8F955: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +8F96B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +8F96D Length 0009 (9) │ │ │ │ +8F96F Flags 03 (3) 'Modification Access' │ │ │ │ +8F970 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8F974 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +8F978 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +8F97A Length 000B (11) │ │ │ │ +8F97C Version 01 (1) │ │ │ │ +8F97D UID Size 04 (4) │ │ │ │ +8F97E UID 00000000 (0) │ │ │ │ +8F982 GID Size 04 (4) │ │ │ │ +8F983 GID 00000000 (0) │ │ │ │ +8F987 PAYLOAD │ │ │ │ + │ │ │ │ +9150B LOCAL HEADER #83 04034B50 (67324752) │ │ │ │ +9150F Extract Zip Spec 0A (10) '1.0' │ │ │ │ +91510 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +91511 General Purpose Flag 0000 (0) │ │ │ │ +91513 Compression Method 0000 (0) 'Stored' │ │ │ │ +91515 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +91519 CRC D0D71F86 (3503759238) │ │ │ │ +9151D Compressed Size 00000B7B (2939) │ │ │ │ +91521 Uncompressed Size 00000B7B (2939) │ │ │ │ +91525 Filename Length 0016 (22) │ │ │ │ +91527 Extra Length 001C (28) │ │ │ │ +91529 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x91529: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9153F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +91541 Length 0009 (9) │ │ │ │ +91543 Flags 03 (3) 'Modification Access' │ │ │ │ +91544 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +91548 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9154C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9154E Length 000B (11) │ │ │ │ +91550 Version 01 (1) │ │ │ │ +91551 UID Size 04 (4) │ │ │ │ +91552 UID 00000000 (0) │ │ │ │ +91556 GID Size 04 (4) │ │ │ │ +91557 GID 00000000 (0) │ │ │ │ +9155B PAYLOAD │ │ │ │ + │ │ │ │ +920D6 LOCAL HEADER #84 04034B50 (67324752) │ │ │ │ +920DA Extract Zip Spec 0A (10) '1.0' │ │ │ │ +920DB Extract OS 00 (0) 'MS-DOS' │ │ │ │ +920DC General Purpose Flag 0000 (0) │ │ │ │ +920DE Compression Method 0000 (0) 'Stored' │ │ │ │ +920E0 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +920E4 CRC FFF9C4D2 (4294558930) │ │ │ │ +920E8 Compressed Size 0000138F (5007) │ │ │ │ +920EC Uncompressed Size 0000138F (5007) │ │ │ │ +920F0 Filename Length 0016 (22) │ │ │ │ +920F2 Extra Length 001C (28) │ │ │ │ +920F4 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x920F4: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9210A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9210C Length 0009 (9) │ │ │ │ +9210E Flags 03 (3) 'Modification Access' │ │ │ │ +9210F Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +92113 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +92117 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +92119 Length 000B (11) │ │ │ │ +9211B Version 01 (1) │ │ │ │ +9211C UID Size 04 (4) │ │ │ │ +9211D UID 00000000 (0) │ │ │ │ +92121 GID Size 04 (4) │ │ │ │ +92122 GID 00000000 (0) │ │ │ │ +92126 PAYLOAD │ │ │ │ + │ │ │ │ +934B5 LOCAL HEADER #85 04034B50 (67324752) │ │ │ │ +934B9 Extract Zip Spec 0A (10) '1.0' │ │ │ │ +934BA Extract OS 00 (0) 'MS-DOS' │ │ │ │ +934BB General Purpose Flag 0000 (0) │ │ │ │ +934BD Compression Method 0000 (0) 'Stored' │ │ │ │ +934BF Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +934C3 CRC A1037E8E (2701360782) │ │ │ │ +934C7 Compressed Size 0000145E (5214) │ │ │ │ +934CB Uncompressed Size 0000145E (5214) │ │ │ │ +934CF Filename Length 0016 (22) │ │ │ │ +934D1 Extra Length 001C (28) │ │ │ │ +934D3 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x934D3: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +934E9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +934EB Length 0009 (9) │ │ │ │ +934ED Flags 03 (3) 'Modification Access' │ │ │ │ +934EE Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +934F2 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +934F6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +934F8 Length 000B (11) │ │ │ │ +934FA Version 01 (1) │ │ │ │ +934FB UID Size 04 (4) │ │ │ │ +934FC UID 00000000 (0) │ │ │ │ +93500 GID Size 04 (4) │ │ │ │ +93501 GID 00000000 (0) │ │ │ │ +93505 PAYLOAD │ │ │ │ + │ │ │ │ +94963 LOCAL HEADER #86 04034B50 (67324752) │ │ │ │ +94967 Extract Zip Spec 0A (10) '1.0' │ │ │ │ +94968 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +94969 General Purpose Flag 0000 (0) │ │ │ │ +9496B Compression Method 0000 (0) 'Stored' │ │ │ │ +9496D Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +94971 CRC 5E9E64F1 (1587438833) │ │ │ │ +94975 Compressed Size 000008EC (2284) │ │ │ │ +94979 Uncompressed Size 000008EC (2284) │ │ │ │ +9497D Filename Length 0016 (22) │ │ │ │ +9497F Extra Length 001C (28) │ │ │ │ +94981 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x94981: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +94997 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +94999 Length 0009 (9) │ │ │ │ +9499B Flags 03 (3) 'Modification Access' │ │ │ │ +9499C Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +949A0 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +949A4 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +949A6 Length 000B (11) │ │ │ │ +949A8 Version 01 (1) │ │ │ │ +949A9 UID Size 04 (4) │ │ │ │ +949AA UID 00000000 (0) │ │ │ │ +949AE GID Size 04 (4) │ │ │ │ +949AF GID 00000000 (0) │ │ │ │ +949B3 PAYLOAD │ │ │ │ + │ │ │ │ +9529F LOCAL HEADER #87 04034B50 (67324752) │ │ │ │ +952A3 Extract Zip Spec 0A (10) '1.0' │ │ │ │ +952A4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +952A5 General Purpose Flag 0000 (0) │ │ │ │ +952A7 Compression Method 0000 (0) 'Stored' │ │ │ │ +952A9 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +952AD CRC 42E340AB (1122189483) │ │ │ │ +952B1 Compressed Size 00001F2E (7982) │ │ │ │ +952B5 Uncompressed Size 00001F2E (7982) │ │ │ │ +952B9 Filename Length 001E (30) │ │ │ │ +952BB Extra Length 001C (28) │ │ │ │ +952BD Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x952BD: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +952DB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +952DD Length 0009 (9) │ │ │ │ +952DF Flags 03 (3) 'Modification Access' │ │ │ │ +952E0 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +952E4 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +952E8 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +952EA Length 000B (11) │ │ │ │ +952EC Version 01 (1) │ │ │ │ +952ED UID Size 04 (4) │ │ │ │ +952EE UID 00000000 (0) │ │ │ │ +952F2 GID Size 04 (4) │ │ │ │ +952F3 GID 00000000 (0) │ │ │ │ +952F7 PAYLOAD │ │ │ │ + │ │ │ │ +97225 LOCAL HEADER #88 04034B50 (67324752) │ │ │ │ +97229 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9722A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9722B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9722D Compression Method 0008 (8) 'Deflated' │ │ │ │ +9722F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +97233 CRC 2EA06FB0 (782266288) │ │ │ │ +97237 Compressed Size 00003D6E (15726) │ │ │ │ +9723B Uncompressed Size 00016649 (91721) │ │ │ │ +9723F Filename Length 001A (26) │ │ │ │ +97241 Extra Length 001C (28) │ │ │ │ +97243 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x97243: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9725D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9725F Length 0009 (9) │ │ │ │ +97261 Flags 03 (3) 'Modification Access' │ │ │ │ +97262 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +97266 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9726A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9726C Length 000B (11) │ │ │ │ +9726E Version 01 (1) │ │ │ │ +9726F UID Size 04 (4) │ │ │ │ +97270 UID 00000000 (0) │ │ │ │ +97274 GID Size 04 (4) │ │ │ │ +97275 GID 00000000 (0) │ │ │ │ +97279 PAYLOAD │ │ │ │ + │ │ │ │ +9AFE7 LOCAL HEADER #89 04034B50 (67324752) │ │ │ │ +9AFEB Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9AFEC Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9AFED General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9AFEF Compression Method 0008 (8) 'Deflated' │ │ │ │ +9AFF1 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9AFF5 CRC D1B91C98 (3518569624) │ │ │ │ +9AFF9 Compressed Size 000029C1 (10689) │ │ │ │ +9AFFD Uncompressed Size 0000BA6A (47722) │ │ │ │ +9B001 Filename Length 0018 (24) │ │ │ │ +9B003 Extra Length 001C (28) │ │ │ │ +9B005 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9B005: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9B01D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9B01F Length 0009 (9) │ │ │ │ +9B021 Flags 03 (3) 'Modification Access' │ │ │ │ +9B022 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9B026 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9B02A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9B02C Length 000B (11) │ │ │ │ +9B02E Version 01 (1) │ │ │ │ +9B02F UID Size 04 (4) │ │ │ │ +9B030 UID 00000000 (0) │ │ │ │ +9B034 GID Size 04 (4) │ │ │ │ +9B035 GID 00000000 (0) │ │ │ │ +9B039 PAYLOAD │ │ │ │ + │ │ │ │ +9D9FA LOCAL HEADER #90 04034B50 (67324752) │ │ │ │ +9D9FE Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9D9FF Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DA00 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DA02 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DA04 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DA08 CRC DCB3B516 (3702764822) │ │ │ │ +9DA0C Compressed Size 000000AE (174) │ │ │ │ +9DA10 Uncompressed Size 000000FC (252) │ │ │ │ +9DA14 Filename Length 0016 (22) │ │ │ │ +9DA16 Extra Length 001C (28) │ │ │ │ +9DA18 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DA18: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DA2E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DA30 Length 0009 (9) │ │ │ │ +9DA32 Flags 03 (3) 'Modification Access' │ │ │ │ +9DA33 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DA37 Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DA3B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DA3D Length 000B (11) │ │ │ │ +9DA3F Version 01 (1) │ │ │ │ +9DA40 UID Size 04 (4) │ │ │ │ +9DA41 UID 00000000 (0) │ │ │ │ +9DA45 GID Size 04 (4) │ │ │ │ +9DA46 GID 00000000 (0) │ │ │ │ +9DA4A PAYLOAD XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX │ │ │ │ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX │ │ │ │ │ │ │ │ -9DACD LOCAL HEADER #91 04034B50 (67324752) │ │ │ │ -9DAD1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DAD2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DAD3 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DAD5 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DAD7 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DADB CRC 58439733 (1480824627) │ │ │ │ -9DADF Compressed Size 00000077 (119) │ │ │ │ -9DAE3 Uncompressed Size 000000A2 (162) │ │ │ │ -9DAE7 Filename Length 002D (45) │ │ │ │ -9DAE9 Extra Length 001C (28) │ │ │ │ -9DAEB Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DAEB: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DB18 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DB1A Length 0009 (9) │ │ │ │ -9DB1C Flags 03 (3) 'Modification Access' │ │ │ │ -9DB1D Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DB21 Access Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DB25 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DB27 Length 000B (11) │ │ │ │ -9DB29 Version 01 (1) │ │ │ │ -9DB2A UID Size 04 (4) │ │ │ │ -9DB2B UID 00000000 (0) │ │ │ │ -9DB2F GID Size 04 (4) │ │ │ │ -9DB30 GID 00000000 (0) │ │ │ │ -9DB34 PAYLOAD XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX │ │ │ │ - │ │ │ │ -9DBAB CENTRAL HEADER #1 02014B50 (33639248) │ │ │ │ -9DBAF Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DBB0 Created OS 03 (3) 'Unix' │ │ │ │ -9DBB1 Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9DBB2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DBB3 General Purpose Flag 0000 (0) │ │ │ │ -9DBB5 Compression Method 0000 (0) 'Stored' │ │ │ │ -9DBB7 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DBBB CRC 2CAB616F (749429103) │ │ │ │ -9DBBF Compressed Size 00000014 (20) │ │ │ │ -9DBC3 Uncompressed Size 00000014 (20) │ │ │ │ -9DBC7 Filename Length 0008 (8) │ │ │ │ -9DBC9 Extra Length 0018 (24) │ │ │ │ -9DBCB Comment Length 0000 (0) │ │ │ │ -9DBCD Disk Start 0000 (0) │ │ │ │ -9DBCF Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DBD1 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DBD5 Local Header Offset 00000000 (0) │ │ │ │ -9DBD9 Filename 'XXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DBD9: Filename 'XXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DBE1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DBE3 Length 0005 (5) │ │ │ │ -9DBE5 Flags 01 (1) 'Modification' │ │ │ │ -9DBE6 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DBEA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DBEC Length 000B (11) │ │ │ │ -9DBEE Version 01 (1) │ │ │ │ -9DBEF UID Size 04 (4) │ │ │ │ -9DBF0 UID 00000000 (0) │ │ │ │ -9DBF4 GID Size 04 (4) │ │ │ │ -9DBF5 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DBF9 CENTRAL HEADER #2 02014B50 (33639248) │ │ │ │ -9DBFD Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DBFE Created OS 03 (3) 'Unix' │ │ │ │ -9DBFF Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DC00 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DC01 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DC03 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DC05 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DC09 CRC 9B94E171 (2610225521) │ │ │ │ -9DC0D Compressed Size 000015AD (5549) │ │ │ │ -9DC11 Uncompressed Size 00004602 (17922) │ │ │ │ -9DC15 Filename Length 0014 (20) │ │ │ │ -9DC17 Extra Length 0018 (24) │ │ │ │ -9DC19 Comment Length 0000 (0) │ │ │ │ -9DC1B Disk Start 0000 (0) │ │ │ │ -9DC1D Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DC1F Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DC23 Local Header Offset 00000056 (86) │ │ │ │ -9DC27 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DC27: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DC3B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DC3D Length 0005 (5) │ │ │ │ -9DC3F Flags 01 (1) 'Modification' │ │ │ │ -9DC40 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DC44 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DC46 Length 000B (11) │ │ │ │ -9DC48 Version 01 (1) │ │ │ │ -9DC49 UID Size 04 (4) │ │ │ │ -9DC4A UID 00000000 (0) │ │ │ │ -9DC4E GID Size 04 (4) │ │ │ │ -9DC4F GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DC53 CENTRAL HEADER #3 02014B50 (33639248) │ │ │ │ -9DC57 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DC58 Created OS 03 (3) 'Unix' │ │ │ │ -9DC59 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DC5A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DC5B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DC5D Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DC5F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DC63 CRC E0C122D0 (3770753744) │ │ │ │ -9DC67 Compressed Size 000006D5 (1749) │ │ │ │ -9DC6B Uncompressed Size 00001241 (4673) │ │ │ │ -9DC6F Filename Length 0013 (19) │ │ │ │ -9DC71 Extra Length 0018 (24) │ │ │ │ -9DC73 Comment Length 0000 (0) │ │ │ │ -9DC75 Disk Start 0000 (0) │ │ │ │ -9DC77 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DC79 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DC7D Local Header Offset 00001651 (5713) │ │ │ │ -9DC81 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DC81: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DC94 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DC96 Length 0005 (5) │ │ │ │ -9DC98 Flags 01 (1) 'Modification' │ │ │ │ -9DC99 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DC9D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DC9F Length 000B (11) │ │ │ │ -9DCA1 Version 01 (1) │ │ │ │ -9DCA2 UID Size 04 (4) │ │ │ │ -9DCA3 UID 00000000 (0) │ │ │ │ -9DCA7 GID Size 04 (4) │ │ │ │ -9DCA8 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DCAC CENTRAL HEADER #4 02014B50 (33639248) │ │ │ │ -9DCB0 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DCB1 Created OS 03 (3) 'Unix' │ │ │ │ -9DCB2 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DCB3 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DCB4 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DCB6 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DCB8 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DCBC CRC 2C95CB71 (748014449) │ │ │ │ -9DCC0 Compressed Size 00002DA0 (11680) │ │ │ │ -9DCC4 Uncompressed Size 0000D0BF (53439) │ │ │ │ -9DCC8 Filename Length 0014 (20) │ │ │ │ -9DCCA Extra Length 0018 (24) │ │ │ │ -9DCCC Comment Length 0000 (0) │ │ │ │ -9DCCE Disk Start 0000 (0) │ │ │ │ -9DCD0 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DCD2 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DCD6 Local Header Offset 00001D73 (7539) │ │ │ │ -9DCDA Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DCDA: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DCEE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DCF0 Length 0005 (5) │ │ │ │ -9DCF2 Flags 01 (1) 'Modification' │ │ │ │ -9DCF3 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DCF7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DCF9 Length 000B (11) │ │ │ │ -9DCFB Version 01 (1) │ │ │ │ -9DCFC UID Size 04 (4) │ │ │ │ -9DCFD UID 00000000 (0) │ │ │ │ -9DD01 GID Size 04 (4) │ │ │ │ -9DD02 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DD06 CENTRAL HEADER #5 02014B50 (33639248) │ │ │ │ -9DD0A Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DD0B Created OS 03 (3) 'Unix' │ │ │ │ -9DD0C Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DD0D Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DD0E General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DD10 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DD12 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DD16 CRC 7D6EEFA5 (2104422309) │ │ │ │ -9DD1A Compressed Size 000003F0 (1008) │ │ │ │ -9DD1E Uncompressed Size 00000876 (2166) │ │ │ │ -9DD22 Filename Length 0014 (20) │ │ │ │ -9DD24 Extra Length 0018 (24) │ │ │ │ -9DD26 Comment Length 0000 (0) │ │ │ │ -9DD28 Disk Start 0000 (0) │ │ │ │ -9DD2A Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DD2C Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DD30 Local Header Offset 00004B61 (19297) │ │ │ │ -9DD34 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DD34: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DD48 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DD4A Length 0005 (5) │ │ │ │ -9DD4C Flags 01 (1) 'Modification' │ │ │ │ -9DD4D Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DD51 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DD53 Length 000B (11) │ │ │ │ -9DD55 Version 01 (1) │ │ │ │ -9DD56 UID Size 04 (4) │ │ │ │ -9DD57 UID 00000000 (0) │ │ │ │ -9DD5B GID Size 04 (4) │ │ │ │ -9DD5C GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DD60 CENTRAL HEADER #6 02014B50 (33639248) │ │ │ │ -9DD64 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DD65 Created OS 03 (3) 'Unix' │ │ │ │ -9DD66 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DD67 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DD68 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DD6A Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DD6C Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DD70 CRC A7487B91 (2806545297) │ │ │ │ -9DD74 Compressed Size 000001AE (430) │ │ │ │ -9DD78 Uncompressed Size 000002FC (764) │ │ │ │ -9DD7C Filename Length 0011 (17) │ │ │ │ -9DD7E Extra Length 0018 (24) │ │ │ │ -9DD80 Comment Length 0000 (0) │ │ │ │ -9DD82 Disk Start 0000 (0) │ │ │ │ -9DD84 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DD86 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DD8A Local Header Offset 00004F9F (20383) │ │ │ │ -9DD8E Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DD8E: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DD9F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DDA1 Length 0005 (5) │ │ │ │ -9DDA3 Flags 01 (1) 'Modification' │ │ │ │ -9DDA4 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DDA8 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DDAA Length 000B (11) │ │ │ │ -9DDAC Version 01 (1) │ │ │ │ -9DDAD UID Size 04 (4) │ │ │ │ -9DDAE UID 00000000 (0) │ │ │ │ -9DDB2 GID Size 04 (4) │ │ │ │ -9DDB3 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DDB7 CENTRAL HEADER #7 02014B50 (33639248) │ │ │ │ -9DDBB Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DDBC Created OS 03 (3) 'Unix' │ │ │ │ -9DDBD Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DDBE Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DDBF General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DDC1 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DDC3 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DDC7 CRC 7F37C7F8 (2134362104) │ │ │ │ -9DDCB Compressed Size 000020C6 (8390) │ │ │ │ -9DDCF Uncompressed Size 0000B4B0 (46256) │ │ │ │ -9DDD3 Filename Length 001B (27) │ │ │ │ -9DDD5 Extra Length 0018 (24) │ │ │ │ -9DDD7 Comment Length 0000 (0) │ │ │ │ -9DDD9 Disk Start 0000 (0) │ │ │ │ -9DDDB Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DDDD Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DDE1 Local Header Offset 00005198 (20888) │ │ │ │ -9DDE5 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DDE5: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DE00 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DE02 Length 0005 (5) │ │ │ │ -9DE04 Flags 01 (1) 'Modification' │ │ │ │ -9DE05 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DE09 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DE0B Length 000B (11) │ │ │ │ -9DE0D Version 01 (1) │ │ │ │ -9DE0E UID Size 04 (4) │ │ │ │ -9DE0F UID 00000000 (0) │ │ │ │ -9DE13 GID Size 04 (4) │ │ │ │ -9DE14 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DE18 CENTRAL HEADER #8 02014B50 (33639248) │ │ │ │ -9DE1C Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DE1D Created OS 03 (3) 'Unix' │ │ │ │ -9DE1E Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DE1F Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DE20 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DE22 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DE24 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DE28 CRC C93D1212 (3376222738) │ │ │ │ -9DE2C Compressed Size 00000E6F (3695) │ │ │ │ -9DE30 Uncompressed Size 000030B2 (12466) │ │ │ │ -9DE34 Filename Length 001D (29) │ │ │ │ -9DE36 Extra Length 0018 (24) │ │ │ │ -9DE38 Comment Length 0000 (0) │ │ │ │ -9DE3A Disk Start 0000 (0) │ │ │ │ -9DE3C Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DE3E Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DE42 Local Header Offset 000072B3 (29363) │ │ │ │ -9DE46 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DE46: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DE63 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DE65 Length 0005 (5) │ │ │ │ -9DE67 Flags 01 (1) 'Modification' │ │ │ │ -9DE68 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DE6C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DE6E Length 000B (11) │ │ │ │ -9DE70 Version 01 (1) │ │ │ │ -9DE71 UID Size 04 (4) │ │ │ │ -9DE72 UID 00000000 (0) │ │ │ │ -9DE76 GID Size 04 (4) │ │ │ │ -9DE77 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DE7B CENTRAL HEADER #9 02014B50 (33639248) │ │ │ │ -9DE7F Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DE80 Created OS 03 (3) 'Unix' │ │ │ │ -9DE81 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DE82 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DE83 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DE85 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DE87 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DE8B CRC CF0D8E87 (3473772167) │ │ │ │ -9DE8F Compressed Size 00000972 (2418) │ │ │ │ -9DE93 Uncompressed Size 00001CB2 (7346) │ │ │ │ -9DE97 Filename Length 0019 (25) │ │ │ │ -9DE99 Extra Length 0018 (24) │ │ │ │ -9DE9B Comment Length 0000 (0) │ │ │ │ -9DE9D Disk Start 0000 (0) │ │ │ │ -9DE9F Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DEA1 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DEA5 Local Header Offset 00008179 (33145) │ │ │ │ -9DEA9 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DEA9: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DEC2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DEC4 Length 0005 (5) │ │ │ │ -9DEC6 Flags 01 (1) 'Modification' │ │ │ │ -9DEC7 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DECB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DECD Length 000B (11) │ │ │ │ -9DECF Version 01 (1) │ │ │ │ -9DED0 UID Size 04 (4) │ │ │ │ -9DED1 UID 00000000 (0) │ │ │ │ -9DED5 GID Size 04 (4) │ │ │ │ -9DED6 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DEDA CENTRAL HEADER #10 02014B50 (33639248) │ │ │ │ -9DEDE Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DEDF Created OS 03 (3) 'Unix' │ │ │ │ -9DEE0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DEE1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DEE2 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DEE4 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DEE6 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DEEA CRC 16B1376C (380712812) │ │ │ │ -9DEEE Compressed Size 00003881 (14465) │ │ │ │ -9DEF2 Uncompressed Size 0000F7F4 (63476) │ │ │ │ -9DEF6 Filename Length 0015 (21) │ │ │ │ -9DEF8 Extra Length 0018 (24) │ │ │ │ -9DEFA Comment Length 0000 (0) │ │ │ │ -9DEFC Disk Start 0000 (0) │ │ │ │ -9DEFE Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DF00 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DF04 Local Header Offset 00008B3E (35646) │ │ │ │ -9DF08 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DF08: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DF1D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DF1F Length 0005 (5) │ │ │ │ -9DF21 Flags 01 (1) 'Modification' │ │ │ │ -9DF22 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DF26 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DF28 Length 000B (11) │ │ │ │ -9DF2A Version 01 (1) │ │ │ │ -9DF2B UID Size 04 (4) │ │ │ │ -9DF2C UID 00000000 (0) │ │ │ │ -9DF30 GID Size 04 (4) │ │ │ │ -9DF31 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DF35 CENTRAL HEADER #11 02014B50 (33639248) │ │ │ │ -9DF39 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DF3A Created OS 03 (3) 'Unix' │ │ │ │ -9DF3B Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DF3C Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DF3D General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DF3F Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DF41 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DF45 CRC 21E07247 (568357447) │ │ │ │ -9DF49 Compressed Size 0000AAD9 (43737) │ │ │ │ -9DF4D Uncompressed Size 0003DFDE (253918) │ │ │ │ -9DF51 Filename Length 0012 (18) │ │ │ │ -9DF53 Extra Length 0018 (24) │ │ │ │ -9DF55 Comment Length 0000 (0) │ │ │ │ -9DF57 Disk Start 0000 (0) │ │ │ │ -9DF59 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DF5B Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DF5F Local Header Offset 0000C40E (50190) │ │ │ │ -9DF63 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DF63: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DF75 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DF77 Length 0005 (5) │ │ │ │ -9DF79 Flags 01 (1) 'Modification' │ │ │ │ -9DF7A Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DF7E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DF80 Length 000B (11) │ │ │ │ -9DF82 Version 01 (1) │ │ │ │ -9DF83 UID Size 04 (4) │ │ │ │ -9DF84 UID 00000000 (0) │ │ │ │ -9DF88 GID Size 04 (4) │ │ │ │ -9DF89 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DF8D CENTRAL HEADER #12 02014B50 (33639248) │ │ │ │ -9DF91 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DF92 Created OS 03 (3) 'Unix' │ │ │ │ -9DF93 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DF94 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DF95 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DF97 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DF99 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DF9D CRC 849BB16F (2224796015) │ │ │ │ -9DFA1 Compressed Size 00003B1D (15133) │ │ │ │ -9DFA5 Uncompressed Size 0001B2A0 (111264) │ │ │ │ -9DFA9 Filename Length 0015 (21) │ │ │ │ -9DFAB Extra Length 0018 (24) │ │ │ │ -9DFAD Comment Length 0000 (0) │ │ │ │ -9DFAF Disk Start 0000 (0) │ │ │ │ -9DFB1 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9DFB3 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9DFB7 Local Header Offset 00016F33 (94003) │ │ │ │ -9DFBB Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9DFBB: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9DFD0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9DFD2 Length 0005 (5) │ │ │ │ -9DFD4 Flags 01 (1) 'Modification' │ │ │ │ -9DFD5 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9DFD9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9DFDB Length 000B (11) │ │ │ │ -9DFDD Version 01 (1) │ │ │ │ -9DFDE UID Size 04 (4) │ │ │ │ -9DFDF UID 00000000 (0) │ │ │ │ -9DFE3 GID Size 04 (4) │ │ │ │ -9DFE4 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9DFE8 CENTRAL HEADER #13 02014B50 (33639248) │ │ │ │ -9DFEC Created Zip Spec 3D (61) '6.1' │ │ │ │ -9DFED Created OS 03 (3) 'Unix' │ │ │ │ -9DFEE Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9DFEF Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9DFF0 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9DFF2 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9DFF4 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9DFF8 CRC 768242E0 (1988248288) │ │ │ │ -9DFFC Compressed Size 0000907F (36991) │ │ │ │ -9E000 Uncompressed Size 0003D05F (249951) │ │ │ │ -9E004 Filename Length 0014 (20) │ │ │ │ -9E006 Extra Length 0018 (24) │ │ │ │ -9E008 Comment Length 0000 (0) │ │ │ │ -9E00A Disk Start 0000 (0) │ │ │ │ -9E00C Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E00E Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E012 Local Header Offset 0001AA9F (109215) │ │ │ │ -9E016 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E016: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E02A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E02C Length 0005 (5) │ │ │ │ -9E02E Flags 01 (1) 'Modification' │ │ │ │ -9E02F Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E033 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E035 Length 000B (11) │ │ │ │ -9E037 Version 01 (1) │ │ │ │ -9E038 UID Size 04 (4) │ │ │ │ -9E039 UID 00000000 (0) │ │ │ │ -9E03D GID Size 04 (4) │ │ │ │ -9E03E GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E042 CENTRAL HEADER #14 02014B50 (33639248) │ │ │ │ -9E046 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E047 Created OS 03 (3) 'Unix' │ │ │ │ -9E048 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E049 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E04A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E04C Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E04E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E052 CRC 94869452 (2491847762) │ │ │ │ -9E056 Compressed Size 00002A67 (10855) │ │ │ │ -9E05A Uncompressed Size 0001151F (70943) │ │ │ │ -9E05E Filename Length 0016 (22) │ │ │ │ -9E060 Extra Length 0018 (24) │ │ │ │ -9E062 Comment Length 0000 (0) │ │ │ │ -9E064 Disk Start 0000 (0) │ │ │ │ -9E066 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E068 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E06C Local Header Offset 00023B6C (146284) │ │ │ │ -9E070 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E070: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E086 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E088 Length 0005 (5) │ │ │ │ -9E08A Flags 01 (1) 'Modification' │ │ │ │ -9E08B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E08F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E091 Length 000B (11) │ │ │ │ -9E093 Version 01 (1) │ │ │ │ -9E094 UID Size 04 (4) │ │ │ │ -9E095 UID 00000000 (0) │ │ │ │ -9E099 GID Size 04 (4) │ │ │ │ -9E09A GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E09E CENTRAL HEADER #15 02014B50 (33639248) │ │ │ │ -9E0A2 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E0A3 Created OS 03 (3) 'Unix' │ │ │ │ -9E0A4 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E0A5 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E0A6 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E0A8 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E0AA Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E0AE CRC CACA090F (3402238223) │ │ │ │ -9E0B2 Compressed Size 000014D7 (5335) │ │ │ │ -9E0B6 Uncompressed Size 00005176 (20854) │ │ │ │ -9E0BA Filename Length 001D (29) │ │ │ │ -9E0BC Extra Length 0018 (24) │ │ │ │ -9E0BE Comment Length 0000 (0) │ │ │ │ -9E0C0 Disk Start 0000 (0) │ │ │ │ -9E0C2 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E0C4 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E0C8 Local Header Offset 00026623 (157219) │ │ │ │ -9E0CC Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E0CC: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E0E9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E0EB Length 0005 (5) │ │ │ │ -9E0ED Flags 01 (1) 'Modification' │ │ │ │ -9E0EE Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E0F2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E0F4 Length 000B (11) │ │ │ │ -9E0F6 Version 01 (1) │ │ │ │ -9E0F7 UID Size 04 (4) │ │ │ │ -9E0F8 UID 00000000 (0) │ │ │ │ -9E0FC GID Size 04 (4) │ │ │ │ -9E0FD GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E101 CENTRAL HEADER #16 02014B50 (33639248) │ │ │ │ -9E105 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E106 Created OS 03 (3) 'Unix' │ │ │ │ -9E107 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E108 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E109 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E10B Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E10D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E111 CRC 159F2E8C (362753676) │ │ │ │ -9E115 Compressed Size 000037FA (14330) │ │ │ │ -9E119 Uncompressed Size 0000E9F0 (59888) │ │ │ │ -9E11D Filename Length 001C (28) │ │ │ │ -9E11F Extra Length 0018 (24) │ │ │ │ -9E121 Comment Length 0000 (0) │ │ │ │ -9E123 Disk Start 0000 (0) │ │ │ │ -9E125 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E127 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E12B Local Header Offset 00027B51 (162641) │ │ │ │ -9E12F Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E12F: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E14B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E14D Length 0005 (5) │ │ │ │ -9E14F Flags 01 (1) 'Modification' │ │ │ │ -9E150 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E154 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E156 Length 000B (11) │ │ │ │ -9E158 Version 01 (1) │ │ │ │ -9E159 UID Size 04 (4) │ │ │ │ -9E15A UID 00000000 (0) │ │ │ │ -9E15E GID Size 04 (4) │ │ │ │ -9E15F GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E163 CENTRAL HEADER #17 02014B50 (33639248) │ │ │ │ -9E167 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E168 Created OS 03 (3) 'Unix' │ │ │ │ -9E169 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E16A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E16B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E16D Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E16F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E173 CRC AD7122D2 (2909872850) │ │ │ │ -9E177 Compressed Size 000006A0 (1696) │ │ │ │ -9E17B Uncompressed Size 000011F4 (4596) │ │ │ │ -9E17F Filename Length 001C (28) │ │ │ │ -9E181 Extra Length 0018 (24) │ │ │ │ -9E183 Comment Length 0000 (0) │ │ │ │ -9E185 Disk Start 0000 (0) │ │ │ │ -9E187 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E189 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E18D Local Header Offset 0002B3A1 (177057) │ │ │ │ -9E191 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E191: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E1AD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E1AF Length 0005 (5) │ │ │ │ -9E1B1 Flags 01 (1) 'Modification' │ │ │ │ -9E1B2 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E1B6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E1B8 Length 000B (11) │ │ │ │ -9E1BA Version 01 (1) │ │ │ │ -9E1BB UID Size 04 (4) │ │ │ │ -9E1BC UID 00000000 (0) │ │ │ │ -9E1C0 GID Size 04 (4) │ │ │ │ -9E1C1 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E1C5 CENTRAL HEADER #18 02014B50 (33639248) │ │ │ │ -9E1C9 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E1CA Created OS 03 (3) 'Unix' │ │ │ │ -9E1CB Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E1CC Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E1CD General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E1CF Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E1D1 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E1D5 CRC ECF17F2B (3975249707) │ │ │ │ -9E1D9 Compressed Size 00001078 (4216) │ │ │ │ -9E1DD Uncompressed Size 00004BFF (19455) │ │ │ │ -9E1E1 Filename Length 001B (27) │ │ │ │ -9E1E3 Extra Length 0018 (24) │ │ │ │ -9E1E5 Comment Length 0000 (0) │ │ │ │ -9E1E7 Disk Start 0000 (0) │ │ │ │ -9E1E9 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E1EB Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E1EF Local Header Offset 0002BA97 (178839) │ │ │ │ -9E1F3 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E1F3: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E20E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E210 Length 0005 (5) │ │ │ │ -9E212 Flags 01 (1) 'Modification' │ │ │ │ -9E213 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E217 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E219 Length 000B (11) │ │ │ │ -9E21B Version 01 (1) │ │ │ │ -9E21C UID Size 04 (4) │ │ │ │ -9E21D UID 00000000 (0) │ │ │ │ -9E221 GID Size 04 (4) │ │ │ │ -9E222 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E226 CENTRAL HEADER #19 02014B50 (33639248) │ │ │ │ -9E22A Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E22B Created OS 03 (3) 'Unix' │ │ │ │ -9E22C Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E22D Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E22E General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E230 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E232 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E236 CRC FE38514B (4265103691) │ │ │ │ -9E23A Compressed Size 000033AB (13227) │ │ │ │ -9E23E Uncompressed Size 0000BC94 (48276) │ │ │ │ -9E242 Filename Length 001D (29) │ │ │ │ -9E244 Extra Length 0018 (24) │ │ │ │ -9E246 Comment Length 0000 (0) │ │ │ │ -9E248 Disk Start 0000 (0) │ │ │ │ -9E24A Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E24C Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E250 Local Header Offset 0002CB64 (183140) │ │ │ │ -9E254 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E254: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E271 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E273 Length 0005 (5) │ │ │ │ -9E275 Flags 01 (1) 'Modification' │ │ │ │ -9E276 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E27A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E27C Length 000B (11) │ │ │ │ -9E27E Version 01 (1) │ │ │ │ -9E27F UID Size 04 (4) │ │ │ │ -9E280 UID 00000000 (0) │ │ │ │ -9E284 GID Size 04 (4) │ │ │ │ -9E285 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E289 CENTRAL HEADER #20 02014B50 (33639248) │ │ │ │ -9E28D Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E28E Created OS 03 (3) 'Unix' │ │ │ │ -9E28F Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E290 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E291 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E293 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E295 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E299 CRC 2D94E8CD (764733645) │ │ │ │ -9E29D Compressed Size 00000D6B (3435) │ │ │ │ -9E2A1 Uncompressed Size 00003876 (14454) │ │ │ │ -9E2A5 Filename Length 001D (29) │ │ │ │ -9E2A7 Extra Length 0018 (24) │ │ │ │ -9E2A9 Comment Length 0000 (0) │ │ │ │ -9E2AB Disk Start 0000 (0) │ │ │ │ -9E2AD Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E2AF Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E2B3 Local Header Offset 0002FF66 (196454) │ │ │ │ -9E2B7 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E2B7: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E2D4 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E2D6 Length 0005 (5) │ │ │ │ -9E2D8 Flags 01 (1) 'Modification' │ │ │ │ -9E2D9 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E2DD Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E2DF Length 000B (11) │ │ │ │ -9E2E1 Version 01 (1) │ │ │ │ -9E2E2 UID Size 04 (4) │ │ │ │ -9E2E3 UID 00000000 (0) │ │ │ │ -9E2E7 GID Size 04 (4) │ │ │ │ -9E2E8 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E2EC CENTRAL HEADER #21 02014B50 (33639248) │ │ │ │ -9E2F0 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E2F1 Created OS 03 (3) 'Unix' │ │ │ │ -9E2F2 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E2F3 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E2F4 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E2F6 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E2F8 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E2FC CRC 5E8395EE (1585681902) │ │ │ │ -9E300 Compressed Size 00001C6A (7274) │ │ │ │ -9E304 Uncompressed Size 0000C186 (49542) │ │ │ │ -9E308 Filename Length 001A (26) │ │ │ │ -9E30A Extra Length 0018 (24) │ │ │ │ -9E30C Comment Length 0000 (0) │ │ │ │ -9E30E Disk Start 0000 (0) │ │ │ │ -9E310 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E312 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E316 Local Header Offset 00030D28 (199976) │ │ │ │ -9E31A Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E31A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E334 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E336 Length 0005 (5) │ │ │ │ -9E338 Flags 01 (1) 'Modification' │ │ │ │ -9E339 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E33D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E33F Length 000B (11) │ │ │ │ -9E341 Version 01 (1) │ │ │ │ -9E342 UID Size 04 (4) │ │ │ │ -9E343 UID 00000000 (0) │ │ │ │ -9E347 GID Size 04 (4) │ │ │ │ -9E348 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E34C CENTRAL HEADER #22 02014B50 (33639248) │ │ │ │ -9E350 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E351 Created OS 03 (3) 'Unix' │ │ │ │ -9E352 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E353 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E354 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E356 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E358 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E35C CRC 955F044A (2506032202) │ │ │ │ -9E360 Compressed Size 000003A3 (931) │ │ │ │ -9E364 Uncompressed Size 0000088E (2190) │ │ │ │ -9E368 Filename Length 0012 (18) │ │ │ │ -9E36A Extra Length 0018 (24) │ │ │ │ -9E36C Comment Length 0000 (0) │ │ │ │ -9E36E Disk Start 0000 (0) │ │ │ │ -9E370 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E372 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E376 Local Header Offset 000329E6 (207334) │ │ │ │ -9E37A Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E37A: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E38C Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E38E Length 0005 (5) │ │ │ │ -9E390 Flags 01 (1) 'Modification' │ │ │ │ -9E391 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E395 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E397 Length 000B (11) │ │ │ │ -9E399 Version 01 (1) │ │ │ │ -9E39A UID Size 04 (4) │ │ │ │ -9E39B UID 00000000 (0) │ │ │ │ -9E39F GID Size 04 (4) │ │ │ │ -9E3A0 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E3A4 CENTRAL HEADER #23 02014B50 (33639248) │ │ │ │ -9E3A8 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E3A9 Created OS 03 (3) 'Unix' │ │ │ │ -9E3AA Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E3AB Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E3AC General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E3AE Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E3B0 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E3B4 CRC C065C5F8 (3227895288) │ │ │ │ -9E3B8 Compressed Size 000001D4 (468) │ │ │ │ -9E3BC Uncompressed Size 00000311 (785) │ │ │ │ -9E3C0 Filename Length 0020 (32) │ │ │ │ -9E3C2 Extra Length 0018 (24) │ │ │ │ -9E3C4 Comment Length 0000 (0) │ │ │ │ -9E3C6 Disk Start 0000 (0) │ │ │ │ -9E3C8 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E3CA Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E3CE Local Header Offset 00032DD5 (208341) │ │ │ │ -9E3D2 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E3D2: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E3F2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E3F4 Length 0005 (5) │ │ │ │ -9E3F6 Flags 01 (1) 'Modification' │ │ │ │ -9E3F7 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E3FB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E3FD Length 000B (11) │ │ │ │ -9E3FF Version 01 (1) │ │ │ │ -9E400 UID Size 04 (4) │ │ │ │ -9E401 UID 00000000 (0) │ │ │ │ -9E405 GID Size 04 (4) │ │ │ │ -9E406 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E40A CENTRAL HEADER #24 02014B50 (33639248) │ │ │ │ -9E40E Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E40F Created OS 03 (3) 'Unix' │ │ │ │ -9E410 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E411 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E412 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E414 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E416 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E41A CRC 47533CA6 (1196637350) │ │ │ │ -9E41E Compressed Size 000017A6 (6054) │ │ │ │ -9E422 Uncompressed Size 00009CD3 (40147) │ │ │ │ -9E426 Filename Length 001B (27) │ │ │ │ -9E428 Extra Length 0018 (24) │ │ │ │ -9E42A Comment Length 0000 (0) │ │ │ │ -9E42C Disk Start 0000 (0) │ │ │ │ -9E42E Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E430 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E434 Local Header Offset 00033003 (208899) │ │ │ │ -9E438 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E438: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E453 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E455 Length 0005 (5) │ │ │ │ -9E457 Flags 01 (1) 'Modification' │ │ │ │ -9E458 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E45C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E45E Length 000B (11) │ │ │ │ -9E460 Version 01 (1) │ │ │ │ -9E461 UID Size 04 (4) │ │ │ │ -9E462 UID 00000000 (0) │ │ │ │ -9E466 GID Size 04 (4) │ │ │ │ -9E467 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E46B CENTRAL HEADER #25 02014B50 (33639248) │ │ │ │ -9E46F Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E470 Created OS 03 (3) 'Unix' │ │ │ │ -9E471 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E472 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E473 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E475 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E477 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E47B CRC 3C74E841 (1014294593) │ │ │ │ -9E47F Compressed Size 00001371 (4977) │ │ │ │ -9E483 Uncompressed Size 00003B66 (15206) │ │ │ │ -9E487 Filename Length 0015 (21) │ │ │ │ -9E489 Extra Length 0018 (24) │ │ │ │ -9E48B Comment Length 0000 (0) │ │ │ │ -9E48D Disk Start 0000 (0) │ │ │ │ -9E48F Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E491 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E495 Local Header Offset 000347FE (215038) │ │ │ │ -9E499 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E499: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E4AE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E4B0 Length 0005 (5) │ │ │ │ -9E4B2 Flags 01 (1) 'Modification' │ │ │ │ -9E4B3 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E4B7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E4B9 Length 000B (11) │ │ │ │ -9E4BB Version 01 (1) │ │ │ │ -9E4BC UID Size 04 (4) │ │ │ │ -9E4BD UID 00000000 (0) │ │ │ │ -9E4C1 GID Size 04 (4) │ │ │ │ -9E4C2 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E4C6 CENTRAL HEADER #26 02014B50 (33639248) │ │ │ │ -9E4CA Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E4CB Created OS 03 (3) 'Unix' │ │ │ │ -9E4CC Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E4CD Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E4CE General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E4D0 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E4D2 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E4D6 CRC FF345113 (4281618707) │ │ │ │ -9E4DA Compressed Size 00000AD0 (2768) │ │ │ │ -9E4DE Uncompressed Size 00002135 (8501) │ │ │ │ -9E4E2 Filename Length 0011 (17) │ │ │ │ -9E4E4 Extra Length 0018 (24) │ │ │ │ -9E4E6 Comment Length 0000 (0) │ │ │ │ -9E4E8 Disk Start 0000 (0) │ │ │ │ -9E4EA Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E4EC Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E4F0 Local Header Offset 00035BBE (220094) │ │ │ │ -9E4F4 Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E4F4: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E505 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E507 Length 0005 (5) │ │ │ │ -9E509 Flags 01 (1) 'Modification' │ │ │ │ -9E50A Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E50E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E510 Length 000B (11) │ │ │ │ -9E512 Version 01 (1) │ │ │ │ -9E513 UID Size 04 (4) │ │ │ │ -9E514 UID 00000000 (0) │ │ │ │ -9E518 GID Size 04 (4) │ │ │ │ -9E519 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E51D CENTRAL HEADER #27 02014B50 (33639248) │ │ │ │ -9E521 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E522 Created OS 03 (3) 'Unix' │ │ │ │ -9E523 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E524 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E525 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E527 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E529 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E52D CRC C6078855 (3322382421) │ │ │ │ -9E531 Compressed Size 000003FE (1022) │ │ │ │ -9E535 Uncompressed Size 00000E99 (3737) │ │ │ │ -9E539 Filename Length 0014 (20) │ │ │ │ -9E53B Extra Length 0018 (24) │ │ │ │ -9E53D Comment Length 0000 (0) │ │ │ │ -9E53F Disk Start 0000 (0) │ │ │ │ -9E541 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E543 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E547 Local Header Offset 000366D9 (222937) │ │ │ │ -9E54B Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E54B: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E55F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E561 Length 0005 (5) │ │ │ │ -9E563 Flags 01 (1) 'Modification' │ │ │ │ -9E564 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E568 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E56A Length 000B (11) │ │ │ │ -9E56C Version 01 (1) │ │ │ │ -9E56D UID Size 04 (4) │ │ │ │ -9E56E UID 00000000 (0) │ │ │ │ -9E572 GID Size 04 (4) │ │ │ │ -9E573 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E577 CENTRAL HEADER #28 02014B50 (33639248) │ │ │ │ -9E57B Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E57C Created OS 03 (3) 'Unix' │ │ │ │ -9E57D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E57E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E57F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E581 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E583 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E587 CRC 858C8599 (2240578969) │ │ │ │ -9E58B Compressed Size 00001262 (4706) │ │ │ │ -9E58F Uncompressed Size 00003469 (13417) │ │ │ │ -9E593 Filename Length 0014 (20) │ │ │ │ -9E595 Extra Length 0018 (24) │ │ │ │ -9E597 Comment Length 0000 (0) │ │ │ │ -9E599 Disk Start 0000 (0) │ │ │ │ -9E59B Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E59D Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E5A1 Local Header Offset 00036B25 (224037) │ │ │ │ -9E5A5 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E5A5: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E5B9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E5BB Length 0005 (5) │ │ │ │ -9E5BD Flags 01 (1) 'Modification' │ │ │ │ -9E5BE Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E5C2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E5C4 Length 000B (11) │ │ │ │ -9E5C6 Version 01 (1) │ │ │ │ -9E5C7 UID Size 04 (4) │ │ │ │ -9E5C8 UID 00000000 (0) │ │ │ │ -9E5CC GID Size 04 (4) │ │ │ │ -9E5CD GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E5D1 CENTRAL HEADER #29 02014B50 (33639248) │ │ │ │ -9E5D5 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E5D6 Created OS 03 (3) 'Unix' │ │ │ │ -9E5D7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E5D8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E5D9 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E5DB Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E5DD Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E5E1 CRC 16805862 (377509986) │ │ │ │ -9E5E5 Compressed Size 00000ACE (2766) │ │ │ │ -9E5E9 Uncompressed Size 000022FF (8959) │ │ │ │ -9E5ED Filename Length 001B (27) │ │ │ │ -9E5EF Extra Length 0018 (24) │ │ │ │ -9E5F1 Comment Length 0000 (0) │ │ │ │ -9E5F3 Disk Start 0000 (0) │ │ │ │ -9E5F5 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E5F7 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E5FB Local Header Offset 00037DD5 (228821) │ │ │ │ -9E5FF Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E5FF: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E61A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E61C Length 0005 (5) │ │ │ │ -9E61E Flags 01 (1) 'Modification' │ │ │ │ -9E61F Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E623 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E625 Length 000B (11) │ │ │ │ -9E627 Version 01 (1) │ │ │ │ -9E628 UID Size 04 (4) │ │ │ │ -9E629 UID 00000000 (0) │ │ │ │ -9E62D GID Size 04 (4) │ │ │ │ -9E62E GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E632 CENTRAL HEADER #30 02014B50 (33639248) │ │ │ │ -9E636 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E637 Created OS 03 (3) 'Unix' │ │ │ │ -9E638 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E639 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E63A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E63C Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E63E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E642 CRC E197FA52 (3784833618) │ │ │ │ -9E646 Compressed Size 00000A8D (2701) │ │ │ │ -9E64A Uncompressed Size 0000237A (9082) │ │ │ │ -9E64E Filename Length 0013 (19) │ │ │ │ -9E650 Extra Length 0018 (24) │ │ │ │ -9E652 Comment Length 0000 (0) │ │ │ │ -9E654 Disk Start 0000 (0) │ │ │ │ -9E656 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E658 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E65C Local Header Offset 000388F8 (231672) │ │ │ │ -9E660 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E660: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E673 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E675 Length 0005 (5) │ │ │ │ -9E677 Flags 01 (1) 'Modification' │ │ │ │ -9E678 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E67C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E67E Length 000B (11) │ │ │ │ -9E680 Version 01 (1) │ │ │ │ -9E681 UID Size 04 (4) │ │ │ │ -9E682 UID 00000000 (0) │ │ │ │ -9E686 GID Size 04 (4) │ │ │ │ -9E687 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E68B CENTRAL HEADER #31 02014B50 (33639248) │ │ │ │ -9E68F Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E690 Created OS 03 (3) 'Unix' │ │ │ │ -9E691 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E692 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E693 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E695 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E697 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E69B CRC 11E96F5C (300511068) │ │ │ │ -9E69F Compressed Size 00000F47 (3911) │ │ │ │ -9E6A3 Uncompressed Size 000036F1 (14065) │ │ │ │ -9E6A7 Filename Length 000F (15) │ │ │ │ -9E6A9 Extra Length 0018 (24) │ │ │ │ -9E6AB Comment Length 0000 (0) │ │ │ │ -9E6AD Disk Start 0000 (0) │ │ │ │ -9E6AF Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E6B1 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E6B5 Local Header Offset 000393D2 (234450) │ │ │ │ -9E6B9 Filename 'XXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E6B9: Filename 'XXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E6C8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E6CA Length 0005 (5) │ │ │ │ -9E6CC Flags 01 (1) 'Modification' │ │ │ │ -9E6CD Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E6D1 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E6D3 Length 000B (11) │ │ │ │ -9E6D5 Version 01 (1) │ │ │ │ -9E6D6 UID Size 04 (4) │ │ │ │ -9E6D7 UID 00000000 (0) │ │ │ │ -9E6DB GID Size 04 (4) │ │ │ │ -9E6DC GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E6E0 CENTRAL HEADER #32 02014B50 (33639248) │ │ │ │ -9E6E4 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E6E5 Created OS 03 (3) 'Unix' │ │ │ │ -9E6E6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E6E7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E6E8 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E6EA Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E6EC Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E6F0 CRC 0DF8D9F7 (234412535) │ │ │ │ -9E6F4 Compressed Size 0000066A (1642) │ │ │ │ -9E6F8 Uncompressed Size 000018DF (6367) │ │ │ │ -9E6FC Filename Length 000F (15) │ │ │ │ -9E6FE Extra Length 0018 (24) │ │ │ │ -9E700 Comment Length 0000 (0) │ │ │ │ -9E702 Disk Start 0000 (0) │ │ │ │ -9E704 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E706 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E70A Local Header Offset 0003A362 (238434) │ │ │ │ -9E70E Filename 'XXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E70E: Filename 'XXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E71D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E71F Length 0005 (5) │ │ │ │ -9E721 Flags 01 (1) 'Modification' │ │ │ │ -9E722 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E726 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E728 Length 000B (11) │ │ │ │ -9E72A Version 01 (1) │ │ │ │ -9E72B UID Size 04 (4) │ │ │ │ -9E72C UID 00000000 (0) │ │ │ │ -9E730 GID Size 04 (4) │ │ │ │ -9E731 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E735 CENTRAL HEADER #33 02014B50 (33639248) │ │ │ │ -9E739 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E73A Created OS 03 (3) 'Unix' │ │ │ │ -9E73B Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E73C Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E73D General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E73F Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E741 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E745 CRC 75D1DDD3 (1976688083) │ │ │ │ -9E749 Compressed Size 00001A4A (6730) │ │ │ │ -9E74D Uncompressed Size 000064F2 (25842) │ │ │ │ -9E751 Filename Length 0013 (19) │ │ │ │ -9E753 Extra Length 0018 (24) │ │ │ │ -9E755 Comment Length 0000 (0) │ │ │ │ -9E757 Disk Start 0000 (0) │ │ │ │ -9E759 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E75B Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E75F Local Header Offset 0003AA15 (240149) │ │ │ │ -9E763 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E763: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E776 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E778 Length 0005 (5) │ │ │ │ -9E77A Flags 01 (1) 'Modification' │ │ │ │ -9E77B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E77F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E781 Length 000B (11) │ │ │ │ -9E783 Version 01 (1) │ │ │ │ -9E784 UID Size 04 (4) │ │ │ │ -9E785 UID 00000000 (0) │ │ │ │ -9E789 GID Size 04 (4) │ │ │ │ -9E78A GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E78E CENTRAL HEADER #34 02014B50 (33639248) │ │ │ │ -9E792 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E793 Created OS 03 (3) 'Unix' │ │ │ │ -9E794 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E795 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E796 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E798 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E79A Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E79E CRC FAA9DD12 (4205436178) │ │ │ │ -9E7A2 Compressed Size 000009A6 (2470) │ │ │ │ -9E7A6 Uncompressed Size 00001B64 (7012) │ │ │ │ -9E7AA Filename Length 0010 (16) │ │ │ │ -9E7AC Extra Length 0018 (24) │ │ │ │ -9E7AE Comment Length 0000 (0) │ │ │ │ -9E7B0 Disk Start 0000 (0) │ │ │ │ -9E7B2 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E7B4 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E7B8 Local Header Offset 0003C4AC (246956) │ │ │ │ -9E7BC Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E7BC: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E7CC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E7CE Length 0005 (5) │ │ │ │ -9E7D0 Flags 01 (1) 'Modification' │ │ │ │ -9E7D1 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E7D5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E7D7 Length 000B (11) │ │ │ │ -9E7D9 Version 01 (1) │ │ │ │ -9E7DA UID Size 04 (4) │ │ │ │ -9E7DB UID 00000000 (0) │ │ │ │ -9E7DF GID Size 04 (4) │ │ │ │ -9E7E0 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E7E4 CENTRAL HEADER #35 02014B50 (33639248) │ │ │ │ -9E7E8 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E7E9 Created OS 03 (3) 'Unix' │ │ │ │ -9E7EA Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E7EB Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E7EC General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E7EE Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E7F0 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E7F4 CRC FEC4FE23 (4274322979) │ │ │ │ -9E7F8 Compressed Size 000006B7 (1719) │ │ │ │ -9E7FC Uncompressed Size 00001565 (5477) │ │ │ │ -9E800 Filename Length 0012 (18) │ │ │ │ -9E802 Extra Length 0018 (24) │ │ │ │ -9E804 Comment Length 0000 (0) │ │ │ │ -9E806 Disk Start 0000 (0) │ │ │ │ -9E808 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E80A Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E80E Local Header Offset 0003CE9C (249500) │ │ │ │ -9E812 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E812: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E824 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E826 Length 0005 (5) │ │ │ │ -9E828 Flags 01 (1) 'Modification' │ │ │ │ -9E829 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E82D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E82F Length 000B (11) │ │ │ │ -9E831 Version 01 (1) │ │ │ │ -9E832 UID Size 04 (4) │ │ │ │ -9E833 UID 00000000 (0) │ │ │ │ -9E837 GID Size 04 (4) │ │ │ │ -9E838 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E83C CENTRAL HEADER #36 02014B50 (33639248) │ │ │ │ -9E840 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E841 Created OS 03 (3) 'Unix' │ │ │ │ -9E842 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E843 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E844 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E846 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E848 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E84C CRC EA42306E (3930206318) │ │ │ │ -9E850 Compressed Size 00002A12 (10770) │ │ │ │ -9E854 Uncompressed Size 0000B1C5 (45509) │ │ │ │ -9E858 Filename Length 0010 (16) │ │ │ │ -9E85A Extra Length 0018 (24) │ │ │ │ -9E85C Comment Length 0000 (0) │ │ │ │ -9E85E Disk Start 0000 (0) │ │ │ │ -9E860 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E862 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E866 Local Header Offset 0003D59F (251295) │ │ │ │ -9E86A Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E86A: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E87A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E87C Length 0005 (5) │ │ │ │ -9E87E Flags 01 (1) 'Modification' │ │ │ │ -9E87F Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E883 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E885 Length 000B (11) │ │ │ │ -9E887 Version 01 (1) │ │ │ │ -9E888 UID Size 04 (4) │ │ │ │ -9E889 UID 00000000 (0) │ │ │ │ -9E88D GID Size 04 (4) │ │ │ │ -9E88E GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E892 CENTRAL HEADER #37 02014B50 (33639248) │ │ │ │ -9E896 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E897 Created OS 03 (3) 'Unix' │ │ │ │ -9E898 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E899 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E89A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E89C Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E89E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E8A2 CRC E1C2C8C2 (3787638978) │ │ │ │ -9E8A6 Compressed Size 00001E89 (7817) │ │ │ │ -9E8AA Uncompressed Size 00009AAA (39594) │ │ │ │ -9E8AE Filename Length 0012 (18) │ │ │ │ -9E8B0 Extra Length 0018 (24) │ │ │ │ -9E8B2 Comment Length 0000 (0) │ │ │ │ -9E8B4 Disk Start 0000 (0) │ │ │ │ -9E8B6 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E8B8 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E8BC Local Header Offset 0003FFFB (262139) │ │ │ │ -9E8C0 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E8C0: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E8D2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E8D4 Length 0005 (5) │ │ │ │ -9E8D6 Flags 01 (1) 'Modification' │ │ │ │ -9E8D7 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E8DB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E8DD Length 000B (11) │ │ │ │ -9E8DF Version 01 (1) │ │ │ │ -9E8E0 UID Size 04 (4) │ │ │ │ -9E8E1 UID 00000000 (0) │ │ │ │ -9E8E5 GID Size 04 (4) │ │ │ │ -9E8E6 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E8EA CENTRAL HEADER #38 02014B50 (33639248) │ │ │ │ -9E8EE Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E8EF Created OS 03 (3) 'Unix' │ │ │ │ -9E8F0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E8F1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E8F2 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E8F4 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E8F6 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E8FA CRC C2426F84 (3259133828) │ │ │ │ -9E8FE Compressed Size 00001477 (5239) │ │ │ │ -9E902 Uncompressed Size 00007ACF (31439) │ │ │ │ -9E906 Filename Length 0018 (24) │ │ │ │ -9E908 Extra Length 0018 (24) │ │ │ │ -9E90A Comment Length 0000 (0) │ │ │ │ -9E90C Disk Start 0000 (0) │ │ │ │ -9E90E Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E910 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E914 Local Header Offset 00041ED0 (270032) │ │ │ │ -9E918 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E918: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E930 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E932 Length 0005 (5) │ │ │ │ -9E934 Flags 01 (1) 'Modification' │ │ │ │ -9E935 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E939 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E93B Length 000B (11) │ │ │ │ -9E93D Version 01 (1) │ │ │ │ -9E93E UID Size 04 (4) │ │ │ │ -9E93F UID 00000000 (0) │ │ │ │ -9E943 GID Size 04 (4) │ │ │ │ -9E944 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E948 CENTRAL HEADER #39 02014B50 (33639248) │ │ │ │ -9E94C Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E94D Created OS 03 (3) 'Unix' │ │ │ │ -9E94E Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E94F Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E950 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E952 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E954 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E958 CRC C591B054 (3314659412) │ │ │ │ -9E95C Compressed Size 000018D1 (6353) │ │ │ │ -9E960 Uncompressed Size 0000A7F4 (42996) │ │ │ │ -9E964 Filename Length 001F (31) │ │ │ │ -9E966 Extra Length 0018 (24) │ │ │ │ -9E968 Comment Length 0000 (0) │ │ │ │ -9E96A Disk Start 0000 (0) │ │ │ │ -9E96C Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E96E Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E972 Local Header Offset 00043399 (275353) │ │ │ │ -9E976 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E976: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E995 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E997 Length 0005 (5) │ │ │ │ -9E999 Flags 01 (1) 'Modification' │ │ │ │ -9E99A Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9E99E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9E9A0 Length 000B (11) │ │ │ │ -9E9A2 Version 01 (1) │ │ │ │ -9E9A3 UID Size 04 (4) │ │ │ │ -9E9A4 UID 00000000 (0) │ │ │ │ -9E9A8 GID Size 04 (4) │ │ │ │ -9E9A9 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9E9AD CENTRAL HEADER #40 02014B50 (33639248) │ │ │ │ -9E9B1 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9E9B2 Created OS 03 (3) 'Unix' │ │ │ │ -9E9B3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9E9B4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9E9B5 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9E9B7 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9E9B9 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9E9BD CRC 59BC913A (1505530170) │ │ │ │ -9E9C1 Compressed Size 000003F7 (1015) │ │ │ │ -9E9C5 Uncompressed Size 000008A3 (2211) │ │ │ │ -9E9C9 Filename Length 001E (30) │ │ │ │ -9E9CB Extra Length 0018 (24) │ │ │ │ -9E9CD Comment Length 0000 (0) │ │ │ │ -9E9CF Disk Start 0000 (0) │ │ │ │ -9E9D1 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9E9D3 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9E9D7 Local Header Offset 00044CC3 (281795) │ │ │ │ -9E9DB Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9E9DB: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9E9F9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9E9FB Length 0005 (5) │ │ │ │ -9E9FD Flags 01 (1) 'Modification' │ │ │ │ -9E9FE Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EA02 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EA04 Length 000B (11) │ │ │ │ -9EA06 Version 01 (1) │ │ │ │ -9EA07 UID Size 04 (4) │ │ │ │ -9EA08 UID 00000000 (0) │ │ │ │ -9EA0C GID Size 04 (4) │ │ │ │ -9EA0D GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EA11 CENTRAL HEADER #41 02014B50 (33639248) │ │ │ │ -9EA15 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EA16 Created OS 03 (3) 'Unix' │ │ │ │ -9EA17 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EA18 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EA19 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EA1B Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EA1D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EA21 CRC 1C972FAC (479670188) │ │ │ │ -9EA25 Compressed Size 00004293 (17043) │ │ │ │ -9EA29 Uncompressed Size 0000D8DC (55516) │ │ │ │ -9EA2D Filename Length 0013 (19) │ │ │ │ -9EA2F Extra Length 0018 (24) │ │ │ │ -9EA31 Comment Length 0000 (0) │ │ │ │ -9EA33 Disk Start 0000 (0) │ │ │ │ -9EA35 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EA37 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EA3B Local Header Offset 00045112 (282898) │ │ │ │ -9EA3F Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EA3F: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EA52 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EA54 Length 0005 (5) │ │ │ │ -9EA56 Flags 01 (1) 'Modification' │ │ │ │ -9EA57 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EA5B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EA5D Length 000B (11) │ │ │ │ -9EA5F Version 01 (1) │ │ │ │ -9EA60 UID Size 04 (4) │ │ │ │ -9EA61 UID 00000000 (0) │ │ │ │ -9EA65 GID Size 04 (4) │ │ │ │ -9EA66 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EA6A CENTRAL HEADER #42 02014B50 (33639248) │ │ │ │ -9EA6E Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EA6F Created OS 03 (3) 'Unix' │ │ │ │ -9EA70 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EA71 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EA72 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EA74 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EA76 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EA7A CRC 9BE35018 (2615365656) │ │ │ │ -9EA7E Compressed Size 000026C3 (9923) │ │ │ │ -9EA82 Uncompressed Size 00006E45 (28229) │ │ │ │ -9EA86 Filename Length 0019 (25) │ │ │ │ -9EA88 Extra Length 0018 (24) │ │ │ │ -9EA8A Comment Length 0000 (0) │ │ │ │ -9EA8C Disk Start 0000 (0) │ │ │ │ -9EA8E Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EA90 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EA94 Local Header Offset 000493F2 (300018) │ │ │ │ -9EA98 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EA98: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EAB1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EAB3 Length 0005 (5) │ │ │ │ -9EAB5 Flags 01 (1) 'Modification' │ │ │ │ -9EAB6 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EABA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EABC Length 000B (11) │ │ │ │ -9EABE Version 01 (1) │ │ │ │ -9EABF UID Size 04 (4) │ │ │ │ -9EAC0 UID 00000000 (0) │ │ │ │ -9EAC4 GID Size 04 (4) │ │ │ │ -9EAC5 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EAC9 CENTRAL HEADER #43 02014B50 (33639248) │ │ │ │ -9EACD Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EACE Created OS 03 (3) 'Unix' │ │ │ │ -9EACF Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EAD0 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EAD1 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EAD3 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EAD5 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EAD9 CRC 8AC46E96 (2328129174) │ │ │ │ -9EADD Compressed Size 00002739 (10041) │ │ │ │ -9EAE1 Uncompressed Size 00008B83 (35715) │ │ │ │ -9EAE5 Filename Length 0019 (25) │ │ │ │ -9EAE7 Extra Length 0018 (24) │ │ │ │ -9EAE9 Comment Length 0000 (0) │ │ │ │ -9EAEB Disk Start 0000 (0) │ │ │ │ -9EAED Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EAEF Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EAF3 Local Header Offset 0004BB08 (310024) │ │ │ │ -9EAF7 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EAF7: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EB10 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EB12 Length 0005 (5) │ │ │ │ -9EB14 Flags 01 (1) 'Modification' │ │ │ │ -9EB15 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EB19 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EB1B Length 000B (11) │ │ │ │ -9EB1D Version 01 (1) │ │ │ │ -9EB1E UID Size 04 (4) │ │ │ │ -9EB1F UID 00000000 (0) │ │ │ │ -9EB23 GID Size 04 (4) │ │ │ │ -9EB24 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EB28 CENTRAL HEADER #44 02014B50 (33639248) │ │ │ │ -9EB2C Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EB2D Created OS 03 (3) 'Unix' │ │ │ │ -9EB2E Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EB2F Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EB30 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EB32 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EB34 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EB38 CRC 816EB60A (2171516426) │ │ │ │ -9EB3C Compressed Size 00000CF0 (3312) │ │ │ │ -9EB40 Uncompressed Size 0000517A (20858) │ │ │ │ -9EB44 Filename Length 0021 (33) │ │ │ │ -9EB46 Extra Length 0018 (24) │ │ │ │ -9EB48 Comment Length 0000 (0) │ │ │ │ -9EB4A Disk Start 0000 (0) │ │ │ │ -9EB4C Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EB4E Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EB52 Local Header Offset 0004E294 (320148) │ │ │ │ -9EB56 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EB56: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EB77 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EB79 Length 0005 (5) │ │ │ │ -9EB7B Flags 01 (1) 'Modification' │ │ │ │ -9EB7C Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EB80 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EB82 Length 000B (11) │ │ │ │ -9EB84 Version 01 (1) │ │ │ │ -9EB85 UID Size 04 (4) │ │ │ │ -9EB86 UID 00000000 (0) │ │ │ │ -9EB8A GID Size 04 (4) │ │ │ │ -9EB8B GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EB8F CENTRAL HEADER #45 02014B50 (33639248) │ │ │ │ -9EB93 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EB94 Created OS 03 (3) 'Unix' │ │ │ │ -9EB95 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EB96 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EB97 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EB99 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EB9B Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EB9F CRC 0463353E (73610558) │ │ │ │ -9EBA3 Compressed Size 00000468 (1128) │ │ │ │ -9EBA7 Uncompressed Size 00000931 (2353) │ │ │ │ -9EBAB Filename Length 001B (27) │ │ │ │ -9EBAD Extra Length 0018 (24) │ │ │ │ -9EBAF Comment Length 0000 (0) │ │ │ │ -9EBB1 Disk Start 0000 (0) │ │ │ │ -9EBB3 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EBB5 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EBB9 Local Header Offset 0004EFDF (323551) │ │ │ │ -9EBBD Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EBBD: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EBD8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EBDA Length 0005 (5) │ │ │ │ -9EBDC Flags 01 (1) 'Modification' │ │ │ │ -9EBDD Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EBE1 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EBE3 Length 000B (11) │ │ │ │ -9EBE5 Version 01 (1) │ │ │ │ -9EBE6 UID Size 04 (4) │ │ │ │ -9EBE7 UID 00000000 (0) │ │ │ │ -9EBEB GID Size 04 (4) │ │ │ │ -9EBEC GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EBF0 CENTRAL HEADER #46 02014B50 (33639248) │ │ │ │ -9EBF4 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EBF5 Created OS 03 (3) 'Unix' │ │ │ │ -9EBF6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EBF7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EBF8 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EBFA Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EBFC Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EC00 CRC A0BBCEF2 (2696662770) │ │ │ │ -9EC04 Compressed Size 000016F0 (5872) │ │ │ │ -9EC08 Uncompressed Size 00007A6D (31341) │ │ │ │ -9EC0C Filename Length 001F (31) │ │ │ │ -9EC0E Extra Length 0018 (24) │ │ │ │ -9EC10 Comment Length 0000 (0) │ │ │ │ -9EC12 Disk Start 0000 (0) │ │ │ │ -9EC14 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EC16 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EC1A Local Header Offset 0004F49C (324764) │ │ │ │ -9EC1E Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EC1E: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EC3D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EC3F Length 0005 (5) │ │ │ │ -9EC41 Flags 01 (1) 'Modification' │ │ │ │ -9EC42 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EC46 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EC48 Length 000B (11) │ │ │ │ -9EC4A Version 01 (1) │ │ │ │ -9EC4B UID Size 04 (4) │ │ │ │ -9EC4C UID 00000000 (0) │ │ │ │ -9EC50 GID Size 04 (4) │ │ │ │ -9EC51 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EC55 CENTRAL HEADER #47 02014B50 (33639248) │ │ │ │ -9EC59 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EC5A Created OS 03 (3) 'Unix' │ │ │ │ -9EC5B Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EC5C Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EC5D General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EC5F Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EC61 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EC65 CRC BCCE6C21 (3167644705) │ │ │ │ -9EC69 Compressed Size 00004173 (16755) │ │ │ │ -9EC6D Uncompressed Size 0001CF93 (118675) │ │ │ │ -9EC71 Filename Length 0010 (16) │ │ │ │ -9EC73 Extra Length 0018 (24) │ │ │ │ -9EC75 Comment Length 0000 (0) │ │ │ │ -9EC77 Disk Start 0000 (0) │ │ │ │ -9EC79 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EC7B Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EC7F Local Header Offset 00050BE5 (330725) │ │ │ │ -9EC83 Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EC83: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EC93 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EC95 Length 0005 (5) │ │ │ │ -9EC97 Flags 01 (1) 'Modification' │ │ │ │ -9EC98 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EC9C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EC9E Length 000B (11) │ │ │ │ -9ECA0 Version 01 (1) │ │ │ │ -9ECA1 UID Size 04 (4) │ │ │ │ -9ECA2 UID 00000000 (0) │ │ │ │ -9ECA6 GID Size 04 (4) │ │ │ │ -9ECA7 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9ECAB CENTRAL HEADER #48 02014B50 (33639248) │ │ │ │ -9ECAF Created Zip Spec 3D (61) '6.1' │ │ │ │ -9ECB0 Created OS 03 (3) 'Unix' │ │ │ │ -9ECB1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9ECB2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9ECB3 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9ECB5 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9ECB7 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9ECBB CRC 1D57686C (492267628) │ │ │ │ -9ECBF Compressed Size 00000A93 (2707) │ │ │ │ -9ECC3 Uncompressed Size 00002105 (8453) │ │ │ │ -9ECC7 Filename Length 0014 (20) │ │ │ │ -9ECC9 Extra Length 0018 (24) │ │ │ │ -9ECCB Comment Length 0000 (0) │ │ │ │ -9ECCD Disk Start 0000 (0) │ │ │ │ -9ECCF Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9ECD1 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9ECD5 Local Header Offset 00054DA2 (347554) │ │ │ │ -9ECD9 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9ECD9: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9ECED Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9ECEF Length 0005 (5) │ │ │ │ -9ECF1 Flags 01 (1) 'Modification' │ │ │ │ -9ECF2 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9ECF6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9ECF8 Length 000B (11) │ │ │ │ -9ECFA Version 01 (1) │ │ │ │ -9ECFB UID Size 04 (4) │ │ │ │ -9ECFC UID 00000000 (0) │ │ │ │ -9ED00 GID Size 04 (4) │ │ │ │ -9ED01 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9ED05 CENTRAL HEADER #49 02014B50 (33639248) │ │ │ │ -9ED09 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9ED0A Created OS 03 (3) 'Unix' │ │ │ │ -9ED0B Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9ED0C Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9ED0D General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9ED0F Compression Method 0008 (8) 'Deflated' │ │ │ │ -9ED11 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9ED15 CRC 4F5C62E6 (1331454694) │ │ │ │ -9ED19 Compressed Size 0000AC9A (44186) │ │ │ │ -9ED1D Uncompressed Size 0003E418 (255000) │ │ │ │ -9ED21 Filename Length 0017 (23) │ │ │ │ -9ED23 Extra Length 0018 (24) │ │ │ │ -9ED25 Comment Length 0000 (0) │ │ │ │ -9ED27 Disk Start 0000 (0) │ │ │ │ -9ED29 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9ED2B Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9ED2F Local Header Offset 00055883 (350339) │ │ │ │ -9ED33 Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9ED33: Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9ED4A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9ED4C Length 0005 (5) │ │ │ │ -9ED4E Flags 01 (1) 'Modification' │ │ │ │ -9ED4F Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9ED53 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9ED55 Length 000B (11) │ │ │ │ -9ED57 Version 01 (1) │ │ │ │ -9ED58 UID Size 04 (4) │ │ │ │ -9ED59 UID 00000000 (0) │ │ │ │ -9ED5D GID Size 04 (4) │ │ │ │ -9ED5E GID 00000000 (0) │ │ │ │ - │ │ │ │ -9ED62 CENTRAL HEADER #50 02014B50 (33639248) │ │ │ │ -9ED66 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9ED67 Created OS 03 (3) 'Unix' │ │ │ │ -9ED68 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9ED69 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9ED6A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9ED6C Compression Method 0008 (8) 'Deflated' │ │ │ │ -9ED6E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9ED72 CRC 086861EB (141058539) │ │ │ │ -9ED76 Compressed Size 00000401 (1025) │ │ │ │ -9ED7A Uncompressed Size 0000093D (2365) │ │ │ │ -9ED7E Filename Length 0013 (19) │ │ │ │ -9ED80 Extra Length 0018 (24) │ │ │ │ -9ED82 Comment Length 0000 (0) │ │ │ │ -9ED84 Disk Start 0000 (0) │ │ │ │ -9ED86 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9ED88 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9ED8C Local Header Offset 0006056E (394606) │ │ │ │ -9ED90 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9ED90: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EDA3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EDA5 Length 0005 (5) │ │ │ │ -9EDA7 Flags 01 (1) 'Modification' │ │ │ │ -9EDA8 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EDAC Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EDAE Length 000B (11) │ │ │ │ -9EDB0 Version 01 (1) │ │ │ │ -9EDB1 UID Size 04 (4) │ │ │ │ -9EDB2 UID 00000000 (0) │ │ │ │ -9EDB6 GID Size 04 (4) │ │ │ │ -9EDB7 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EDBB CENTRAL HEADER #51 02014B50 (33639248) │ │ │ │ -9EDBF Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EDC0 Created OS 03 (3) 'Unix' │ │ │ │ -9EDC1 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EDC2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EDC3 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EDC5 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EDC7 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EDCB CRC BA580F4A (3126333258) │ │ │ │ -9EDCF Compressed Size 000014E3 (5347) │ │ │ │ -9EDD3 Uncompressed Size 0000687B (26747) │ │ │ │ -9EDD7 Filename Length 0012 (18) │ │ │ │ -9EDD9 Extra Length 0018 (24) │ │ │ │ -9EDDB Comment Length 0000 (0) │ │ │ │ -9EDDD Disk Start 0000 (0) │ │ │ │ -9EDDF Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EDE1 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EDE5 Local Header Offset 000609BC (395708) │ │ │ │ -9EDE9 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EDE9: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EDFB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EDFD Length 0005 (5) │ │ │ │ -9EDFF Flags 01 (1) 'Modification' │ │ │ │ -9EE00 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EE04 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EE06 Length 000B (11) │ │ │ │ -9EE08 Version 01 (1) │ │ │ │ -9EE09 UID Size 04 (4) │ │ │ │ -9EE0A UID 00000000 (0) │ │ │ │ -9EE0E GID Size 04 (4) │ │ │ │ -9EE0F GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EE13 CENTRAL HEADER #52 02014B50 (33639248) │ │ │ │ -9EE17 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EE18 Created OS 03 (3) 'Unix' │ │ │ │ -9EE19 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EE1A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EE1B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EE1D Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EE1F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EE23 CRC 497392B3 (1232310963) │ │ │ │ -9EE27 Compressed Size 000011EC (4588) │ │ │ │ -9EE2B Uncompressed Size 000040F5 (16629) │ │ │ │ -9EE2F Filename Length 0012 (18) │ │ │ │ -9EE31 Extra Length 0018 (24) │ │ │ │ -9EE33 Comment Length 0000 (0) │ │ │ │ -9EE35 Disk Start 0000 (0) │ │ │ │ -9EE37 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EE39 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EE3D Local Header Offset 00061EEB (401131) │ │ │ │ -9EE41 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EE41: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EE53 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EE55 Length 0005 (5) │ │ │ │ -9EE57 Flags 01 (1) 'Modification' │ │ │ │ -9EE58 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EE5C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EE5E Length 000B (11) │ │ │ │ -9EE60 Version 01 (1) │ │ │ │ -9EE61 UID Size 04 (4) │ │ │ │ -9EE62 UID 00000000 (0) │ │ │ │ -9EE66 GID Size 04 (4) │ │ │ │ -9EE67 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EE6B CENTRAL HEADER #53 02014B50 (33639248) │ │ │ │ -9EE6F Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EE70 Created OS 03 (3) 'Unix' │ │ │ │ -9EE71 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EE72 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EE73 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EE75 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EE77 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EE7B CRC C1D3CAEC (3251882732) │ │ │ │ -9EE7F Compressed Size 000009DA (2522) │ │ │ │ -9EE83 Uncompressed Size 00003529 (13609) │ │ │ │ -9EE87 Filename Length 0019 (25) │ │ │ │ -9EE89 Extra Length 0018 (24) │ │ │ │ -9EE8B Comment Length 0000 (0) │ │ │ │ -9EE8D Disk Start 0000 (0) │ │ │ │ -9EE8F Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EE91 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EE95 Local Header Offset 00063123 (405795) │ │ │ │ -9EE99 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EE99: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EEB2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EEB4 Length 0005 (5) │ │ │ │ -9EEB6 Flags 01 (1) 'Modification' │ │ │ │ -9EEB7 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EEBB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EEBD Length 000B (11) │ │ │ │ -9EEBF Version 01 (1) │ │ │ │ -9EEC0 UID Size 04 (4) │ │ │ │ -9EEC1 UID 00000000 (0) │ │ │ │ -9EEC5 GID Size 04 (4) │ │ │ │ -9EEC6 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EECA CENTRAL HEADER #54 02014B50 (33639248) │ │ │ │ -9EECE Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EECF Created OS 03 (3) 'Unix' │ │ │ │ -9EED0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EED1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EED2 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EED4 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EED6 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EEDA CRC AB9F9615 (2879362581) │ │ │ │ -9EEDE Compressed Size 000018AF (6319) │ │ │ │ -9EEE2 Uncompressed Size 0000A605 (42501) │ │ │ │ -9EEE6 Filename Length 0019 (25) │ │ │ │ -9EEE8 Extra Length 0018 (24) │ │ │ │ -9EEEA Comment Length 0000 (0) │ │ │ │ -9EEEC Disk Start 0000 (0) │ │ │ │ -9EEEE Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EEF0 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EEF4 Local Header Offset 00063B50 (408400) │ │ │ │ -9EEF8 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EEF8: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EF11 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EF13 Length 0005 (5) │ │ │ │ -9EF15 Flags 01 (1) 'Modification' │ │ │ │ -9EF16 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EF1A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EF1C Length 000B (11) │ │ │ │ -9EF1E Version 01 (1) │ │ │ │ -9EF1F UID Size 04 (4) │ │ │ │ -9EF20 UID 00000000 (0) │ │ │ │ -9EF24 GID Size 04 (4) │ │ │ │ -9EF25 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EF29 CENTRAL HEADER #55 02014B50 (33639248) │ │ │ │ -9EF2D Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EF2E Created OS 03 (3) 'Unix' │ │ │ │ -9EF2F Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EF30 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EF31 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EF33 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EF35 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EF39 CRC D193B2B7 (3516117687) │ │ │ │ -9EF3D Compressed Size 0000177E (6014) │ │ │ │ -9EF41 Uncompressed Size 0000472C (18220) │ │ │ │ -9EF45 Filename Length 0014 (20) │ │ │ │ -9EF47 Extra Length 0018 (24) │ │ │ │ -9EF49 Comment Length 0000 (0) │ │ │ │ -9EF4B Disk Start 0000 (0) │ │ │ │ -9EF4D Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EF4F Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EF53 Local Header Offset 00065452 (414802) │ │ │ │ -9EF57 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EF57: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EF6B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EF6D Length 0005 (5) │ │ │ │ -9EF6F Flags 01 (1) 'Modification' │ │ │ │ -9EF70 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EF74 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EF76 Length 000B (11) │ │ │ │ -9EF78 Version 01 (1) │ │ │ │ -9EF79 UID Size 04 (4) │ │ │ │ -9EF7A UID 00000000 (0) │ │ │ │ -9EF7E GID Size 04 (4) │ │ │ │ -9EF7F GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EF83 CENTRAL HEADER #56 02014B50 (33639248) │ │ │ │ -9EF87 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EF88 Created OS 03 (3) 'Unix' │ │ │ │ -9EF89 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EF8A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EF8B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EF8D Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EF8F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EF93 CRC 85800620 (2239759904) │ │ │ │ -9EF97 Compressed Size 0000040B (1035) │ │ │ │ -9EF9B Uncompressed Size 00000825 (2085) │ │ │ │ -9EF9F Filename Length 001C (28) │ │ │ │ -9EFA1 Extra Length 0018 (24) │ │ │ │ -9EFA3 Comment Length 0000 (0) │ │ │ │ -9EFA5 Disk Start 0000 (0) │ │ │ │ -9EFA7 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9EFA9 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9EFAD Local Header Offset 00066C1E (420894) │ │ │ │ -9EFB1 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9EFB1: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9EFCD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9EFCF Length 0005 (5) │ │ │ │ -9EFD1 Flags 01 (1) 'Modification' │ │ │ │ -9EFD2 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9EFD6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9EFD8 Length 000B (11) │ │ │ │ -9EFDA Version 01 (1) │ │ │ │ -9EFDB UID Size 04 (4) │ │ │ │ -9EFDC UID 00000000 (0) │ │ │ │ -9EFE0 GID Size 04 (4) │ │ │ │ -9EFE1 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9EFE5 CENTRAL HEADER #57 02014B50 (33639248) │ │ │ │ -9EFE9 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9EFEA Created OS 03 (3) 'Unix' │ │ │ │ -9EFEB Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9EFEC Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9EFED General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9EFEF Compression Method 0008 (8) 'Deflated' │ │ │ │ -9EFF1 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9EFF5 CRC BADD7CAB (3135077547) │ │ │ │ -9EFF9 Compressed Size 00002481 (9345) │ │ │ │ -9EFFD Uncompressed Size 0000B56F (46447) │ │ │ │ -9F001 Filename Length 001F (31) │ │ │ │ -9F003 Extra Length 0018 (24) │ │ │ │ -9F005 Comment Length 0000 (0) │ │ │ │ -9F007 Disk Start 0000 (0) │ │ │ │ -9F009 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F00B Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F00F Local Header Offset 0006707F (422015) │ │ │ │ -9F013 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F013: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F032 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F034 Length 0005 (5) │ │ │ │ -9F036 Flags 01 (1) 'Modification' │ │ │ │ -9F037 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F03B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F03D Length 000B (11) │ │ │ │ -9F03F Version 01 (1) │ │ │ │ -9F040 UID Size 04 (4) │ │ │ │ -9F041 UID 00000000 (0) │ │ │ │ -9F045 GID Size 04 (4) │ │ │ │ -9F046 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F04A CENTRAL HEADER #58 02014B50 (33639248) │ │ │ │ -9F04E Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F04F Created OS 03 (3) 'Unix' │ │ │ │ -9F050 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F051 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F052 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F054 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F056 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F05A CRC A7EDAC0E (2817371150) │ │ │ │ -9F05E Compressed Size 00000E80 (3712) │ │ │ │ -9F062 Uncompressed Size 000052D9 (21209) │ │ │ │ -9F066 Filename Length 001F (31) │ │ │ │ -9F068 Extra Length 0018 (24) │ │ │ │ -9F06A Comment Length 0000 (0) │ │ │ │ -9F06C Disk Start 0000 (0) │ │ │ │ -9F06E Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F070 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F074 Local Header Offset 00069559 (431449) │ │ │ │ -9F078 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F078: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F097 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F099 Length 0005 (5) │ │ │ │ -9F09B Flags 01 (1) 'Modification' │ │ │ │ -9F09C Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F0A0 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F0A2 Length 000B (11) │ │ │ │ -9F0A4 Version 01 (1) │ │ │ │ -9F0A5 UID Size 04 (4) │ │ │ │ -9F0A6 UID 00000000 (0) │ │ │ │ -9F0AA GID Size 04 (4) │ │ │ │ -9F0AB GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F0AF CENTRAL HEADER #59 02014B50 (33639248) │ │ │ │ -9F0B3 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F0B4 Created OS 03 (3) 'Unix' │ │ │ │ -9F0B5 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F0B6 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F0B7 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F0B9 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F0BB Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F0BF CRC 584D44F7 (1481458935) │ │ │ │ -9F0C3 Compressed Size 00000A44 (2628) │ │ │ │ -9F0C7 Uncompressed Size 0000247A (9338) │ │ │ │ -9F0CB Filename Length 0013 (19) │ │ │ │ -9F0CD Extra Length 0018 (24) │ │ │ │ -9F0CF Comment Length 0000 (0) │ │ │ │ -9F0D1 Disk Start 0000 (0) │ │ │ │ -9F0D3 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F0D5 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F0D9 Local Header Offset 0006A432 (435250) │ │ │ │ -9F0DD Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F0DD: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F0F0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F0F2 Length 0005 (5) │ │ │ │ -9F0F4 Flags 01 (1) 'Modification' │ │ │ │ -9F0F5 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F0F9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F0FB Length 000B (11) │ │ │ │ -9F0FD Version 01 (1) │ │ │ │ -9F0FE UID Size 04 (4) │ │ │ │ -9F0FF UID 00000000 (0) │ │ │ │ -9F103 GID Size 04 (4) │ │ │ │ -9F104 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F108 CENTRAL HEADER #60 02014B50 (33639248) │ │ │ │ -9F10C Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F10D Created OS 03 (3) 'Unix' │ │ │ │ -9F10E Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F10F Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F110 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F112 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F114 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F118 CRC 6B4694FC (1799787772) │ │ │ │ -9F11C Compressed Size 0000248A (9354) │ │ │ │ -9F120 Uncompressed Size 0000B84C (47180) │ │ │ │ -9F124 Filename Length 0019 (25) │ │ │ │ -9F126 Extra Length 0018 (24) │ │ │ │ -9F128 Comment Length 0000 (0) │ │ │ │ -9F12A Disk Start 0000 (0) │ │ │ │ -9F12C Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F12E Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F132 Local Header Offset 0006AEC3 (437955) │ │ │ │ -9F136 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F136: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F14F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F151 Length 0005 (5) │ │ │ │ -9F153 Flags 01 (1) 'Modification' │ │ │ │ -9F154 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F158 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F15A Length 000B (11) │ │ │ │ -9F15C Version 01 (1) │ │ │ │ -9F15D UID Size 04 (4) │ │ │ │ -9F15E UID 00000000 (0) │ │ │ │ -9F162 GID Size 04 (4) │ │ │ │ -9F163 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F167 CENTRAL HEADER #61 02014B50 (33639248) │ │ │ │ -9F16B Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F16C Created OS 03 (3) 'Unix' │ │ │ │ -9F16D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F16E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F16F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F171 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F173 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F177 CRC 17DF12EC (400495340) │ │ │ │ -9F17B Compressed Size 00000EFA (3834) │ │ │ │ -9F17F Uncompressed Size 00003A2C (14892) │ │ │ │ -9F183 Filename Length 0024 (36) │ │ │ │ -9F185 Extra Length 0018 (24) │ │ │ │ -9F187 Comment Length 0000 (0) │ │ │ │ -9F189 Disk Start 0000 (0) │ │ │ │ -9F18B Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F18D Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F191 Local Header Offset 0006D3A0 (447392) │ │ │ │ -9F195 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F195: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F1B9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F1BB Length 0005 (5) │ │ │ │ -9F1BD Flags 01 (1) 'Modification' │ │ │ │ -9F1BE Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F1C2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F1C4 Length 000B (11) │ │ │ │ -9F1C6 Version 01 (1) │ │ │ │ -9F1C7 UID Size 04 (4) │ │ │ │ -9F1C8 UID 00000000 (0) │ │ │ │ -9F1CC GID Size 04 (4) │ │ │ │ -9F1CD GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F1D1 CENTRAL HEADER #62 02014B50 (33639248) │ │ │ │ -9F1D5 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F1D6 Created OS 03 (3) 'Unix' │ │ │ │ -9F1D7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F1D8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F1D9 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F1DB Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F1DD Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F1E1 CRC D30DC617 (3540895255) │ │ │ │ -9F1E5 Compressed Size 00001AC1 (6849) │ │ │ │ -9F1E9 Uncompressed Size 00005EDC (24284) │ │ │ │ -9F1ED Filename Length 0017 (23) │ │ │ │ -9F1EF Extra Length 0018 (24) │ │ │ │ -9F1F1 Comment Length 0000 (0) │ │ │ │ -9F1F3 Disk Start 0000 (0) │ │ │ │ -9F1F5 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F1F7 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F1FB Local Header Offset 0006E2F8 (451320) │ │ │ │ -9F1FF Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F1FF: Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F216 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F218 Length 0005 (5) │ │ │ │ -9F21A Flags 01 (1) 'Modification' │ │ │ │ -9F21B Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F21F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F221 Length 000B (11) │ │ │ │ -9F223 Version 01 (1) │ │ │ │ -9F224 UID Size 04 (4) │ │ │ │ -9F225 UID 00000000 (0) │ │ │ │ -9F229 GID Size 04 (4) │ │ │ │ -9F22A GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F22E CENTRAL HEADER #63 02014B50 (33639248) │ │ │ │ -9F232 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F233 Created OS 03 (3) 'Unix' │ │ │ │ -9F234 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F235 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F236 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F238 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F23A Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F23E CRC 11E32AF1 (300100337) │ │ │ │ -9F242 Compressed Size 00000ED3 (3795) │ │ │ │ -9F246 Uncompressed Size 000038E2 (14562) │ │ │ │ -9F24A Filename Length 0023 (35) │ │ │ │ -9F24C Extra Length 0018 (24) │ │ │ │ -9F24E Comment Length 0000 (0) │ │ │ │ -9F250 Disk Start 0000 (0) │ │ │ │ -9F252 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F254 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F258 Local Header Offset 0006FE0A (458250) │ │ │ │ -9F25C Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F25C: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F27F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F281 Length 0005 (5) │ │ │ │ -9F283 Flags 01 (1) 'Modification' │ │ │ │ -9F284 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F288 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F28A Length 000B (11) │ │ │ │ -9F28C Version 01 (1) │ │ │ │ -9F28D UID Size 04 (4) │ │ │ │ -9F28E UID 00000000 (0) │ │ │ │ -9F292 GID Size 04 (4) │ │ │ │ -9F293 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F297 CENTRAL HEADER #64 02014B50 (33639248) │ │ │ │ -9F29B Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F29C Created OS 03 (3) 'Unix' │ │ │ │ -9F29D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F29E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F29F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F2A1 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F2A3 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F2A7 CRC 2DB7929F (767005343) │ │ │ │ -9F2AB Compressed Size 00000113 (275) │ │ │ │ -9F2AF Uncompressed Size 000001F3 (499) │ │ │ │ -9F2B3 Filename Length 001B (27) │ │ │ │ -9F2B5 Extra Length 0018 (24) │ │ │ │ -9F2B7 Comment Length 0000 (0) │ │ │ │ -9F2B9 Disk Start 0000 (0) │ │ │ │ -9F2BB Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F2BD Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F2C1 Local Header Offset 00070D3A (462138) │ │ │ │ -9F2C5 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F2C5: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F2E0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F2E2 Length 0005 (5) │ │ │ │ -9F2E4 Flags 01 (1) 'Modification' │ │ │ │ -9F2E5 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F2E9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F2EB Length 000B (11) │ │ │ │ -9F2ED Version 01 (1) │ │ │ │ -9F2EE UID Size 04 (4) │ │ │ │ -9F2EF UID 00000000 (0) │ │ │ │ -9F2F3 GID Size 04 (4) │ │ │ │ -9F2F4 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F2F8 CENTRAL HEADER #65 02014B50 (33639248) │ │ │ │ -9F2FC Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F2FD Created OS 03 (3) 'Unix' │ │ │ │ -9F2FE Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F2FF Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F300 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F302 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F304 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F308 CRC AEE78AD0 (2934409936) │ │ │ │ -9F30C Compressed Size 00001890 (6288) │ │ │ │ -9F310 Uncompressed Size 00008FAC (36780) │ │ │ │ -9F314 Filename Length 001D (29) │ │ │ │ -9F316 Extra Length 0018 (24) │ │ │ │ -9F318 Comment Length 0000 (0) │ │ │ │ -9F31A Disk Start 0000 (0) │ │ │ │ -9F31C Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F31E Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F322 Local Header Offset 00070EA2 (462498) │ │ │ │ -9F326 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F326: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F343 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F345 Length 0005 (5) │ │ │ │ -9F347 Flags 01 (1) 'Modification' │ │ │ │ -9F348 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F34C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F34E Length 000B (11) │ │ │ │ -9F350 Version 01 (1) │ │ │ │ -9F351 UID Size 04 (4) │ │ │ │ -9F352 UID 00000000 (0) │ │ │ │ -9F356 GID Size 04 (4) │ │ │ │ -9F357 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F35B CENTRAL HEADER #66 02014B50 (33639248) │ │ │ │ -9F35F Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F360 Created OS 03 (3) 'Unix' │ │ │ │ -9F361 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F362 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F363 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F365 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F367 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F36B CRC BFC41586 (3217298822) │ │ │ │ -9F36F Compressed Size 0000164D (5709) │ │ │ │ -9F373 Uncompressed Size 00003A9B (15003) │ │ │ │ -9F377 Filename Length 0015 (21) │ │ │ │ -9F379 Extra Length 0018 (24) │ │ │ │ -9F37B Comment Length 0000 (0) │ │ │ │ -9F37D Disk Start 0000 (0) │ │ │ │ -9F37F Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F381 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F385 Local Header Offset 00072789 (468873) │ │ │ │ -9F389 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F389: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F39E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F3A0 Length 0005 (5) │ │ │ │ -9F3A2 Flags 01 (1) 'Modification' │ │ │ │ -9F3A3 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F3A7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F3A9 Length 000B (11) │ │ │ │ -9F3AB Version 01 (1) │ │ │ │ -9F3AC UID Size 04 (4) │ │ │ │ -9F3AD UID 00000000 (0) │ │ │ │ -9F3B1 GID Size 04 (4) │ │ │ │ -9F3B2 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F3B6 CENTRAL HEADER #67 02014B50 (33639248) │ │ │ │ -9F3BA Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F3BB Created OS 03 (3) 'Unix' │ │ │ │ -9F3BC Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F3BD Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F3BE General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F3C0 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F3C2 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F3C6 CRC E62AC5E2 (3861562850) │ │ │ │ -9F3CA Compressed Size 00003B4F (15183) │ │ │ │ -9F3CE Uncompressed Size 0001185B (71771) │ │ │ │ -9F3D2 Filename Length 0016 (22) │ │ │ │ -9F3D4 Extra Length 0018 (24) │ │ │ │ -9F3D6 Comment Length 0000 (0) │ │ │ │ -9F3D8 Disk Start 0000 (0) │ │ │ │ -9F3DA Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F3DC Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F3E0 Local Header Offset 00073E25 (474661) │ │ │ │ -9F3E4 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F3E4: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F3FA Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F3FC Length 0005 (5) │ │ │ │ -9F3FE Flags 01 (1) 'Modification' │ │ │ │ -9F3FF Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F403 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F405 Length 000B (11) │ │ │ │ -9F407 Version 01 (1) │ │ │ │ -9F408 UID Size 04 (4) │ │ │ │ -9F409 UID 00000000 (0) │ │ │ │ -9F40D GID Size 04 (4) │ │ │ │ -9F40E GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F412 CENTRAL HEADER #68 02014B50 (33639248) │ │ │ │ -9F416 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F417 Created OS 03 (3) 'Unix' │ │ │ │ -9F418 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F419 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F41A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F41C Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F41E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F422 CRC 8D31A4DB (2368840923) │ │ │ │ -9F426 Compressed Size 00003E88 (16008) │ │ │ │ -9F42A Uncompressed Size 0001C17B (115067) │ │ │ │ -9F42E Filename Length 0019 (25) │ │ │ │ -9F430 Extra Length 0018 (24) │ │ │ │ -9F432 Comment Length 0000 (0) │ │ │ │ -9F434 Disk Start 0000 (0) │ │ │ │ -9F436 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F438 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F43C Local Header Offset 000779C4 (489924) │ │ │ │ -9F440 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F440: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F459 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F45B Length 0005 (5) │ │ │ │ -9F45D Flags 01 (1) 'Modification' │ │ │ │ -9F45E Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F462 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F464 Length 000B (11) │ │ │ │ -9F466 Version 01 (1) │ │ │ │ -9F467 UID Size 04 (4) │ │ │ │ -9F468 UID 00000000 (0) │ │ │ │ -9F46C GID Size 04 (4) │ │ │ │ -9F46D GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F471 CENTRAL HEADER #69 02014B50 (33639248) │ │ │ │ -9F475 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F476 Created OS 03 (3) 'Unix' │ │ │ │ -9F477 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F478 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F479 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F47B Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F47D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F481 CRC 5E5B35D9 (1583035865) │ │ │ │ -9F485 Compressed Size 00000835 (2101) │ │ │ │ -9F489 Uncompressed Size 00003383 (13187) │ │ │ │ -9F48D Filename Length 0011 (17) │ │ │ │ -9F48F Extra Length 0018 (24) │ │ │ │ -9F491 Comment Length 0000 (0) │ │ │ │ -9F493 Disk Start 0000 (0) │ │ │ │ -9F495 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F497 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F49B Local Header Offset 0007B89F (506015) │ │ │ │ -9F49F Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F49F: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F4B0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F4B2 Length 0005 (5) │ │ │ │ -9F4B4 Flags 01 (1) 'Modification' │ │ │ │ -9F4B5 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F4B9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F4BB Length 000B (11) │ │ │ │ -9F4BD Version 01 (1) │ │ │ │ -9F4BE UID Size 04 (4) │ │ │ │ -9F4BF UID 00000000 (0) │ │ │ │ -9F4C3 GID Size 04 (4) │ │ │ │ -9F4C4 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F4C8 CENTRAL HEADER #70 02014B50 (33639248) │ │ │ │ -9F4CC Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F4CD Created OS 03 (3) 'Unix' │ │ │ │ -9F4CE Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F4CF Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F4D0 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F4D2 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F4D4 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F4D8 CRC 00F8EEFF (16314111) │ │ │ │ -9F4DC Compressed Size 00005185 (20869) │ │ │ │ -9F4E0 Uncompressed Size 0001FB6C (129900) │ │ │ │ -9F4E4 Filename Length 0015 (21) │ │ │ │ -9F4E6 Extra Length 0018 (24) │ │ │ │ -9F4E8 Comment Length 0000 (0) │ │ │ │ -9F4EA Disk Start 0000 (0) │ │ │ │ -9F4EC Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F4EE Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F4F2 Local Header Offset 0007C11F (508191) │ │ │ │ -9F4F6 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F4F6: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F50B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F50D Length 0005 (5) │ │ │ │ -9F50F Flags 01 (1) 'Modification' │ │ │ │ -9F510 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F514 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F516 Length 000B (11) │ │ │ │ -9F518 Version 01 (1) │ │ │ │ -9F519 UID Size 04 (4) │ │ │ │ -9F51A UID 00000000 (0) │ │ │ │ -9F51E GID Size 04 (4) │ │ │ │ -9F51F GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F523 CENTRAL HEADER #71 02014B50 (33639248) │ │ │ │ -9F527 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F528 Created OS 03 (3) 'Unix' │ │ │ │ -9F529 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F52A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F52B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F52D Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F52F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F533 CRC CA092E13 (3389599251) │ │ │ │ -9F537 Compressed Size 00001B03 (6915) │ │ │ │ -9F53B Uncompressed Size 000081CF (33231) │ │ │ │ -9F53F Filename Length 0019 (25) │ │ │ │ -9F541 Extra Length 0018 (24) │ │ │ │ -9F543 Comment Length 0000 (0) │ │ │ │ -9F545 Disk Start 0000 (0) │ │ │ │ -9F547 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F549 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F54D Local Header Offset 000812F3 (529139) │ │ │ │ -9F551 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F551: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F56A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F56C Length 0005 (5) │ │ │ │ -9F56E Flags 01 (1) 'Modification' │ │ │ │ -9F56F Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F573 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F575 Length 000B (11) │ │ │ │ -9F577 Version 01 (1) │ │ │ │ -9F578 UID Size 04 (4) │ │ │ │ -9F579 UID 00000000 (0) │ │ │ │ -9F57D GID Size 04 (4) │ │ │ │ -9F57E GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F582 CENTRAL HEADER #72 02014B50 (33639248) │ │ │ │ -9F586 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F587 Created OS 03 (3) 'Unix' │ │ │ │ -9F588 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F589 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F58A General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F58C Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F58E Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F592 CRC A52E2FD0 (2771267536) │ │ │ │ -9F596 Compressed Size 00000D97 (3479) │ │ │ │ -9F59A Uncompressed Size 00002E9F (11935) │ │ │ │ -9F59E Filename Length 0018 (24) │ │ │ │ -9F5A0 Extra Length 0018 (24) │ │ │ │ -9F5A2 Comment Length 0000 (0) │ │ │ │ -9F5A4 Disk Start 0000 (0) │ │ │ │ -9F5A6 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F5A8 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F5AC Local Header Offset 00082E49 (536137) │ │ │ │ -9F5B0 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F5B0: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F5C8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F5CA Length 0005 (5) │ │ │ │ -9F5CC Flags 01 (1) 'Modification' │ │ │ │ -9F5CD Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F5D1 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F5D3 Length 000B (11) │ │ │ │ -9F5D5 Version 01 (1) │ │ │ │ -9F5D6 UID Size 04 (4) │ │ │ │ -9F5D7 UID 00000000 (0) │ │ │ │ -9F5DB GID Size 04 (4) │ │ │ │ -9F5DC GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F5E0 CENTRAL HEADER #73 02014B50 (33639248) │ │ │ │ -9F5E4 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F5E5 Created OS 03 (3) 'Unix' │ │ │ │ -9F5E6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F5E7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F5E8 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F5EA Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F5EC Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F5F0 CRC 0252247A (38937722) │ │ │ │ -9F5F4 Compressed Size 000001E1 (481) │ │ │ │ -9F5F8 Uncompressed Size 00000323 (803) │ │ │ │ -9F5FC Filename Length 0011 (17) │ │ │ │ -9F5FE Extra Length 0018 (24) │ │ │ │ -9F600 Comment Length 0000 (0) │ │ │ │ -9F602 Disk Start 0000 (0) │ │ │ │ -9F604 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F606 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F60A Local Header Offset 00083C32 (539698) │ │ │ │ -9F60E Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F60E: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F61F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F621 Length 0005 (5) │ │ │ │ -9F623 Flags 01 (1) 'Modification' │ │ │ │ -9F624 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F628 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F62A Length 000B (11) │ │ │ │ -9F62C Version 01 (1) │ │ │ │ -9F62D UID Size 04 (4) │ │ │ │ -9F62E UID 00000000 (0) │ │ │ │ -9F632 GID Size 04 (4) │ │ │ │ -9F633 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F637 CENTRAL HEADER #74 02014B50 (33639248) │ │ │ │ -9F63B Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F63C Created OS 03 (3) 'Unix' │ │ │ │ -9F63D Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F63E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F63F General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F641 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F643 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F647 CRC 05901E89 (93331081) │ │ │ │ -9F64B Compressed Size 000006C2 (1730) │ │ │ │ -9F64F Uncompressed Size 00001439 (5177) │ │ │ │ -9F653 Filename Length 0019 (25) │ │ │ │ -9F655 Extra Length 0018 (24) │ │ │ │ -9F657 Comment Length 0000 (0) │ │ │ │ -9F659 Disk Start 0000 (0) │ │ │ │ -9F65B Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F65D Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F661 Local Header Offset 00083E5E (540254) │ │ │ │ -9F665 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F665: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F67E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F680 Length 0005 (5) │ │ │ │ -9F682 Flags 01 (1) 'Modification' │ │ │ │ -9F683 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F687 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F689 Length 000B (11) │ │ │ │ -9F68B Version 01 (1) │ │ │ │ -9F68C UID Size 04 (4) │ │ │ │ -9F68D UID 00000000 (0) │ │ │ │ -9F691 GID Size 04 (4) │ │ │ │ -9F692 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F696 CENTRAL HEADER #75 02014B50 (33639248) │ │ │ │ -9F69A Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F69B Created OS 03 (3) 'Unix' │ │ │ │ -9F69C Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F69D Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F69E General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F6A0 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F6A2 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F6A6 CRC DB50D6EE (3679508206) │ │ │ │ -9F6AA Compressed Size 00001B8A (7050) │ │ │ │ -9F6AE Uncompressed Size 00009F03 (40707) │ │ │ │ -9F6B2 Filename Length 0018 (24) │ │ │ │ -9F6B4 Extra Length 0018 (24) │ │ │ │ -9F6B6 Comment Length 0000 (0) │ │ │ │ -9F6B8 Disk Start 0000 (0) │ │ │ │ -9F6BA Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F6BC Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F6C0 Local Header Offset 00084573 (542067) │ │ │ │ -9F6C4 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F6C4: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F6DC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F6DE Length 0005 (5) │ │ │ │ -9F6E0 Flags 01 (1) 'Modification' │ │ │ │ -9F6E1 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F6E5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F6E7 Length 000B (11) │ │ │ │ -9F6E9 Version 01 (1) │ │ │ │ -9F6EA UID Size 04 (4) │ │ │ │ -9F6EB UID 00000000 (0) │ │ │ │ -9F6EF GID Size 04 (4) │ │ │ │ -9F6F0 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F6F4 CENTRAL HEADER #76 02014B50 (33639248) │ │ │ │ -9F6F8 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F6F9 Created OS 03 (3) 'Unix' │ │ │ │ -9F6FA Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F6FB Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F6FC General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F6FE Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F700 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F704 CRC 085D1D21 (140320033) │ │ │ │ -9F708 Compressed Size 000016F9 (5881) │ │ │ │ -9F70C Uncompressed Size 00008AB6 (35510) │ │ │ │ -9F710 Filename Length 0012 (18) │ │ │ │ -9F712 Extra Length 0018 (24) │ │ │ │ -9F714 Comment Length 0000 (0) │ │ │ │ -9F716 Disk Start 0000 (0) │ │ │ │ -9F718 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F71A Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F71E Local Header Offset 0008614F (549199) │ │ │ │ -9F722 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F722: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F734 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F736 Length 0005 (5) │ │ │ │ -9F738 Flags 01 (1) 'Modification' │ │ │ │ -9F739 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F73D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F73F Length 000B (11) │ │ │ │ -9F741 Version 01 (1) │ │ │ │ -9F742 UID Size 04 (4) │ │ │ │ -9F743 UID 00000000 (0) │ │ │ │ -9F747 GID Size 04 (4) │ │ │ │ -9F748 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F74C CENTRAL HEADER #77 02014B50 (33639248) │ │ │ │ -9F750 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F751 Created OS 03 (3) 'Unix' │ │ │ │ -9F752 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F753 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F754 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F756 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F758 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F75C CRC 3A43D1F6 (977523190) │ │ │ │ -9F760 Compressed Size 00001E10 (7696) │ │ │ │ -9F764 Uncompressed Size 00008803 (34819) │ │ │ │ -9F768 Filename Length 0016 (22) │ │ │ │ -9F76A Extra Length 0018 (24) │ │ │ │ -9F76C Comment Length 0000 (0) │ │ │ │ -9F76E Disk Start 0000 (0) │ │ │ │ -9F770 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F772 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F776 Local Header Offset 00087894 (555156) │ │ │ │ -9F77A Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F77A: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F790 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F792 Length 0005 (5) │ │ │ │ -9F794 Flags 01 (1) 'Modification' │ │ │ │ -9F795 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F799 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F79B Length 000B (11) │ │ │ │ -9F79D Version 01 (1) │ │ │ │ -9F79E UID Size 04 (4) │ │ │ │ -9F79F UID 00000000 (0) │ │ │ │ -9F7A3 GID Size 04 (4) │ │ │ │ -9F7A4 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F7A8 CENTRAL HEADER #78 02014B50 (33639248) │ │ │ │ -9F7AC Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F7AD Created OS 03 (3) 'Unix' │ │ │ │ -9F7AE Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F7AF Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F7B0 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F7B2 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F7B4 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F7B8 CRC 094F3A57 (156187223) │ │ │ │ -9F7BC Compressed Size 000029A7 (10663) │ │ │ │ -9F7C0 Uncompressed Size 0000D04F (53327) │ │ │ │ -9F7C4 Filename Length 001A (26) │ │ │ │ -9F7C6 Extra Length 0018 (24) │ │ │ │ -9F7C8 Comment Length 0000 (0) │ │ │ │ -9F7CA Disk Start 0000 (0) │ │ │ │ -9F7CC Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F7CE Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F7D2 Local Header Offset 000896F4 (562932) │ │ │ │ -9F7D6 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F7D6: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F7F0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F7F2 Length 0005 (5) │ │ │ │ -9F7F4 Flags 01 (1) 'Modification' │ │ │ │ -9F7F5 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F7F9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F7FB Length 000B (11) │ │ │ │ -9F7FD Version 01 (1) │ │ │ │ -9F7FE UID Size 04 (4) │ │ │ │ -9F7FF UID 00000000 (0) │ │ │ │ -9F803 GID Size 04 (4) │ │ │ │ -9F804 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F808 CENTRAL HEADER #79 02014B50 (33639248) │ │ │ │ -9F80C Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F80D Created OS 03 (3) 'Unix' │ │ │ │ -9F80E Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F80F Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F810 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F812 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F814 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F818 CRC 90CE98C5 (2429458629) │ │ │ │ -9F81C Compressed Size 000009AC (2476) │ │ │ │ -9F820 Uncompressed Size 00001DB6 (7606) │ │ │ │ -9F824 Filename Length 0018 (24) │ │ │ │ -9F826 Extra Length 0018 (24) │ │ │ │ -9F828 Comment Length 0000 (0) │ │ │ │ -9F82A Disk Start 0000 (0) │ │ │ │ -9F82C Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F82E Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F832 Local Header Offset 0008C0EF (573679) │ │ │ │ -9F836 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F836: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F84E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F850 Length 0005 (5) │ │ │ │ -9F852 Flags 01 (1) 'Modification' │ │ │ │ -9F853 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F857 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F859 Length 000B (11) │ │ │ │ -9F85B Version 01 (1) │ │ │ │ -9F85C UID Size 04 (4) │ │ │ │ -9F85D UID 00000000 (0) │ │ │ │ -9F861 GID Size 04 (4) │ │ │ │ -9F862 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F866 CENTRAL HEADER #80 02014B50 (33639248) │ │ │ │ -9F86A Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F86B Created OS 03 (3) 'Unix' │ │ │ │ -9F86C Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F86D Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F86E General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F870 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F872 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F876 CRC F5E2129F (4125233823) │ │ │ │ -9F87A Compressed Size 000016BC (5820) │ │ │ │ -9F87E Uncompressed Size 000016CD (5837) │ │ │ │ -9F882 Filename Length 0015 (21) │ │ │ │ -9F884 Extra Length 0018 (24) │ │ │ │ -9F886 Comment Length 0000 (0) │ │ │ │ -9F888 Disk Start 0000 (0) │ │ │ │ -9F88A Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F88C Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F890 Local Header Offset 0008CAED (576237) │ │ │ │ -9F894 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F894: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F8A9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F8AB Length 0005 (5) │ │ │ │ -9F8AD Flags 01 (1) 'Modification' │ │ │ │ -9F8AE Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F8B2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F8B4 Length 000B (11) │ │ │ │ -9F8B6 Version 01 (1) │ │ │ │ -9F8B7 UID Size 04 (4) │ │ │ │ -9F8B8 UID 00000000 (0) │ │ │ │ -9F8BC GID Size 04 (4) │ │ │ │ -9F8BD GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F8C1 CENTRAL HEADER #81 02014B50 (33639248) │ │ │ │ -9F8C5 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F8C6 Created OS 03 (3) 'Unix' │ │ │ │ -9F8C7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9F8C8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F8C9 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9F8CB Compression Method 0008 (8) 'Deflated' │ │ │ │ -9F8CD Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F8D1 CRC F5E2129F (4125233823) │ │ │ │ -9F8D5 Compressed Size 000016BC (5820) │ │ │ │ -9F8D9 Uncompressed Size 000016CD (5837) │ │ │ │ -9F8DD Filename Length 001C (28) │ │ │ │ -9F8DF Extra Length 0018 (24) │ │ │ │ -9F8E1 Comment Length 0000 (0) │ │ │ │ -9F8E3 Disk Start 0000 (0) │ │ │ │ -9F8E5 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F8E7 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F8EB Local Header Offset 0008E1F8 (582136) │ │ │ │ -9F8EF Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F8EF: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F90B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F90D Length 0005 (5) │ │ │ │ -9F90F Flags 01 (1) 'Modification' │ │ │ │ -9F910 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F914 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F916 Length 000B (11) │ │ │ │ -9F918 Version 01 (1) │ │ │ │ -9F919 UID Size 04 (4) │ │ │ │ -9F91A UID 00000000 (0) │ │ │ │ -9F91E GID Size 04 (4) │ │ │ │ -9F91F GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F923 CENTRAL HEADER #82 02014B50 (33639248) │ │ │ │ -9F927 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F928 Created OS 03 (3) 'Unix' │ │ │ │ -9F929 Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9F92A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F92B General Purpose Flag 0000 (0) │ │ │ │ -9F92D Compression Method 0000 (0) 'Stored' │ │ │ │ -9F92F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F933 CRC FC95F24B (4237685323) │ │ │ │ -9F937 Compressed Size 00001B84 (7044) │ │ │ │ -9F93B Uncompressed Size 00001B84 (7044) │ │ │ │ -9F93F Filename Length 0016 (22) │ │ │ │ -9F941 Extra Length 0018 (24) │ │ │ │ -9F943 Comment Length 0000 (0) │ │ │ │ -9F945 Disk Start 0000 (0) │ │ │ │ -9F947 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F949 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F94D Local Header Offset 0008F90A (588042) │ │ │ │ -9F951 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F951: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F967 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F969 Length 0005 (5) │ │ │ │ -9F96B Flags 01 (1) 'Modification' │ │ │ │ -9F96C Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F970 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F972 Length 000B (11) │ │ │ │ -9F974 Version 01 (1) │ │ │ │ -9F975 UID Size 04 (4) │ │ │ │ -9F976 UID 00000000 (0) │ │ │ │ -9F97A GID Size 04 (4) │ │ │ │ -9F97B GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F97F CENTRAL HEADER #83 02014B50 (33639248) │ │ │ │ -9F983 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F984 Created OS 03 (3) 'Unix' │ │ │ │ -9F985 Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9F986 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F987 General Purpose Flag 0000 (0) │ │ │ │ -9F989 Compression Method 0000 (0) 'Stored' │ │ │ │ -9F98B Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F98F CRC D0D71F86 (3503759238) │ │ │ │ -9F993 Compressed Size 00000B7B (2939) │ │ │ │ -9F997 Uncompressed Size 00000B7B (2939) │ │ │ │ -9F99B Filename Length 0016 (22) │ │ │ │ -9F99D Extra Length 0018 (24) │ │ │ │ -9F99F Comment Length 0000 (0) │ │ │ │ -9F9A1 Disk Start 0000 (0) │ │ │ │ -9F9A3 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9F9A5 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9F9A9 Local Header Offset 000914DE (595166) │ │ │ │ -9F9AD Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9F9AD: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9F9C3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9F9C5 Length 0005 (5) │ │ │ │ -9F9C7 Flags 01 (1) 'Modification' │ │ │ │ -9F9C8 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9F9CC Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9F9CE Length 000B (11) │ │ │ │ -9F9D0 Version 01 (1) │ │ │ │ -9F9D1 UID Size 04 (4) │ │ │ │ -9F9D2 UID 00000000 (0) │ │ │ │ -9F9D6 GID Size 04 (4) │ │ │ │ -9F9D7 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9F9DB CENTRAL HEADER #84 02014B50 (33639248) │ │ │ │ -9F9DF Created Zip Spec 3D (61) '6.1' │ │ │ │ -9F9E0 Created OS 03 (3) 'Unix' │ │ │ │ -9F9E1 Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9F9E2 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9F9E3 General Purpose Flag 0000 (0) │ │ │ │ -9F9E5 Compression Method 0000 (0) 'Stored' │ │ │ │ -9F9E7 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9F9EB CRC FFF9C4D2 (4294558930) │ │ │ │ -9F9EF Compressed Size 0000138F (5007) │ │ │ │ -9F9F3 Uncompressed Size 0000138F (5007) │ │ │ │ -9F9F7 Filename Length 0016 (22) │ │ │ │ -9F9F9 Extra Length 0018 (24) │ │ │ │ -9F9FB Comment Length 0000 (0) │ │ │ │ -9F9FD Disk Start 0000 (0) │ │ │ │ -9F9FF Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9FA01 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9FA05 Local Header Offset 000920A9 (598185) │ │ │ │ -9FA09 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9FA09: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9FA1F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9FA21 Length 0005 (5) │ │ │ │ -9FA23 Flags 01 (1) 'Modification' │ │ │ │ -9FA24 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9FA28 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9FA2A Length 000B (11) │ │ │ │ -9FA2C Version 01 (1) │ │ │ │ -9FA2D UID Size 04 (4) │ │ │ │ -9FA2E UID 00000000 (0) │ │ │ │ -9FA32 GID Size 04 (4) │ │ │ │ -9FA33 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9FA37 CENTRAL HEADER #85 02014B50 (33639248) │ │ │ │ -9FA3B Created Zip Spec 3D (61) '6.1' │ │ │ │ -9FA3C Created OS 03 (3) 'Unix' │ │ │ │ -9FA3D Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9FA3E Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9FA3F General Purpose Flag 0000 (0) │ │ │ │ -9FA41 Compression Method 0000 (0) 'Stored' │ │ │ │ -9FA43 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9FA47 CRC A1037E8E (2701360782) │ │ │ │ -9FA4B Compressed Size 0000145E (5214) │ │ │ │ -9FA4F Uncompressed Size 0000145E (5214) │ │ │ │ -9FA53 Filename Length 0016 (22) │ │ │ │ -9FA55 Extra Length 0018 (24) │ │ │ │ -9FA57 Comment Length 0000 (0) │ │ │ │ -9FA59 Disk Start 0000 (0) │ │ │ │ -9FA5B Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9FA5D Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9FA61 Local Header Offset 00093488 (603272) │ │ │ │ -9FA65 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9FA65: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9FA7B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9FA7D Length 0005 (5) │ │ │ │ -9FA7F Flags 01 (1) 'Modification' │ │ │ │ -9FA80 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9FA84 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9FA86 Length 000B (11) │ │ │ │ -9FA88 Version 01 (1) │ │ │ │ -9FA89 UID Size 04 (4) │ │ │ │ -9FA8A UID 00000000 (0) │ │ │ │ -9FA8E GID Size 04 (4) │ │ │ │ -9FA8F GID 00000000 (0) │ │ │ │ - │ │ │ │ -9FA93 CENTRAL HEADER #86 02014B50 (33639248) │ │ │ │ -9FA97 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9FA98 Created OS 03 (3) 'Unix' │ │ │ │ -9FA99 Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9FA9A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9FA9B General Purpose Flag 0000 (0) │ │ │ │ -9FA9D Compression Method 0000 (0) 'Stored' │ │ │ │ -9FA9F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9FAA3 CRC 5E9E64F1 (1587438833) │ │ │ │ -9FAA7 Compressed Size 000008EC (2284) │ │ │ │ -9FAAB Uncompressed Size 000008EC (2284) │ │ │ │ -9FAAF Filename Length 0016 (22) │ │ │ │ -9FAB1 Extra Length 0018 (24) │ │ │ │ -9FAB3 Comment Length 0000 (0) │ │ │ │ -9FAB5 Disk Start 0000 (0) │ │ │ │ -9FAB7 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9FAB9 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9FABD Local Header Offset 00094936 (608566) │ │ │ │ -9FAC1 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9FAC1: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9FAD7 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9FAD9 Length 0005 (5) │ │ │ │ -9FADB Flags 01 (1) 'Modification' │ │ │ │ -9FADC Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9FAE0 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9FAE2 Length 000B (11) │ │ │ │ -9FAE4 Version 01 (1) │ │ │ │ -9FAE5 UID Size 04 (4) │ │ │ │ -9FAE6 UID 00000000 (0) │ │ │ │ -9FAEA GID Size 04 (4) │ │ │ │ -9FAEB GID 00000000 (0) │ │ │ │ - │ │ │ │ -9FAEF CENTRAL HEADER #87 02014B50 (33639248) │ │ │ │ -9FAF3 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9FAF4 Created OS 03 (3) 'Unix' │ │ │ │ -9FAF5 Extract Zip Spec 0A (10) '1.0' │ │ │ │ -9FAF6 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9FAF7 General Purpose Flag 0000 (0) │ │ │ │ -9FAF9 Compression Method 0000 (0) 'Stored' │ │ │ │ -9FAFB Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9FAFF CRC 42E340AB (1122189483) │ │ │ │ -9FB03 Compressed Size 00001F2E (7982) │ │ │ │ -9FB07 Uncompressed Size 00001F2E (7982) │ │ │ │ -9FB0B Filename Length 001E (30) │ │ │ │ -9FB0D Extra Length 0018 (24) │ │ │ │ -9FB0F Comment Length 0000 (0) │ │ │ │ -9FB11 Disk Start 0000 (0) │ │ │ │ -9FB13 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9FB15 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9FB19 Local Header Offset 00095272 (610930) │ │ │ │ -9FB1D Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9FB1D: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9FB3B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9FB3D Length 0005 (5) │ │ │ │ -9FB3F Flags 01 (1) 'Modification' │ │ │ │ -9FB40 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9FB44 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9FB46 Length 000B (11) │ │ │ │ -9FB48 Version 01 (1) │ │ │ │ -9FB49 UID Size 04 (4) │ │ │ │ -9FB4A UID 00000000 (0) │ │ │ │ -9FB4E GID Size 04 (4) │ │ │ │ -9FB4F GID 00000000 (0) │ │ │ │ - │ │ │ │ -9FB53 CENTRAL HEADER #88 02014B50 (33639248) │ │ │ │ -9FB57 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9FB58 Created OS 03 (3) 'Unix' │ │ │ │ -9FB59 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9FB5A Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9FB5B General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9FB5D Compression Method 0008 (8) 'Deflated' │ │ │ │ -9FB5F Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9FB63 CRC 6B709B8E (1802541966) │ │ │ │ -9FB67 Compressed Size 00003D6F (15727) │ │ │ │ -9FB6B Uncompressed Size 00016649 (91721) │ │ │ │ -9FB6F Filename Length 001A (26) │ │ │ │ -9FB71 Extra Length 0018 (24) │ │ │ │ -9FB73 Comment Length 0000 (0) │ │ │ │ -9FB75 Disk Start 0000 (0) │ │ │ │ -9FB77 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9FB79 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9FB7D Local Header Offset 000971F8 (619000) │ │ │ │ -9FB81 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9FB81: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9FB9B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9FB9D Length 0005 (5) │ │ │ │ -9FB9F Flags 01 (1) 'Modification' │ │ │ │ -9FBA0 Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9FBA4 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9FBA6 Length 000B (11) │ │ │ │ -9FBA8 Version 01 (1) │ │ │ │ -9FBA9 UID Size 04 (4) │ │ │ │ -9FBAA UID 00000000 (0) │ │ │ │ -9FBAE GID Size 04 (4) │ │ │ │ -9FBAF GID 00000000 (0) │ │ │ │ - │ │ │ │ -9FBB3 CENTRAL HEADER #89 02014B50 (33639248) │ │ │ │ -9FBB7 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9FBB8 Created OS 03 (3) 'Unix' │ │ │ │ -9FBB9 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9FBBA Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9FBBB General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9FBBD Compression Method 0008 (8) 'Deflated' │ │ │ │ -9FBBF Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9FBC3 CRC 17236CC3 (388197571) │ │ │ │ -9FBC7 Compressed Size 000029C2 (10690) │ │ │ │ -9FBCB Uncompressed Size 0000BA6A (47722) │ │ │ │ -9FBCF Filename Length 0018 (24) │ │ │ │ -9FBD1 Extra Length 0018 (24) │ │ │ │ -9FBD3 Comment Length 0000 (0) │ │ │ │ -9FBD5 Disk Start 0000 (0) │ │ │ │ -9FBD7 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9FBD9 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9FBDD Local Header Offset 0009AFBB (634811) │ │ │ │ -9FBE1 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9FBE1: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9FBF9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9FBFB Length 0005 (5) │ │ │ │ -9FBFD Flags 01 (1) 'Modification' │ │ │ │ -9FBFE Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9FC02 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9FC04 Length 000B (11) │ │ │ │ -9FC06 Version 01 (1) │ │ │ │ -9FC07 UID Size 04 (4) │ │ │ │ -9FC08 UID 00000000 (0) │ │ │ │ -9FC0C GID Size 04 (4) │ │ │ │ -9FC0D GID 00000000 (0) │ │ │ │ - │ │ │ │ -9FC11 CENTRAL HEADER #90 02014B50 (33639248) │ │ │ │ -9FC15 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9FC16 Created OS 03 (3) 'Unix' │ │ │ │ -9FC17 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9FC18 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9FC19 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9FC1B Compression Method 0008 (8) 'Deflated' │ │ │ │ -9FC1D Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9FC21 CRC DCB3B516 (3702764822) │ │ │ │ -9FC25 Compressed Size 000000AE (174) │ │ │ │ -9FC29 Uncompressed Size 000000FC (252) │ │ │ │ -9FC2D Filename Length 0016 (22) │ │ │ │ -9FC2F Extra Length 0018 (24) │ │ │ │ -9FC31 Comment Length 0000 (0) │ │ │ │ -9FC33 Disk Start 0000 (0) │ │ │ │ -9FC35 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9FC37 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9FC3B Local Header Offset 0009D9CF (645583) │ │ │ │ -9FC3F Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9FC3F: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9FC55 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9FC57 Length 0005 (5) │ │ │ │ -9FC59 Flags 01 (1) 'Modification' │ │ │ │ -9FC5A Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9FC5E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9FC60 Length 000B (11) │ │ │ │ -9FC62 Version 01 (1) │ │ │ │ -9FC63 UID Size 04 (4) │ │ │ │ -9FC64 UID 00000000 (0) │ │ │ │ -9FC68 GID Size 04 (4) │ │ │ │ -9FC69 GID 00000000 (0) │ │ │ │ - │ │ │ │ -9FC6D CENTRAL HEADER #91 02014B50 (33639248) │ │ │ │ -9FC71 Created Zip Spec 3D (61) '6.1' │ │ │ │ -9FC72 Created OS 03 (3) 'Unix' │ │ │ │ -9FC73 Extract Zip Spec 14 (20) '2.0' │ │ │ │ -9FC74 Extract OS 00 (0) 'MS-DOS' │ │ │ │ -9FC75 General Purpose Flag 0000 (0) │ │ │ │ - [Bits 1-2] 0 'Normal Compression' │ │ │ │ -9FC77 Compression Method 0008 (8) 'Deflated' │ │ │ │ -9FC79 Modification Time 5B7B68EC (1534814444) 'Thu Nov 27 13:07:24 2025' │ │ │ │ -9FC7D CRC 58439733 (1480824627) │ │ │ │ -9FC81 Compressed Size 00000077 (119) │ │ │ │ -9FC85 Uncompressed Size 000000A2 (162) │ │ │ │ -9FC89 Filename Length 002D (45) │ │ │ │ -9FC8B Extra Length 0018 (24) │ │ │ │ -9FC8D Comment Length 0000 (0) │ │ │ │ -9FC8F Disk Start 0000 (0) │ │ │ │ -9FC91 Int File Attributes 0000 (0) │ │ │ │ - [Bit 0] 0 'Binary Data' │ │ │ │ -9FC93 Ext File Attributes 01A40000 (27525120) │ │ │ │ - [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ -9FC97 Local Header Offset 0009DACD (645837) │ │ │ │ -9FC9B Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# │ │ │ │ -# WARNING: Offset 0x9FC9B: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ -# Zero length filename │ │ │ │ -# │ │ │ │ -9FCC8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ -9FCCA Length 0005 (5) │ │ │ │ -9FCCC Flags 01 (1) 'Modification' │ │ │ │ -9FCCD Modification Time 69284D0D (1764248845) 'Thu Nov 27 13:07:25 2025' │ │ │ │ -9FCD1 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ -9FCD3 Length 000B (11) │ │ │ │ -9FCD5 Version 01 (1) │ │ │ │ -9FCD6 UID Size 04 (4) │ │ │ │ -9FCD7 UID 00000000 (0) │ │ │ │ -9FCDB GID Size 04 (4) │ │ │ │ -9FCDC GID 00000000 (0) │ │ │ │ - │ │ │ │ -9FCE0 END CENTRAL HEADER 06054B50 (101010256) │ │ │ │ -9FCE4 Number of this disk 0000 (0) │ │ │ │ -9FCE6 Central Dir Disk no 0000 (0) │ │ │ │ -9FCE8 Entries in this disk 005B (91) │ │ │ │ -9FCEA Total Entries 005B (91) │ │ │ │ -9FCEC Size of Central Dir 00002135 (8501) │ │ │ │ -9FCF0 Offset to Central Dir 0009DBAB (646059) │ │ │ │ -9FCF4 Comment Length 0000 (0) │ │ │ │ +9DAF8 LOCAL HEADER #91 04034B50 (67324752) │ │ │ │ +9DAFC Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DAFD Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DAFE General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DB00 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DB02 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DB06 CRC 58439733 (1480824627) │ │ │ │ +9DB0A Compressed Size 00000077 (119) │ │ │ │ +9DB0E Uncompressed Size 000000A2 (162) │ │ │ │ +9DB12 Filename Length 002D (45) │ │ │ │ +9DB14 Extra Length 001C (28) │ │ │ │ +9DB16 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DB16: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DB43 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DB45 Length 0009 (9) │ │ │ │ +9DB47 Flags 03 (3) 'Modification Access' │ │ │ │ +9DB48 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DB4C Access Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DB50 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DB52 Length 000B (11) │ │ │ │ +9DB54 Version 01 (1) │ │ │ │ +9DB55 UID Size 04 (4) │ │ │ │ +9DB56 UID 00000000 (0) │ │ │ │ +9DB5A GID Size 04 (4) │ │ │ │ +9DB5B GID 00000000 (0) │ │ │ │ +9DB5F PAYLOAD XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX │ │ │ │ + │ │ │ │ +9DBD6 CENTRAL HEADER #1 02014B50 (33639248) │ │ │ │ +9DBDA Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DBDB Created OS 03 (3) 'Unix' │ │ │ │ +9DBDC Extract Zip Spec 0A (10) '1.0' │ │ │ │ +9DBDD Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DBDE General Purpose Flag 0000 (0) │ │ │ │ +9DBE0 Compression Method 0000 (0) 'Stored' │ │ │ │ +9DBE2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DBE6 CRC 2CAB616F (749429103) │ │ │ │ +9DBEA Compressed Size 00000014 (20) │ │ │ │ +9DBEE Uncompressed Size 00000014 (20) │ │ │ │ +9DBF2 Filename Length 0008 (8) │ │ │ │ +9DBF4 Extra Length 0018 (24) │ │ │ │ +9DBF6 Comment Length 0000 (0) │ │ │ │ +9DBF8 Disk Start 0000 (0) │ │ │ │ +9DBFA Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DBFC Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DC00 Local Header Offset 00000000 (0) │ │ │ │ +9DC04 Filename 'XXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DC04: Filename 'XXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DC0C Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DC0E Length 0005 (5) │ │ │ │ +9DC10 Flags 01 (1) 'Modification' │ │ │ │ +9DC11 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DC15 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DC17 Length 000B (11) │ │ │ │ +9DC19 Version 01 (1) │ │ │ │ +9DC1A UID Size 04 (4) │ │ │ │ +9DC1B UID 00000000 (0) │ │ │ │ +9DC1F GID Size 04 (4) │ │ │ │ +9DC20 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DC24 CENTRAL HEADER #2 02014B50 (33639248) │ │ │ │ +9DC28 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DC29 Created OS 03 (3) 'Unix' │ │ │ │ +9DC2A Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DC2B Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DC2C General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DC2E Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DC30 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DC34 CRC 9B94E171 (2610225521) │ │ │ │ +9DC38 Compressed Size 000015AD (5549) │ │ │ │ +9DC3C Uncompressed Size 00004602 (17922) │ │ │ │ +9DC40 Filename Length 0014 (20) │ │ │ │ +9DC42 Extra Length 0018 (24) │ │ │ │ +9DC44 Comment Length 0000 (0) │ │ │ │ +9DC46 Disk Start 0000 (0) │ │ │ │ +9DC48 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DC4A Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DC4E Local Header Offset 00000056 (86) │ │ │ │ +9DC52 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DC52: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DC66 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DC68 Length 0005 (5) │ │ │ │ +9DC6A Flags 01 (1) 'Modification' │ │ │ │ +9DC6B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DC6F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DC71 Length 000B (11) │ │ │ │ +9DC73 Version 01 (1) │ │ │ │ +9DC74 UID Size 04 (4) │ │ │ │ +9DC75 UID 00000000 (0) │ │ │ │ +9DC79 GID Size 04 (4) │ │ │ │ +9DC7A GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DC7E CENTRAL HEADER #3 02014B50 (33639248) │ │ │ │ +9DC82 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DC83 Created OS 03 (3) 'Unix' │ │ │ │ +9DC84 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DC85 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DC86 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DC88 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DC8A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DC8E CRC E0C122D0 (3770753744) │ │ │ │ +9DC92 Compressed Size 000006D5 (1749) │ │ │ │ +9DC96 Uncompressed Size 00001241 (4673) │ │ │ │ +9DC9A Filename Length 0013 (19) │ │ │ │ +9DC9C Extra Length 0018 (24) │ │ │ │ +9DC9E Comment Length 0000 (0) │ │ │ │ +9DCA0 Disk Start 0000 (0) │ │ │ │ +9DCA2 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DCA4 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DCA8 Local Header Offset 00001651 (5713) │ │ │ │ +9DCAC Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DCAC: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DCBF Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DCC1 Length 0005 (5) │ │ │ │ +9DCC3 Flags 01 (1) 'Modification' │ │ │ │ +9DCC4 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DCC8 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DCCA Length 000B (11) │ │ │ │ +9DCCC Version 01 (1) │ │ │ │ +9DCCD UID Size 04 (4) │ │ │ │ +9DCCE UID 00000000 (0) │ │ │ │ +9DCD2 GID Size 04 (4) │ │ │ │ +9DCD3 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DCD7 CENTRAL HEADER #4 02014B50 (33639248) │ │ │ │ +9DCDB Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DCDC Created OS 03 (3) 'Unix' │ │ │ │ +9DCDD Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DCDE Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DCDF General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DCE1 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DCE3 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DCE7 CRC D01A9A42 (3491404354) │ │ │ │ +9DCEB Compressed Size 00002DA5 (11685) │ │ │ │ +9DCEF Uncompressed Size 0000D0BF (53439) │ │ │ │ +9DCF3 Filename Length 0014 (20) │ │ │ │ +9DCF5 Extra Length 0018 (24) │ │ │ │ +9DCF7 Comment Length 0000 (0) │ │ │ │ +9DCF9 Disk Start 0000 (0) │ │ │ │ +9DCFB Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DCFD Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DD01 Local Header Offset 00001D73 (7539) │ │ │ │ +9DD05 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DD05: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DD19 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DD1B Length 0005 (5) │ │ │ │ +9DD1D Flags 01 (1) 'Modification' │ │ │ │ +9DD1E Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DD22 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DD24 Length 000B (11) │ │ │ │ +9DD26 Version 01 (1) │ │ │ │ +9DD27 UID Size 04 (4) │ │ │ │ +9DD28 UID 00000000 (0) │ │ │ │ +9DD2C GID Size 04 (4) │ │ │ │ +9DD2D GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DD31 CENTRAL HEADER #5 02014B50 (33639248) │ │ │ │ +9DD35 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DD36 Created OS 03 (3) 'Unix' │ │ │ │ +9DD37 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DD38 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DD39 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DD3B Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DD3D Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DD41 CRC 7D6EEFA5 (2104422309) │ │ │ │ +9DD45 Compressed Size 000003F0 (1008) │ │ │ │ +9DD49 Uncompressed Size 00000876 (2166) │ │ │ │ +9DD4D Filename Length 0014 (20) │ │ │ │ +9DD4F Extra Length 0018 (24) │ │ │ │ +9DD51 Comment Length 0000 (0) │ │ │ │ +9DD53 Disk Start 0000 (0) │ │ │ │ +9DD55 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DD57 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DD5B Local Header Offset 00004B66 (19302) │ │ │ │ +9DD5F Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DD5F: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DD73 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DD75 Length 0005 (5) │ │ │ │ +9DD77 Flags 01 (1) 'Modification' │ │ │ │ +9DD78 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DD7C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DD7E Length 000B (11) │ │ │ │ +9DD80 Version 01 (1) │ │ │ │ +9DD81 UID Size 04 (4) │ │ │ │ +9DD82 UID 00000000 (0) │ │ │ │ +9DD86 GID Size 04 (4) │ │ │ │ +9DD87 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DD8B CENTRAL HEADER #6 02014B50 (33639248) │ │ │ │ +9DD8F Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DD90 Created OS 03 (3) 'Unix' │ │ │ │ +9DD91 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DD92 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DD93 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DD95 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DD97 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DD9B CRC A7487B91 (2806545297) │ │ │ │ +9DD9F Compressed Size 000001AE (430) │ │ │ │ +9DDA3 Uncompressed Size 000002FC (764) │ │ │ │ +9DDA7 Filename Length 0011 (17) │ │ │ │ +9DDA9 Extra Length 0018 (24) │ │ │ │ +9DDAB Comment Length 0000 (0) │ │ │ │ +9DDAD Disk Start 0000 (0) │ │ │ │ +9DDAF Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DDB1 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DDB5 Local Header Offset 00004FA4 (20388) │ │ │ │ +9DDB9 Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DDB9: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DDCA Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DDCC Length 0005 (5) │ │ │ │ +9DDCE Flags 01 (1) 'Modification' │ │ │ │ +9DDCF Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DDD3 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DDD5 Length 000B (11) │ │ │ │ +9DDD7 Version 01 (1) │ │ │ │ +9DDD8 UID Size 04 (4) │ │ │ │ +9DDD9 UID 00000000 (0) │ │ │ │ +9DDDD GID Size 04 (4) │ │ │ │ +9DDDE GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DDE2 CENTRAL HEADER #7 02014B50 (33639248) │ │ │ │ +9DDE6 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DDE7 Created OS 03 (3) 'Unix' │ │ │ │ +9DDE8 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DDE9 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DDEA General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DDEC Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DDEE Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DDF2 CRC 9DFB3381 (2650485633) │ │ │ │ +9DDF6 Compressed Size 000020C4 (8388) │ │ │ │ +9DDFA Uncompressed Size 0000B4B0 (46256) │ │ │ │ +9DDFE Filename Length 001B (27) │ │ │ │ +9DE00 Extra Length 0018 (24) │ │ │ │ +9DE02 Comment Length 0000 (0) │ │ │ │ +9DE04 Disk Start 0000 (0) │ │ │ │ +9DE06 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DE08 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DE0C Local Header Offset 0000519D (20893) │ │ │ │ +9DE10 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DE10: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DE2B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DE2D Length 0005 (5) │ │ │ │ +9DE2F Flags 01 (1) 'Modification' │ │ │ │ +9DE30 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DE34 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DE36 Length 000B (11) │ │ │ │ +9DE38 Version 01 (1) │ │ │ │ +9DE39 UID Size 04 (4) │ │ │ │ +9DE3A UID 00000000 (0) │ │ │ │ +9DE3E GID Size 04 (4) │ │ │ │ +9DE3F GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DE43 CENTRAL HEADER #8 02014B50 (33639248) │ │ │ │ +9DE47 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DE48 Created OS 03 (3) 'Unix' │ │ │ │ +9DE49 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DE4A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DE4B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DE4D Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DE4F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DE53 CRC C93D1212 (3376222738) │ │ │ │ +9DE57 Compressed Size 00000E6F (3695) │ │ │ │ +9DE5B Uncompressed Size 000030B2 (12466) │ │ │ │ +9DE5F Filename Length 001D (29) │ │ │ │ +9DE61 Extra Length 0018 (24) │ │ │ │ +9DE63 Comment Length 0000 (0) │ │ │ │ +9DE65 Disk Start 0000 (0) │ │ │ │ +9DE67 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DE69 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DE6D Local Header Offset 000072B6 (29366) │ │ │ │ +9DE71 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DE71: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DE8E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DE90 Length 0005 (5) │ │ │ │ +9DE92 Flags 01 (1) 'Modification' │ │ │ │ +9DE93 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DE97 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DE99 Length 000B (11) │ │ │ │ +9DE9B Version 01 (1) │ │ │ │ +9DE9C UID Size 04 (4) │ │ │ │ +9DE9D UID 00000000 (0) │ │ │ │ +9DEA1 GID Size 04 (4) │ │ │ │ +9DEA2 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DEA6 CENTRAL HEADER #9 02014B50 (33639248) │ │ │ │ +9DEAA Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DEAB Created OS 03 (3) 'Unix' │ │ │ │ +9DEAC Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DEAD Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DEAE General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DEB0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DEB2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DEB6 CRC CF0D8E87 (3473772167) │ │ │ │ +9DEBA Compressed Size 00000972 (2418) │ │ │ │ +9DEBE Uncompressed Size 00001CB2 (7346) │ │ │ │ +9DEC2 Filename Length 0019 (25) │ │ │ │ +9DEC4 Extra Length 0018 (24) │ │ │ │ +9DEC6 Comment Length 0000 (0) │ │ │ │ +9DEC8 Disk Start 0000 (0) │ │ │ │ +9DECA Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DECC Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DED0 Local Header Offset 0000817C (33148) │ │ │ │ +9DED4 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DED4: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DEED Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DEEF Length 0005 (5) │ │ │ │ +9DEF1 Flags 01 (1) 'Modification' │ │ │ │ +9DEF2 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DEF6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DEF8 Length 000B (11) │ │ │ │ +9DEFA Version 01 (1) │ │ │ │ +9DEFB UID Size 04 (4) │ │ │ │ +9DEFC UID 00000000 (0) │ │ │ │ +9DF00 GID Size 04 (4) │ │ │ │ +9DF01 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DF05 CENTRAL HEADER #10 02014B50 (33639248) │ │ │ │ +9DF09 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DF0A Created OS 03 (3) 'Unix' │ │ │ │ +9DF0B Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DF0C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DF0D General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DF0F Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DF11 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DF15 CRC CCF59E6C (3438648940) │ │ │ │ +9DF19 Compressed Size 0000387E (14462) │ │ │ │ +9DF1D Uncompressed Size 0000F7F4 (63476) │ │ │ │ +9DF21 Filename Length 0015 (21) │ │ │ │ +9DF23 Extra Length 0018 (24) │ │ │ │ +9DF25 Comment Length 0000 (0) │ │ │ │ +9DF27 Disk Start 0000 (0) │ │ │ │ +9DF29 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DF2B Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DF2F Local Header Offset 00008B41 (35649) │ │ │ │ +9DF33 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DF33: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DF48 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DF4A Length 0005 (5) │ │ │ │ +9DF4C Flags 01 (1) 'Modification' │ │ │ │ +9DF4D Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DF51 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DF53 Length 000B (11) │ │ │ │ +9DF55 Version 01 (1) │ │ │ │ +9DF56 UID Size 04 (4) │ │ │ │ +9DF57 UID 00000000 (0) │ │ │ │ +9DF5B GID Size 04 (4) │ │ │ │ +9DF5C GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DF60 CENTRAL HEADER #11 02014B50 (33639248) │ │ │ │ +9DF64 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DF65 Created OS 03 (3) 'Unix' │ │ │ │ +9DF66 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DF67 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DF68 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DF6A Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DF6C Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DF70 CRC 0784EB6B (126151531) │ │ │ │ +9DF74 Compressed Size 0000AADF (43743) │ │ │ │ +9DF78 Uncompressed Size 0003DFDE (253918) │ │ │ │ +9DF7C Filename Length 0012 (18) │ │ │ │ +9DF7E Extra Length 0018 (24) │ │ │ │ +9DF80 Comment Length 0000 (0) │ │ │ │ +9DF82 Disk Start 0000 (0) │ │ │ │ +9DF84 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DF86 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DF8A Local Header Offset 0000C40E (50190) │ │ │ │ +9DF8E Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DF8E: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DFA0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DFA2 Length 0005 (5) │ │ │ │ +9DFA4 Flags 01 (1) 'Modification' │ │ │ │ +9DFA5 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9DFA9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9DFAB Length 000B (11) │ │ │ │ +9DFAD Version 01 (1) │ │ │ │ +9DFAE UID Size 04 (4) │ │ │ │ +9DFAF UID 00000000 (0) │ │ │ │ +9DFB3 GID Size 04 (4) │ │ │ │ +9DFB4 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9DFB8 CENTRAL HEADER #12 02014B50 (33639248) │ │ │ │ +9DFBC Created Zip Spec 3D (61) '6.1' │ │ │ │ +9DFBD Created OS 03 (3) 'Unix' │ │ │ │ +9DFBE Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9DFBF Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9DFC0 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9DFC2 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9DFC4 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9DFC8 CRC 466D7134 (1181577524) │ │ │ │ +9DFCC Compressed Size 00003B1F (15135) │ │ │ │ +9DFD0 Uncompressed Size 0001B2A0 (111264) │ │ │ │ +9DFD4 Filename Length 0015 (21) │ │ │ │ +9DFD6 Extra Length 0018 (24) │ │ │ │ +9DFD8 Comment Length 0000 (0) │ │ │ │ +9DFDA Disk Start 0000 (0) │ │ │ │ +9DFDC Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9DFDE Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9DFE2 Local Header Offset 00016F39 (94009) │ │ │ │ +9DFE6 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9DFE6: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9DFFB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9DFFD Length 0005 (5) │ │ │ │ +9DFFF Flags 01 (1) 'Modification' │ │ │ │ +9E000 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E004 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E006 Length 000B (11) │ │ │ │ +9E008 Version 01 (1) │ │ │ │ +9E009 UID Size 04 (4) │ │ │ │ +9E00A UID 00000000 (0) │ │ │ │ +9E00E GID Size 04 (4) │ │ │ │ +9E00F GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E013 CENTRAL HEADER #13 02014B50 (33639248) │ │ │ │ +9E017 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E018 Created OS 03 (3) 'Unix' │ │ │ │ +9E019 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E01A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E01B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E01D Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E01F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E023 CRC 1614FD9C (370474396) │ │ │ │ +9E027 Compressed Size 0000908C (37004) │ │ │ │ +9E02B Uncompressed Size 0003D05F (249951) │ │ │ │ +9E02F Filename Length 0014 (20) │ │ │ │ +9E031 Extra Length 0018 (24) │ │ │ │ +9E033 Comment Length 0000 (0) │ │ │ │ +9E035 Disk Start 0000 (0) │ │ │ │ +9E037 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E039 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E03D Local Header Offset 0001AAA7 (109223) │ │ │ │ +9E041 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E041: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E055 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E057 Length 0005 (5) │ │ │ │ +9E059 Flags 01 (1) 'Modification' │ │ │ │ +9E05A Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E05E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E060 Length 000B (11) │ │ │ │ +9E062 Version 01 (1) │ │ │ │ +9E063 UID Size 04 (4) │ │ │ │ +9E064 UID 00000000 (0) │ │ │ │ +9E068 GID Size 04 (4) │ │ │ │ +9E069 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E06D CENTRAL HEADER #14 02014B50 (33639248) │ │ │ │ +9E071 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E072 Created OS 03 (3) 'Unix' │ │ │ │ +9E073 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E074 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E075 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E077 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E079 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E07D CRC 1689E155 (378134869) │ │ │ │ +9E081 Compressed Size 00002A65 (10853) │ │ │ │ +9E085 Uncompressed Size 0001151F (70943) │ │ │ │ +9E089 Filename Length 0016 (22) │ │ │ │ +9E08B Extra Length 0018 (24) │ │ │ │ +9E08D Comment Length 0000 (0) │ │ │ │ +9E08F Disk Start 0000 (0) │ │ │ │ +9E091 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E093 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E097 Local Header Offset 00023B81 (146305) │ │ │ │ +9E09B Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E09B: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E0B1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E0B3 Length 0005 (5) │ │ │ │ +9E0B5 Flags 01 (1) 'Modification' │ │ │ │ +9E0B6 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E0BA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E0BC Length 000B (11) │ │ │ │ +9E0BE Version 01 (1) │ │ │ │ +9E0BF UID Size 04 (4) │ │ │ │ +9E0C0 UID 00000000 (0) │ │ │ │ +9E0C4 GID Size 04 (4) │ │ │ │ +9E0C5 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E0C9 CENTRAL HEADER #15 02014B50 (33639248) │ │ │ │ +9E0CD Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E0CE Created OS 03 (3) 'Unix' │ │ │ │ +9E0CF Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E0D0 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E0D1 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E0D3 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E0D5 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E0D9 CRC F2ECAFFC (4075597820) │ │ │ │ +9E0DD Compressed Size 000014D6 (5334) │ │ │ │ +9E0E1 Uncompressed Size 00005176 (20854) │ │ │ │ +9E0E5 Filename Length 001D (29) │ │ │ │ +9E0E7 Extra Length 0018 (24) │ │ │ │ +9E0E9 Comment Length 0000 (0) │ │ │ │ +9E0EB Disk Start 0000 (0) │ │ │ │ +9E0ED Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E0EF Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E0F3 Local Header Offset 00026636 (157238) │ │ │ │ +9E0F7 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E0F7: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E114 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E116 Length 0005 (5) │ │ │ │ +9E118 Flags 01 (1) 'Modification' │ │ │ │ +9E119 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E11D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E11F Length 000B (11) │ │ │ │ +9E121 Version 01 (1) │ │ │ │ +9E122 UID Size 04 (4) │ │ │ │ +9E123 UID 00000000 (0) │ │ │ │ +9E127 GID Size 04 (4) │ │ │ │ +9E128 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E12C CENTRAL HEADER #16 02014B50 (33639248) │ │ │ │ +9E130 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E131 Created OS 03 (3) 'Unix' │ │ │ │ +9E132 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E133 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E134 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E136 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E138 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E13C CRC 2D343D18 (758398232) │ │ │ │ +9E140 Compressed Size 000037F8 (14328) │ │ │ │ +9E144 Uncompressed Size 0000E9F0 (59888) │ │ │ │ +9E148 Filename Length 001C (28) │ │ │ │ +9E14A Extra Length 0018 (24) │ │ │ │ +9E14C Comment Length 0000 (0) │ │ │ │ +9E14E Disk Start 0000 (0) │ │ │ │ +9E150 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E152 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E156 Local Header Offset 00027B63 (162659) │ │ │ │ +9E15A Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E15A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E176 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E178 Length 0005 (5) │ │ │ │ +9E17A Flags 01 (1) 'Modification' │ │ │ │ +9E17B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E17F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E181 Length 000B (11) │ │ │ │ +9E183 Version 01 (1) │ │ │ │ +9E184 UID Size 04 (4) │ │ │ │ +9E185 UID 00000000 (0) │ │ │ │ +9E189 GID Size 04 (4) │ │ │ │ +9E18A GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E18E CENTRAL HEADER #17 02014B50 (33639248) │ │ │ │ +9E192 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E193 Created OS 03 (3) 'Unix' │ │ │ │ +9E194 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E195 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E196 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E198 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E19A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E19E CRC AD7122D2 (2909872850) │ │ │ │ +9E1A2 Compressed Size 000006A0 (1696) │ │ │ │ +9E1A6 Uncompressed Size 000011F4 (4596) │ │ │ │ +9E1AA Filename Length 001C (28) │ │ │ │ +9E1AC Extra Length 0018 (24) │ │ │ │ +9E1AE Comment Length 0000 (0) │ │ │ │ +9E1B0 Disk Start 0000 (0) │ │ │ │ +9E1B2 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E1B4 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E1B8 Local Header Offset 0002B3B1 (177073) │ │ │ │ +9E1BC Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E1BC: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E1D8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E1DA Length 0005 (5) │ │ │ │ +9E1DC Flags 01 (1) 'Modification' │ │ │ │ +9E1DD Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E1E1 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E1E3 Length 000B (11) │ │ │ │ +9E1E5 Version 01 (1) │ │ │ │ +9E1E6 UID Size 04 (4) │ │ │ │ +9E1E7 UID 00000000 (0) │ │ │ │ +9E1EB GID Size 04 (4) │ │ │ │ +9E1EC GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E1F0 CENTRAL HEADER #18 02014B50 (33639248) │ │ │ │ +9E1F4 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E1F5 Created OS 03 (3) 'Unix' │ │ │ │ +9E1F6 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E1F7 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E1F8 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E1FA Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E1FC Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E200 CRC 0C323935 (204618037) │ │ │ │ +9E204 Compressed Size 00001080 (4224) │ │ │ │ +9E208 Uncompressed Size 00004BFF (19455) │ │ │ │ +9E20C Filename Length 001B (27) │ │ │ │ +9E20E Extra Length 0018 (24) │ │ │ │ +9E210 Comment Length 0000 (0) │ │ │ │ +9E212 Disk Start 0000 (0) │ │ │ │ +9E214 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E216 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E21A Local Header Offset 0002BAA7 (178855) │ │ │ │ +9E21E Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E21E: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E239 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E23B Length 0005 (5) │ │ │ │ +9E23D Flags 01 (1) 'Modification' │ │ │ │ +9E23E Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E242 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E244 Length 000B (11) │ │ │ │ +9E246 Version 01 (1) │ │ │ │ +9E247 UID Size 04 (4) │ │ │ │ +9E248 UID 00000000 (0) │ │ │ │ +9E24C GID Size 04 (4) │ │ │ │ +9E24D GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E251 CENTRAL HEADER #19 02014B50 (33639248) │ │ │ │ +9E255 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E256 Created OS 03 (3) 'Unix' │ │ │ │ +9E257 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E258 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E259 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E25B Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E25D Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E261 CRC C330469B (3274720923) │ │ │ │ +9E265 Compressed Size 000033AC (13228) │ │ │ │ +9E269 Uncompressed Size 0000BC94 (48276) │ │ │ │ +9E26D Filename Length 001D (29) │ │ │ │ +9E26F Extra Length 0018 (24) │ │ │ │ +9E271 Comment Length 0000 (0) │ │ │ │ +9E273 Disk Start 0000 (0) │ │ │ │ +9E275 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E277 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E27B Local Header Offset 0002CB7C (183164) │ │ │ │ +9E27F Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E27F: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E29C Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E29E Length 0005 (5) │ │ │ │ +9E2A0 Flags 01 (1) 'Modification' │ │ │ │ +9E2A1 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E2A5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E2A7 Length 000B (11) │ │ │ │ +9E2A9 Version 01 (1) │ │ │ │ +9E2AA UID Size 04 (4) │ │ │ │ +9E2AB UID 00000000 (0) │ │ │ │ +9E2AF GID Size 04 (4) │ │ │ │ +9E2B0 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E2B4 CENTRAL HEADER #20 02014B50 (33639248) │ │ │ │ +9E2B8 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E2B9 Created OS 03 (3) 'Unix' │ │ │ │ +9E2BA Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E2BB Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E2BC General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E2BE Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E2C0 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E2C4 CRC C2F13C75 (3270589557) │ │ │ │ +9E2C8 Compressed Size 00000D69 (3433) │ │ │ │ +9E2CC Uncompressed Size 00003876 (14454) │ │ │ │ +9E2D0 Filename Length 001D (29) │ │ │ │ +9E2D2 Extra Length 0018 (24) │ │ │ │ +9E2D4 Comment Length 0000 (0) │ │ │ │ +9E2D6 Disk Start 0000 (0) │ │ │ │ +9E2D8 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E2DA Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E2DE Local Header Offset 0002FF7F (196479) │ │ │ │ +9E2E2 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E2E2: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E2FF Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E301 Length 0005 (5) │ │ │ │ +9E303 Flags 01 (1) 'Modification' │ │ │ │ +9E304 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E308 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E30A Length 000B (11) │ │ │ │ +9E30C Version 01 (1) │ │ │ │ +9E30D UID Size 04 (4) │ │ │ │ +9E30E UID 00000000 (0) │ │ │ │ +9E312 GID Size 04 (4) │ │ │ │ +9E313 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E317 CENTRAL HEADER #21 02014B50 (33639248) │ │ │ │ +9E31B Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E31C Created OS 03 (3) 'Unix' │ │ │ │ +9E31D Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E31E Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E31F General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E321 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E323 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E327 CRC BA736463 (3128124515) │ │ │ │ +9E32B Compressed Size 00001C6B (7275) │ │ │ │ +9E32F Uncompressed Size 0000C186 (49542) │ │ │ │ +9E333 Filename Length 001A (26) │ │ │ │ +9E335 Extra Length 0018 (24) │ │ │ │ +9E337 Comment Length 0000 (0) │ │ │ │ +9E339 Disk Start 0000 (0) │ │ │ │ +9E33B Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E33D Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E341 Local Header Offset 00030D3F (199999) │ │ │ │ +9E345 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E345: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E35F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E361 Length 0005 (5) │ │ │ │ +9E363 Flags 01 (1) 'Modification' │ │ │ │ +9E364 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E368 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E36A Length 000B (11) │ │ │ │ +9E36C Version 01 (1) │ │ │ │ +9E36D UID Size 04 (4) │ │ │ │ +9E36E UID 00000000 (0) │ │ │ │ +9E372 GID Size 04 (4) │ │ │ │ +9E373 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E377 CENTRAL HEADER #22 02014B50 (33639248) │ │ │ │ +9E37B Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E37C Created OS 03 (3) 'Unix' │ │ │ │ +9E37D Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E37E Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E37F General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E381 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E383 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E387 CRC 955F044A (2506032202) │ │ │ │ +9E38B Compressed Size 000003A3 (931) │ │ │ │ +9E38F Uncompressed Size 0000088E (2190) │ │ │ │ +9E393 Filename Length 0012 (18) │ │ │ │ +9E395 Extra Length 0018 (24) │ │ │ │ +9E397 Comment Length 0000 (0) │ │ │ │ +9E399 Disk Start 0000 (0) │ │ │ │ +9E39B Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E39D Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E3A1 Local Header Offset 000329FE (207358) │ │ │ │ +9E3A5 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E3A5: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E3B7 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E3B9 Length 0005 (5) │ │ │ │ +9E3BB Flags 01 (1) 'Modification' │ │ │ │ +9E3BC Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E3C0 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E3C2 Length 000B (11) │ │ │ │ +9E3C4 Version 01 (1) │ │ │ │ +9E3C5 UID Size 04 (4) │ │ │ │ +9E3C6 UID 00000000 (0) │ │ │ │ +9E3CA GID Size 04 (4) │ │ │ │ +9E3CB GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E3CF CENTRAL HEADER #23 02014B50 (33639248) │ │ │ │ +9E3D3 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E3D4 Created OS 03 (3) 'Unix' │ │ │ │ +9E3D5 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E3D6 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E3D7 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E3D9 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E3DB Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E3DF CRC C065C5F8 (3227895288) │ │ │ │ +9E3E3 Compressed Size 000001D4 (468) │ │ │ │ +9E3E7 Uncompressed Size 00000311 (785) │ │ │ │ +9E3EB Filename Length 0020 (32) │ │ │ │ +9E3ED Extra Length 0018 (24) │ │ │ │ +9E3EF Comment Length 0000 (0) │ │ │ │ +9E3F1 Disk Start 0000 (0) │ │ │ │ +9E3F3 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E3F5 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E3F9 Local Header Offset 00032DED (208365) │ │ │ │ +9E3FD Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E3FD: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E41D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E41F Length 0005 (5) │ │ │ │ +9E421 Flags 01 (1) 'Modification' │ │ │ │ +9E422 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E426 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E428 Length 000B (11) │ │ │ │ +9E42A Version 01 (1) │ │ │ │ +9E42B UID Size 04 (4) │ │ │ │ +9E42C UID 00000000 (0) │ │ │ │ +9E430 GID Size 04 (4) │ │ │ │ +9E431 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E435 CENTRAL HEADER #24 02014B50 (33639248) │ │ │ │ +9E439 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E43A Created OS 03 (3) 'Unix' │ │ │ │ +9E43B Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E43C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E43D General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E43F Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E441 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E445 CRC 48CF098B (1221527947) │ │ │ │ +9E449 Compressed Size 000017A7 (6055) │ │ │ │ +9E44D Uncompressed Size 00009CD3 (40147) │ │ │ │ +9E451 Filename Length 001B (27) │ │ │ │ +9E453 Extra Length 0018 (24) │ │ │ │ +9E455 Comment Length 0000 (0) │ │ │ │ +9E457 Disk Start 0000 (0) │ │ │ │ +9E459 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E45B Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E45F Local Header Offset 0003301B (208923) │ │ │ │ +9E463 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E463: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E47E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E480 Length 0005 (5) │ │ │ │ +9E482 Flags 01 (1) 'Modification' │ │ │ │ +9E483 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E487 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E489 Length 000B (11) │ │ │ │ +9E48B Version 01 (1) │ │ │ │ +9E48C UID Size 04 (4) │ │ │ │ +9E48D UID 00000000 (0) │ │ │ │ +9E491 GID Size 04 (4) │ │ │ │ +9E492 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E496 CENTRAL HEADER #25 02014B50 (33639248) │ │ │ │ +9E49A Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E49B Created OS 03 (3) 'Unix' │ │ │ │ +9E49C Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E49D Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E49E General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E4A0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E4A2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E4A6 CRC 3C74E841 (1014294593) │ │ │ │ +9E4AA Compressed Size 00001371 (4977) │ │ │ │ +9E4AE Uncompressed Size 00003B66 (15206) │ │ │ │ +9E4B2 Filename Length 0015 (21) │ │ │ │ +9E4B4 Extra Length 0018 (24) │ │ │ │ +9E4B6 Comment Length 0000 (0) │ │ │ │ +9E4B8 Disk Start 0000 (0) │ │ │ │ +9E4BA Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E4BC Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E4C0 Local Header Offset 00034817 (215063) │ │ │ │ +9E4C4 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E4C4: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E4D9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E4DB Length 0005 (5) │ │ │ │ +9E4DD Flags 01 (1) 'Modification' │ │ │ │ +9E4DE Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E4E2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E4E4 Length 000B (11) │ │ │ │ +9E4E6 Version 01 (1) │ │ │ │ +9E4E7 UID Size 04 (4) │ │ │ │ +9E4E8 UID 00000000 (0) │ │ │ │ +9E4EC GID Size 04 (4) │ │ │ │ +9E4ED GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E4F1 CENTRAL HEADER #26 02014B50 (33639248) │ │ │ │ +9E4F5 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E4F6 Created OS 03 (3) 'Unix' │ │ │ │ +9E4F7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E4F8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E4F9 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E4FB Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E4FD Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E501 CRC FF345113 (4281618707) │ │ │ │ +9E505 Compressed Size 00000AD0 (2768) │ │ │ │ +9E509 Uncompressed Size 00002135 (8501) │ │ │ │ +9E50D Filename Length 0011 (17) │ │ │ │ +9E50F Extra Length 0018 (24) │ │ │ │ +9E511 Comment Length 0000 (0) │ │ │ │ +9E513 Disk Start 0000 (0) │ │ │ │ +9E515 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E517 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E51B Local Header Offset 00035BD7 (220119) │ │ │ │ +9E51F Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E51F: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E530 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E532 Length 0005 (5) │ │ │ │ +9E534 Flags 01 (1) 'Modification' │ │ │ │ +9E535 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E539 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E53B Length 000B (11) │ │ │ │ +9E53D Version 01 (1) │ │ │ │ +9E53E UID Size 04 (4) │ │ │ │ +9E53F UID 00000000 (0) │ │ │ │ +9E543 GID Size 04 (4) │ │ │ │ +9E544 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E548 CENTRAL HEADER #27 02014B50 (33639248) │ │ │ │ +9E54C Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E54D Created OS 03 (3) 'Unix' │ │ │ │ +9E54E Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E54F Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E550 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E552 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E554 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E558 CRC 07458E40 (121998912) │ │ │ │ +9E55C Compressed Size 000003FD (1021) │ │ │ │ +9E560 Uncompressed Size 00000E99 (3737) │ │ │ │ +9E564 Filename Length 0014 (20) │ │ │ │ +9E566 Extra Length 0018 (24) │ │ │ │ +9E568 Comment Length 0000 (0) │ │ │ │ +9E56A Disk Start 0000 (0) │ │ │ │ +9E56C Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E56E Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E572 Local Header Offset 000366F2 (222962) │ │ │ │ +9E576 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E576: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E58A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E58C Length 0005 (5) │ │ │ │ +9E58E Flags 01 (1) 'Modification' │ │ │ │ +9E58F Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E593 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E595 Length 000B (11) │ │ │ │ +9E597 Version 01 (1) │ │ │ │ +9E598 UID Size 04 (4) │ │ │ │ +9E599 UID 00000000 (0) │ │ │ │ +9E59D GID Size 04 (4) │ │ │ │ +9E59E GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E5A2 CENTRAL HEADER #28 02014B50 (33639248) │ │ │ │ +9E5A6 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E5A7 Created OS 03 (3) 'Unix' │ │ │ │ +9E5A8 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E5A9 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E5AA General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E5AC Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E5AE Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E5B2 CRC 858C8599 (2240578969) │ │ │ │ +9E5B6 Compressed Size 00001262 (4706) │ │ │ │ +9E5BA Uncompressed Size 00003469 (13417) │ │ │ │ +9E5BE Filename Length 0014 (20) │ │ │ │ +9E5C0 Extra Length 0018 (24) │ │ │ │ +9E5C2 Comment Length 0000 (0) │ │ │ │ +9E5C4 Disk Start 0000 (0) │ │ │ │ +9E5C6 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E5C8 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E5CC Local Header Offset 00036B3D (224061) │ │ │ │ +9E5D0 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E5D0: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E5E4 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E5E6 Length 0005 (5) │ │ │ │ +9E5E8 Flags 01 (1) 'Modification' │ │ │ │ +9E5E9 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E5ED Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E5EF Length 000B (11) │ │ │ │ +9E5F1 Version 01 (1) │ │ │ │ +9E5F2 UID Size 04 (4) │ │ │ │ +9E5F3 UID 00000000 (0) │ │ │ │ +9E5F7 GID Size 04 (4) │ │ │ │ +9E5F8 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E5FC CENTRAL HEADER #29 02014B50 (33639248) │ │ │ │ +9E600 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E601 Created OS 03 (3) 'Unix' │ │ │ │ +9E602 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E603 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E604 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E606 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E608 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E60C CRC 020FABEC (34581484) │ │ │ │ +9E610 Compressed Size 00000ACD (2765) │ │ │ │ +9E614 Uncompressed Size 000022FF (8959) │ │ │ │ +9E618 Filename Length 001B (27) │ │ │ │ +9E61A Extra Length 0018 (24) │ │ │ │ +9E61C Comment Length 0000 (0) │ │ │ │ +9E61E Disk Start 0000 (0) │ │ │ │ +9E620 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E622 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E626 Local Header Offset 00037DED (228845) │ │ │ │ +9E62A Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E62A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E645 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E647 Length 0005 (5) │ │ │ │ +9E649 Flags 01 (1) 'Modification' │ │ │ │ +9E64A Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E64E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E650 Length 000B (11) │ │ │ │ +9E652 Version 01 (1) │ │ │ │ +9E653 UID Size 04 (4) │ │ │ │ +9E654 UID 00000000 (0) │ │ │ │ +9E658 GID Size 04 (4) │ │ │ │ +9E659 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E65D CENTRAL HEADER #30 02014B50 (33639248) │ │ │ │ +9E661 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E662 Created OS 03 (3) 'Unix' │ │ │ │ +9E663 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E664 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E665 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E667 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E669 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E66D CRC 9539B70D (2503587597) │ │ │ │ +9E671 Compressed Size 00000A8E (2702) │ │ │ │ +9E675 Uncompressed Size 0000237A (9082) │ │ │ │ +9E679 Filename Length 0013 (19) │ │ │ │ +9E67B Extra Length 0018 (24) │ │ │ │ +9E67D Comment Length 0000 (0) │ │ │ │ +9E67F Disk Start 0000 (0) │ │ │ │ +9E681 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E683 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E687 Local Header Offset 0003890F (231695) │ │ │ │ +9E68B Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E68B: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E69E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E6A0 Length 0005 (5) │ │ │ │ +9E6A2 Flags 01 (1) 'Modification' │ │ │ │ +9E6A3 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E6A7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E6A9 Length 000B (11) │ │ │ │ +9E6AB Version 01 (1) │ │ │ │ +9E6AC UID Size 04 (4) │ │ │ │ +9E6AD UID 00000000 (0) │ │ │ │ +9E6B1 GID Size 04 (4) │ │ │ │ +9E6B2 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E6B6 CENTRAL HEADER #31 02014B50 (33639248) │ │ │ │ +9E6BA Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E6BB Created OS 03 (3) 'Unix' │ │ │ │ +9E6BC Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E6BD Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E6BE General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E6C0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E6C2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E6C6 CRC AE91DBDB (2928794587) │ │ │ │ +9E6CA Compressed Size 00000F49 (3913) │ │ │ │ +9E6CE Uncompressed Size 000036F1 (14065) │ │ │ │ +9E6D2 Filename Length 000F (15) │ │ │ │ +9E6D4 Extra Length 0018 (24) │ │ │ │ +9E6D6 Comment Length 0000 (0) │ │ │ │ +9E6D8 Disk Start 0000 (0) │ │ │ │ +9E6DA Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E6DC Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E6E0 Local Header Offset 000393EA (234474) │ │ │ │ +9E6E4 Filename 'XXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E6E4: Filename 'XXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E6F3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E6F5 Length 0005 (5) │ │ │ │ +9E6F7 Flags 01 (1) 'Modification' │ │ │ │ +9E6F8 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E6FC Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E6FE Length 000B (11) │ │ │ │ +9E700 Version 01 (1) │ │ │ │ +9E701 UID Size 04 (4) │ │ │ │ +9E702 UID 00000000 (0) │ │ │ │ +9E706 GID Size 04 (4) │ │ │ │ +9E707 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E70B CENTRAL HEADER #32 02014B50 (33639248) │ │ │ │ +9E70F Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E710 Created OS 03 (3) 'Unix' │ │ │ │ +9E711 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E712 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E713 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E715 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E717 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E71B CRC 0DF8D9F7 (234412535) │ │ │ │ +9E71F Compressed Size 0000066A (1642) │ │ │ │ +9E723 Uncompressed Size 000018DF (6367) │ │ │ │ +9E727 Filename Length 000F (15) │ │ │ │ +9E729 Extra Length 0018 (24) │ │ │ │ +9E72B Comment Length 0000 (0) │ │ │ │ +9E72D Disk Start 0000 (0) │ │ │ │ +9E72F Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E731 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E735 Local Header Offset 0003A37C (238460) │ │ │ │ +9E739 Filename 'XXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E739: Filename 'XXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E748 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E74A Length 0005 (5) │ │ │ │ +9E74C Flags 01 (1) 'Modification' │ │ │ │ +9E74D Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E751 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E753 Length 000B (11) │ │ │ │ +9E755 Version 01 (1) │ │ │ │ +9E756 UID Size 04 (4) │ │ │ │ +9E757 UID 00000000 (0) │ │ │ │ +9E75B GID Size 04 (4) │ │ │ │ +9E75C GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E760 CENTRAL HEADER #33 02014B50 (33639248) │ │ │ │ +9E764 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E765 Created OS 03 (3) 'Unix' │ │ │ │ +9E766 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E767 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E768 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E76A Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E76C Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E770 CRC 62BEE432 (1656677426) │ │ │ │ +9E774 Compressed Size 00001A46 (6726) │ │ │ │ +9E778 Uncompressed Size 000064F2 (25842) │ │ │ │ +9E77C Filename Length 0013 (19) │ │ │ │ +9E77E Extra Length 0018 (24) │ │ │ │ +9E780 Comment Length 0000 (0) │ │ │ │ +9E782 Disk Start 0000 (0) │ │ │ │ +9E784 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E786 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E78A Local Header Offset 0003AA2F (240175) │ │ │ │ +9E78E Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E78E: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E7A1 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E7A3 Length 0005 (5) │ │ │ │ +9E7A5 Flags 01 (1) 'Modification' │ │ │ │ +9E7A6 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E7AA Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E7AC Length 000B (11) │ │ │ │ +9E7AE Version 01 (1) │ │ │ │ +9E7AF UID Size 04 (4) │ │ │ │ +9E7B0 UID 00000000 (0) │ │ │ │ +9E7B4 GID Size 04 (4) │ │ │ │ +9E7B5 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E7B9 CENTRAL HEADER #34 02014B50 (33639248) │ │ │ │ +9E7BD Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E7BE Created OS 03 (3) 'Unix' │ │ │ │ +9E7BF Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E7C0 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E7C1 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E7C3 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E7C5 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E7C9 CRC FAA9DD12 (4205436178) │ │ │ │ +9E7CD Compressed Size 000009A6 (2470) │ │ │ │ +9E7D1 Uncompressed Size 00001B64 (7012) │ │ │ │ +9E7D5 Filename Length 0010 (16) │ │ │ │ +9E7D7 Extra Length 0018 (24) │ │ │ │ +9E7D9 Comment Length 0000 (0) │ │ │ │ +9E7DB Disk Start 0000 (0) │ │ │ │ +9E7DD Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E7DF Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E7E3 Local Header Offset 0003C4C2 (246978) │ │ │ │ +9E7E7 Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E7E7: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E7F7 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E7F9 Length 0005 (5) │ │ │ │ +9E7FB Flags 01 (1) 'Modification' │ │ │ │ +9E7FC Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E800 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E802 Length 000B (11) │ │ │ │ +9E804 Version 01 (1) │ │ │ │ +9E805 UID Size 04 (4) │ │ │ │ +9E806 UID 00000000 (0) │ │ │ │ +9E80A GID Size 04 (4) │ │ │ │ +9E80B GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E80F CENTRAL HEADER #35 02014B50 (33639248) │ │ │ │ +9E813 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E814 Created OS 03 (3) 'Unix' │ │ │ │ +9E815 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E816 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E817 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E819 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E81B Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E81F CRC FEC4FE23 (4274322979) │ │ │ │ +9E823 Compressed Size 000006B7 (1719) │ │ │ │ +9E827 Uncompressed Size 00001565 (5477) │ │ │ │ +9E82B Filename Length 0012 (18) │ │ │ │ +9E82D Extra Length 0018 (24) │ │ │ │ +9E82F Comment Length 0000 (0) │ │ │ │ +9E831 Disk Start 0000 (0) │ │ │ │ +9E833 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E835 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E839 Local Header Offset 0003CEB2 (249522) │ │ │ │ +9E83D Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E83D: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E84F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E851 Length 0005 (5) │ │ │ │ +9E853 Flags 01 (1) 'Modification' │ │ │ │ +9E854 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E858 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E85A Length 000B (11) │ │ │ │ +9E85C Version 01 (1) │ │ │ │ +9E85D UID Size 04 (4) │ │ │ │ +9E85E UID 00000000 (0) │ │ │ │ +9E862 GID Size 04 (4) │ │ │ │ +9E863 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E867 CENTRAL HEADER #36 02014B50 (33639248) │ │ │ │ +9E86B Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E86C Created OS 03 (3) 'Unix' │ │ │ │ +9E86D Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E86E Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E86F General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E871 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E873 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E877 CRC 2516A309 (622240521) │ │ │ │ +9E87B Compressed Size 00002A14 (10772) │ │ │ │ +9E87F Uncompressed Size 0000B1C5 (45509) │ │ │ │ +9E883 Filename Length 0010 (16) │ │ │ │ +9E885 Extra Length 0018 (24) │ │ │ │ +9E887 Comment Length 0000 (0) │ │ │ │ +9E889 Disk Start 0000 (0) │ │ │ │ +9E88B Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E88D Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E891 Local Header Offset 0003D5B5 (251317) │ │ │ │ +9E895 Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E895: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E8A5 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E8A7 Length 0005 (5) │ │ │ │ +9E8A9 Flags 01 (1) 'Modification' │ │ │ │ +9E8AA Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E8AE Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E8B0 Length 000B (11) │ │ │ │ +9E8B2 Version 01 (1) │ │ │ │ +9E8B3 UID Size 04 (4) │ │ │ │ +9E8B4 UID 00000000 (0) │ │ │ │ +9E8B8 GID Size 04 (4) │ │ │ │ +9E8B9 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E8BD CENTRAL HEADER #37 02014B50 (33639248) │ │ │ │ +9E8C1 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E8C2 Created OS 03 (3) 'Unix' │ │ │ │ +9E8C3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E8C4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E8C5 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E8C7 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E8C9 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E8CD CRC 501928CE (1343826126) │ │ │ │ +9E8D1 Compressed Size 00001E8A (7818) │ │ │ │ +9E8D5 Uncompressed Size 00009AAA (39594) │ │ │ │ +9E8D9 Filename Length 0012 (18) │ │ │ │ +9E8DB Extra Length 0018 (24) │ │ │ │ +9E8DD Comment Length 0000 (0) │ │ │ │ +9E8DF Disk Start 0000 (0) │ │ │ │ +9E8E1 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E8E3 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E8E7 Local Header Offset 00040013 (262163) │ │ │ │ +9E8EB Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E8EB: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E8FD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E8FF Length 0005 (5) │ │ │ │ +9E901 Flags 01 (1) 'Modification' │ │ │ │ +9E902 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E906 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E908 Length 000B (11) │ │ │ │ +9E90A Version 01 (1) │ │ │ │ +9E90B UID Size 04 (4) │ │ │ │ +9E90C UID 00000000 (0) │ │ │ │ +9E910 GID Size 04 (4) │ │ │ │ +9E911 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E915 CENTRAL HEADER #38 02014B50 (33639248) │ │ │ │ +9E919 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E91A Created OS 03 (3) 'Unix' │ │ │ │ +9E91B Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E91C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E91D General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E91F Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E921 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E925 CRC FB7154A3 (4218508451) │ │ │ │ +9E929 Compressed Size 00001479 (5241) │ │ │ │ +9E92D Uncompressed Size 00007ACF (31439) │ │ │ │ +9E931 Filename Length 0018 (24) │ │ │ │ +9E933 Extra Length 0018 (24) │ │ │ │ +9E935 Comment Length 0000 (0) │ │ │ │ +9E937 Disk Start 0000 (0) │ │ │ │ +9E939 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E93B Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E93F Local Header Offset 00041EE9 (270057) │ │ │ │ +9E943 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E943: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E95B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E95D Length 0005 (5) │ │ │ │ +9E95F Flags 01 (1) 'Modification' │ │ │ │ +9E960 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E964 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E966 Length 000B (11) │ │ │ │ +9E968 Version 01 (1) │ │ │ │ +9E969 UID Size 04 (4) │ │ │ │ +9E96A UID 00000000 (0) │ │ │ │ +9E96E GID Size 04 (4) │ │ │ │ +9E96F GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E973 CENTRAL HEADER #39 02014B50 (33639248) │ │ │ │ +9E977 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E978 Created OS 03 (3) 'Unix' │ │ │ │ +9E979 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E97A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E97B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E97D Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E97F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E983 CRC 5FAB8EF0 (1605078768) │ │ │ │ +9E987 Compressed Size 000018D0 (6352) │ │ │ │ +9E98B Uncompressed Size 0000A7F4 (42996) │ │ │ │ +9E98F Filename Length 001F (31) │ │ │ │ +9E991 Extra Length 0018 (24) │ │ │ │ +9E993 Comment Length 0000 (0) │ │ │ │ +9E995 Disk Start 0000 (0) │ │ │ │ +9E997 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E999 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9E99D Local Header Offset 000433B4 (275380) │ │ │ │ +9E9A1 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9E9A1: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9E9C0 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9E9C2 Length 0005 (5) │ │ │ │ +9E9C4 Flags 01 (1) 'Modification' │ │ │ │ +9E9C5 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9E9C9 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9E9CB Length 000B (11) │ │ │ │ +9E9CD Version 01 (1) │ │ │ │ +9E9CE UID Size 04 (4) │ │ │ │ +9E9CF UID 00000000 (0) │ │ │ │ +9E9D3 GID Size 04 (4) │ │ │ │ +9E9D4 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9E9D8 CENTRAL HEADER #40 02014B50 (33639248) │ │ │ │ +9E9DC Created Zip Spec 3D (61) '6.1' │ │ │ │ +9E9DD Created OS 03 (3) 'Unix' │ │ │ │ +9E9DE Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9E9DF Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9E9E0 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9E9E2 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9E9E4 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9E9E8 CRC 59BC913A (1505530170) │ │ │ │ +9E9EC Compressed Size 000003F7 (1015) │ │ │ │ +9E9F0 Uncompressed Size 000008A3 (2211) │ │ │ │ +9E9F4 Filename Length 001E (30) │ │ │ │ +9E9F6 Extra Length 0018 (24) │ │ │ │ +9E9F8 Comment Length 0000 (0) │ │ │ │ +9E9FA Disk Start 0000 (0) │ │ │ │ +9E9FC Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9E9FE Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EA02 Local Header Offset 00044CDD (281821) │ │ │ │ +9EA06 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EA06: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EA24 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EA26 Length 0005 (5) │ │ │ │ +9EA28 Flags 01 (1) 'Modification' │ │ │ │ +9EA29 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EA2D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EA2F Length 000B (11) │ │ │ │ +9EA31 Version 01 (1) │ │ │ │ +9EA32 UID Size 04 (4) │ │ │ │ +9EA33 UID 00000000 (0) │ │ │ │ +9EA37 GID Size 04 (4) │ │ │ │ +9EA38 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EA3C CENTRAL HEADER #41 02014B50 (33639248) │ │ │ │ +9EA40 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EA41 Created OS 03 (3) 'Unix' │ │ │ │ +9EA42 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EA43 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EA44 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EA46 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EA48 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EA4C CRC 1C972FAC (479670188) │ │ │ │ +9EA50 Compressed Size 00004293 (17043) │ │ │ │ +9EA54 Uncompressed Size 0000D8DC (55516) │ │ │ │ +9EA58 Filename Length 0013 (19) │ │ │ │ +9EA5A Extra Length 0018 (24) │ │ │ │ +9EA5C Comment Length 0000 (0) │ │ │ │ +9EA5E Disk Start 0000 (0) │ │ │ │ +9EA60 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EA62 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EA66 Local Header Offset 0004512C (282924) │ │ │ │ +9EA6A Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EA6A: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EA7D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EA7F Length 0005 (5) │ │ │ │ +9EA81 Flags 01 (1) 'Modification' │ │ │ │ +9EA82 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EA86 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EA88 Length 000B (11) │ │ │ │ +9EA8A Version 01 (1) │ │ │ │ +9EA8B UID Size 04 (4) │ │ │ │ +9EA8C UID 00000000 (0) │ │ │ │ +9EA90 GID Size 04 (4) │ │ │ │ +9EA91 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EA95 CENTRAL HEADER #42 02014B50 (33639248) │ │ │ │ +9EA99 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EA9A Created OS 03 (3) 'Unix' │ │ │ │ +9EA9B Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EA9C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EA9D General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EA9F Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EAA1 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EAA5 CRC E2874F49 (3800518473) │ │ │ │ +9EAA9 Compressed Size 000026C5 (9925) │ │ │ │ +9EAAD Uncompressed Size 00006E45 (28229) │ │ │ │ +9EAB1 Filename Length 0019 (25) │ │ │ │ +9EAB3 Extra Length 0018 (24) │ │ │ │ +9EAB5 Comment Length 0000 (0) │ │ │ │ +9EAB7 Disk Start 0000 (0) │ │ │ │ +9EAB9 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EABB Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EABF Local Header Offset 0004940C (300044) │ │ │ │ +9EAC3 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EAC3: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EADC Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EADE Length 0005 (5) │ │ │ │ +9EAE0 Flags 01 (1) 'Modification' │ │ │ │ +9EAE1 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EAE5 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EAE7 Length 000B (11) │ │ │ │ +9EAE9 Version 01 (1) │ │ │ │ +9EAEA UID Size 04 (4) │ │ │ │ +9EAEB UID 00000000 (0) │ │ │ │ +9EAEF GID Size 04 (4) │ │ │ │ +9EAF0 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EAF4 CENTRAL HEADER #43 02014B50 (33639248) │ │ │ │ +9EAF8 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EAF9 Created OS 03 (3) 'Unix' │ │ │ │ +9EAFA Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EAFB Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EAFC General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EAFE Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EB00 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EB04 CRC 8AC46E96 (2328129174) │ │ │ │ +9EB08 Compressed Size 00002739 (10041) │ │ │ │ +9EB0C Uncompressed Size 00008B83 (35715) │ │ │ │ +9EB10 Filename Length 0019 (25) │ │ │ │ +9EB12 Extra Length 0018 (24) │ │ │ │ +9EB14 Comment Length 0000 (0) │ │ │ │ +9EB16 Disk Start 0000 (0) │ │ │ │ +9EB18 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EB1A Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EB1E Local Header Offset 0004BB24 (310052) │ │ │ │ +9EB22 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EB22: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EB3B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EB3D Length 0005 (5) │ │ │ │ +9EB3F Flags 01 (1) 'Modification' │ │ │ │ +9EB40 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EB44 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EB46 Length 000B (11) │ │ │ │ +9EB48 Version 01 (1) │ │ │ │ +9EB49 UID Size 04 (4) │ │ │ │ +9EB4A UID 00000000 (0) │ │ │ │ +9EB4E GID Size 04 (4) │ │ │ │ +9EB4F GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EB53 CENTRAL HEADER #44 02014B50 (33639248) │ │ │ │ +9EB57 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EB58 Created OS 03 (3) 'Unix' │ │ │ │ +9EB59 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EB5A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EB5B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EB5D Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EB5F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EB63 CRC 331975F0 (857306608) │ │ │ │ +9EB67 Compressed Size 00000CF0 (3312) │ │ │ │ +9EB6B Uncompressed Size 0000517A (20858) │ │ │ │ +9EB6F Filename Length 0021 (33) │ │ │ │ +9EB71 Extra Length 0018 (24) │ │ │ │ +9EB73 Comment Length 0000 (0) │ │ │ │ +9EB75 Disk Start 0000 (0) │ │ │ │ +9EB77 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EB79 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EB7D Local Header Offset 0004E2B0 (320176) │ │ │ │ +9EB81 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EB81: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EBA2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EBA4 Length 0005 (5) │ │ │ │ +9EBA6 Flags 01 (1) 'Modification' │ │ │ │ +9EBA7 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EBAB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EBAD Length 000B (11) │ │ │ │ +9EBAF Version 01 (1) │ │ │ │ +9EBB0 UID Size 04 (4) │ │ │ │ +9EBB1 UID 00000000 (0) │ │ │ │ +9EBB5 GID Size 04 (4) │ │ │ │ +9EBB6 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EBBA CENTRAL HEADER #45 02014B50 (33639248) │ │ │ │ +9EBBE Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EBBF Created OS 03 (3) 'Unix' │ │ │ │ +9EBC0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EBC1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EBC2 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EBC4 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EBC6 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EBCA CRC 0463353E (73610558) │ │ │ │ +9EBCE Compressed Size 00000468 (1128) │ │ │ │ +9EBD2 Uncompressed Size 00000931 (2353) │ │ │ │ +9EBD6 Filename Length 001B (27) │ │ │ │ +9EBD8 Extra Length 0018 (24) │ │ │ │ +9EBDA Comment Length 0000 (0) │ │ │ │ +9EBDC Disk Start 0000 (0) │ │ │ │ +9EBDE Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EBE0 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EBE4 Local Header Offset 0004EFFB (323579) │ │ │ │ +9EBE8 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EBE8: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EC03 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EC05 Length 0005 (5) │ │ │ │ +9EC07 Flags 01 (1) 'Modification' │ │ │ │ +9EC08 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EC0C Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EC0E Length 000B (11) │ │ │ │ +9EC10 Version 01 (1) │ │ │ │ +9EC11 UID Size 04 (4) │ │ │ │ +9EC12 UID 00000000 (0) │ │ │ │ +9EC16 GID Size 04 (4) │ │ │ │ +9EC17 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EC1B CENTRAL HEADER #46 02014B50 (33639248) │ │ │ │ +9EC1F Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EC20 Created OS 03 (3) 'Unix' │ │ │ │ +9EC21 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EC22 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EC23 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EC25 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EC27 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EC2B CRC 87EEE08A (2280579210) │ │ │ │ +9EC2F Compressed Size 000016F3 (5875) │ │ │ │ +9EC33 Uncompressed Size 00007A6D (31341) │ │ │ │ +9EC37 Filename Length 001F (31) │ │ │ │ +9EC39 Extra Length 0018 (24) │ │ │ │ +9EC3B Comment Length 0000 (0) │ │ │ │ +9EC3D Disk Start 0000 (0) │ │ │ │ +9EC3F Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EC41 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EC45 Local Header Offset 0004F4B8 (324792) │ │ │ │ +9EC49 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EC49: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EC68 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EC6A Length 0005 (5) │ │ │ │ +9EC6C Flags 01 (1) 'Modification' │ │ │ │ +9EC6D Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EC71 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EC73 Length 000B (11) │ │ │ │ +9EC75 Version 01 (1) │ │ │ │ +9EC76 UID Size 04 (4) │ │ │ │ +9EC77 UID 00000000 (0) │ │ │ │ +9EC7B GID Size 04 (4) │ │ │ │ +9EC7C GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EC80 CENTRAL HEADER #47 02014B50 (33639248) │ │ │ │ +9EC84 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EC85 Created OS 03 (3) 'Unix' │ │ │ │ +9EC86 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EC87 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EC88 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EC8A Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EC8C Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EC90 CRC 936CB7B6 (2473375670) │ │ │ │ +9EC94 Compressed Size 00004170 (16752) │ │ │ │ +9EC98 Uncompressed Size 0001CF93 (118675) │ │ │ │ +9EC9C Filename Length 0010 (16) │ │ │ │ +9EC9E Extra Length 0018 (24) │ │ │ │ +9ECA0 Comment Length 0000 (0) │ │ │ │ +9ECA2 Disk Start 0000 (0) │ │ │ │ +9ECA4 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9ECA6 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9ECAA Local Header Offset 00050C04 (330756) │ │ │ │ +9ECAE Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9ECAE: Filename 'XXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9ECBE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9ECC0 Length 0005 (5) │ │ │ │ +9ECC2 Flags 01 (1) 'Modification' │ │ │ │ +9ECC3 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9ECC7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9ECC9 Length 000B (11) │ │ │ │ +9ECCB Version 01 (1) │ │ │ │ +9ECCC UID Size 04 (4) │ │ │ │ +9ECCD UID 00000000 (0) │ │ │ │ +9ECD1 GID Size 04 (4) │ │ │ │ +9ECD2 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9ECD6 CENTRAL HEADER #48 02014B50 (33639248) │ │ │ │ +9ECDA Created Zip Spec 3D (61) '6.1' │ │ │ │ +9ECDB Created OS 03 (3) 'Unix' │ │ │ │ +9ECDC Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9ECDD Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9ECDE General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9ECE0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9ECE2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9ECE6 CRC 1D57686C (492267628) │ │ │ │ +9ECEA Compressed Size 00000A93 (2707) │ │ │ │ +9ECEE Uncompressed Size 00002105 (8453) │ │ │ │ +9ECF2 Filename Length 0014 (20) │ │ │ │ +9ECF4 Extra Length 0018 (24) │ │ │ │ +9ECF6 Comment Length 0000 (0) │ │ │ │ +9ECF8 Disk Start 0000 (0) │ │ │ │ +9ECFA Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9ECFC Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9ED00 Local Header Offset 00054DBE (347582) │ │ │ │ +9ED04 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9ED04: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9ED18 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9ED1A Length 0005 (5) │ │ │ │ +9ED1C Flags 01 (1) 'Modification' │ │ │ │ +9ED1D Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9ED21 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9ED23 Length 000B (11) │ │ │ │ +9ED25 Version 01 (1) │ │ │ │ +9ED26 UID Size 04 (4) │ │ │ │ +9ED27 UID 00000000 (0) │ │ │ │ +9ED2B GID Size 04 (4) │ │ │ │ +9ED2C GID 00000000 (0) │ │ │ │ + │ │ │ │ +9ED30 CENTRAL HEADER #49 02014B50 (33639248) │ │ │ │ +9ED34 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9ED35 Created OS 03 (3) 'Unix' │ │ │ │ +9ED36 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9ED37 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9ED38 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9ED3A Compression Method 0008 (8) 'Deflated' │ │ │ │ +9ED3C Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9ED40 CRC 39338677 (959678071) │ │ │ │ +9ED44 Compressed Size 0000ACA1 (44193) │ │ │ │ +9ED48 Uncompressed Size 0003E418 (255000) │ │ │ │ +9ED4C Filename Length 0017 (23) │ │ │ │ +9ED4E Extra Length 0018 (24) │ │ │ │ +9ED50 Comment Length 0000 (0) │ │ │ │ +9ED52 Disk Start 0000 (0) │ │ │ │ +9ED54 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9ED56 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9ED5A Local Header Offset 0005589F (350367) │ │ │ │ +9ED5E Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9ED5E: Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9ED75 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9ED77 Length 0005 (5) │ │ │ │ +9ED79 Flags 01 (1) 'Modification' │ │ │ │ +9ED7A Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9ED7E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9ED80 Length 000B (11) │ │ │ │ +9ED82 Version 01 (1) │ │ │ │ +9ED83 UID Size 04 (4) │ │ │ │ +9ED84 UID 00000000 (0) │ │ │ │ +9ED88 GID Size 04 (4) │ │ │ │ +9ED89 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9ED8D CENTRAL HEADER #50 02014B50 (33639248) │ │ │ │ +9ED91 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9ED92 Created OS 03 (3) 'Unix' │ │ │ │ +9ED93 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9ED94 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9ED95 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9ED97 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9ED99 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9ED9D CRC AAB1E936 (2863786294) │ │ │ │ +9EDA1 Compressed Size 00000401 (1025) │ │ │ │ +9EDA5 Uncompressed Size 0000093D (2365) │ │ │ │ +9EDA9 Filename Length 0013 (19) │ │ │ │ +9EDAB Extra Length 0018 (24) │ │ │ │ +9EDAD Comment Length 0000 (0) │ │ │ │ +9EDAF Disk Start 0000 (0) │ │ │ │ +9EDB1 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EDB3 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EDB7 Local Header Offset 00060591 (394641) │ │ │ │ +9EDBB Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EDBB: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EDCE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EDD0 Length 0005 (5) │ │ │ │ +9EDD2 Flags 01 (1) 'Modification' │ │ │ │ +9EDD3 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EDD7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EDD9 Length 000B (11) │ │ │ │ +9EDDB Version 01 (1) │ │ │ │ +9EDDC UID Size 04 (4) │ │ │ │ +9EDDD UID 00000000 (0) │ │ │ │ +9EDE1 GID Size 04 (4) │ │ │ │ +9EDE2 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EDE6 CENTRAL HEADER #51 02014B50 (33639248) │ │ │ │ +9EDEA Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EDEB Created OS 03 (3) 'Unix' │ │ │ │ +9EDEC Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EDED Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EDEE General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EDF0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EDF2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EDF6 CRC 766E7C2E (1986952238) │ │ │ │ +9EDFA Compressed Size 000014E6 (5350) │ │ │ │ +9EDFE Uncompressed Size 0000687B (26747) │ │ │ │ +9EE02 Filename Length 0012 (18) │ │ │ │ +9EE04 Extra Length 0018 (24) │ │ │ │ +9EE06 Comment Length 0000 (0) │ │ │ │ +9EE08 Disk Start 0000 (0) │ │ │ │ +9EE0A Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EE0C Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EE10 Local Header Offset 000609DF (395743) │ │ │ │ +9EE14 Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EE14: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EE26 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EE28 Length 0005 (5) │ │ │ │ +9EE2A Flags 01 (1) 'Modification' │ │ │ │ +9EE2B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EE2F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EE31 Length 000B (11) │ │ │ │ +9EE33 Version 01 (1) │ │ │ │ +9EE34 UID Size 04 (4) │ │ │ │ +9EE35 UID 00000000 (0) │ │ │ │ +9EE39 GID Size 04 (4) │ │ │ │ +9EE3A GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EE3E CENTRAL HEADER #52 02014B50 (33639248) │ │ │ │ +9EE42 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EE43 Created OS 03 (3) 'Unix' │ │ │ │ +9EE44 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EE45 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EE46 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EE48 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EE4A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EE4E CRC A23B6E88 (2721803912) │ │ │ │ +9EE52 Compressed Size 000011EB (4587) │ │ │ │ +9EE56 Uncompressed Size 000040F5 (16629) │ │ │ │ +9EE5A Filename Length 0012 (18) │ │ │ │ +9EE5C Extra Length 0018 (24) │ │ │ │ +9EE5E Comment Length 0000 (0) │ │ │ │ +9EE60 Disk Start 0000 (0) │ │ │ │ +9EE62 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EE64 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EE68 Local Header Offset 00061F11 (401169) │ │ │ │ +9EE6C Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EE6C: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EE7E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EE80 Length 0005 (5) │ │ │ │ +9EE82 Flags 01 (1) 'Modification' │ │ │ │ +9EE83 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EE87 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EE89 Length 000B (11) │ │ │ │ +9EE8B Version 01 (1) │ │ │ │ +9EE8C UID Size 04 (4) │ │ │ │ +9EE8D UID 00000000 (0) │ │ │ │ +9EE91 GID Size 04 (4) │ │ │ │ +9EE92 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EE96 CENTRAL HEADER #53 02014B50 (33639248) │ │ │ │ +9EE9A Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EE9B Created OS 03 (3) 'Unix' │ │ │ │ +9EE9C Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EE9D Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EE9E General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EEA0 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EEA2 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EEA6 CRC B74DC8B5 (3075328181) │ │ │ │ +9EEAA Compressed Size 000009DA (2522) │ │ │ │ +9EEAE Uncompressed Size 00003529 (13609) │ │ │ │ +9EEB2 Filename Length 0019 (25) │ │ │ │ +9EEB4 Extra Length 0018 (24) │ │ │ │ +9EEB6 Comment Length 0000 (0) │ │ │ │ +9EEB8 Disk Start 0000 (0) │ │ │ │ +9EEBA Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EEBC Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EEC0 Local Header Offset 00063148 (405832) │ │ │ │ +9EEC4 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EEC4: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EEDD Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EEDF Length 0005 (5) │ │ │ │ +9EEE1 Flags 01 (1) 'Modification' │ │ │ │ +9EEE2 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EEE6 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EEE8 Length 000B (11) │ │ │ │ +9EEEA Version 01 (1) │ │ │ │ +9EEEB UID Size 04 (4) │ │ │ │ +9EEEC UID 00000000 (0) │ │ │ │ +9EEF0 GID Size 04 (4) │ │ │ │ +9EEF1 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EEF5 CENTRAL HEADER #54 02014B50 (33639248) │ │ │ │ +9EEF9 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EEFA Created OS 03 (3) 'Unix' │ │ │ │ +9EEFB Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EEFC Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EEFD General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EEFF Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EF01 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EF05 CRC FADEA3F2 (4208894962) │ │ │ │ +9EF09 Compressed Size 000018B3 (6323) │ │ │ │ +9EF0D Uncompressed Size 0000A605 (42501) │ │ │ │ +9EF11 Filename Length 0019 (25) │ │ │ │ +9EF13 Extra Length 0018 (24) │ │ │ │ +9EF15 Comment Length 0000 (0) │ │ │ │ +9EF17 Disk Start 0000 (0) │ │ │ │ +9EF19 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EF1B Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EF1F Local Header Offset 00063B75 (408437) │ │ │ │ +9EF23 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EF23: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EF3C Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EF3E Length 0005 (5) │ │ │ │ +9EF40 Flags 01 (1) 'Modification' │ │ │ │ +9EF41 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EF45 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EF47 Length 000B (11) │ │ │ │ +9EF49 Version 01 (1) │ │ │ │ +9EF4A UID Size 04 (4) │ │ │ │ +9EF4B UID 00000000 (0) │ │ │ │ +9EF4F GID Size 04 (4) │ │ │ │ +9EF50 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EF54 CENTRAL HEADER #55 02014B50 (33639248) │ │ │ │ +9EF58 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EF59 Created OS 03 (3) 'Unix' │ │ │ │ +9EF5A Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EF5B Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EF5C General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EF5E Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EF60 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EF64 CRC D193B2B7 (3516117687) │ │ │ │ +9EF68 Compressed Size 0000177E (6014) │ │ │ │ +9EF6C Uncompressed Size 0000472C (18220) │ │ │ │ +9EF70 Filename Length 0014 (20) │ │ │ │ +9EF72 Extra Length 0018 (24) │ │ │ │ +9EF74 Comment Length 0000 (0) │ │ │ │ +9EF76 Disk Start 0000 (0) │ │ │ │ +9EF78 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EF7A Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EF7E Local Header Offset 0006547B (414843) │ │ │ │ +9EF82 Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EF82: Filename 'XXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EF96 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EF98 Length 0005 (5) │ │ │ │ +9EF9A Flags 01 (1) 'Modification' │ │ │ │ +9EF9B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9EF9F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9EFA1 Length 000B (11) │ │ │ │ +9EFA3 Version 01 (1) │ │ │ │ +9EFA4 UID Size 04 (4) │ │ │ │ +9EFA5 UID 00000000 (0) │ │ │ │ +9EFA9 GID Size 04 (4) │ │ │ │ +9EFAA GID 00000000 (0) │ │ │ │ + │ │ │ │ +9EFAE CENTRAL HEADER #56 02014B50 (33639248) │ │ │ │ +9EFB2 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9EFB3 Created OS 03 (3) 'Unix' │ │ │ │ +9EFB4 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9EFB5 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9EFB6 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9EFB8 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9EFBA Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9EFBE CRC 85800620 (2239759904) │ │ │ │ +9EFC2 Compressed Size 0000040B (1035) │ │ │ │ +9EFC6 Uncompressed Size 00000825 (2085) │ │ │ │ +9EFCA Filename Length 001C (28) │ │ │ │ +9EFCC Extra Length 0018 (24) │ │ │ │ +9EFCE Comment Length 0000 (0) │ │ │ │ +9EFD0 Disk Start 0000 (0) │ │ │ │ +9EFD2 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9EFD4 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9EFD8 Local Header Offset 00066C47 (420935) │ │ │ │ +9EFDC Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9EFDC: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9EFF8 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9EFFA Length 0005 (5) │ │ │ │ +9EFFC Flags 01 (1) 'Modification' │ │ │ │ +9EFFD Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F001 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F003 Length 000B (11) │ │ │ │ +9F005 Version 01 (1) │ │ │ │ +9F006 UID Size 04 (4) │ │ │ │ +9F007 UID 00000000 (0) │ │ │ │ +9F00B GID Size 04 (4) │ │ │ │ +9F00C GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F010 CENTRAL HEADER #57 02014B50 (33639248) │ │ │ │ +9F014 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F015 Created OS 03 (3) 'Unix' │ │ │ │ +9F016 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F017 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F018 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F01A Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F01C Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F020 CRC FC7A4A6B (4235872875) │ │ │ │ +9F024 Compressed Size 00002482 (9346) │ │ │ │ +9F028 Uncompressed Size 0000B56F (46447) │ │ │ │ +9F02C Filename Length 001F (31) │ │ │ │ +9F02E Extra Length 0018 (24) │ │ │ │ +9F030 Comment Length 0000 (0) │ │ │ │ +9F032 Disk Start 0000 (0) │ │ │ │ +9F034 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F036 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F03A Local Header Offset 000670A8 (422056) │ │ │ │ +9F03E Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F03E: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F05D Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F05F Length 0005 (5) │ │ │ │ +9F061 Flags 01 (1) 'Modification' │ │ │ │ +9F062 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F066 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F068 Length 000B (11) │ │ │ │ +9F06A Version 01 (1) │ │ │ │ +9F06B UID Size 04 (4) │ │ │ │ +9F06C UID 00000000 (0) │ │ │ │ +9F070 GID Size 04 (4) │ │ │ │ +9F071 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F075 CENTRAL HEADER #58 02014B50 (33639248) │ │ │ │ +9F079 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F07A Created OS 03 (3) 'Unix' │ │ │ │ +9F07B Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F07C Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F07D General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F07F Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F081 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F085 CRC 80A4F66C (2158294636) │ │ │ │ +9F089 Compressed Size 00000E7E (3710) │ │ │ │ +9F08D Uncompressed Size 000052D9 (21209) │ │ │ │ +9F091 Filename Length 001F (31) │ │ │ │ +9F093 Extra Length 0018 (24) │ │ │ │ +9F095 Comment Length 0000 (0) │ │ │ │ +9F097 Disk Start 0000 (0) │ │ │ │ +9F099 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F09B Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F09F Local Header Offset 00069583 (431491) │ │ │ │ +9F0A3 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F0A3: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F0C2 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F0C4 Length 0005 (5) │ │ │ │ +9F0C6 Flags 01 (1) 'Modification' │ │ │ │ +9F0C7 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F0CB Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F0CD Length 000B (11) │ │ │ │ +9F0CF Version 01 (1) │ │ │ │ +9F0D0 UID Size 04 (4) │ │ │ │ +9F0D1 UID 00000000 (0) │ │ │ │ +9F0D5 GID Size 04 (4) │ │ │ │ +9F0D6 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F0DA CENTRAL HEADER #59 02014B50 (33639248) │ │ │ │ +9F0DE Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F0DF Created OS 03 (3) 'Unix' │ │ │ │ +9F0E0 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F0E1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F0E2 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F0E4 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F0E6 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F0EA CRC 89B6DCE4 (2310462692) │ │ │ │ +9F0EE Compressed Size 00000A45 (2629) │ │ │ │ +9F0F2 Uncompressed Size 0000247A (9338) │ │ │ │ +9F0F6 Filename Length 0013 (19) │ │ │ │ +9F0F8 Extra Length 0018 (24) │ │ │ │ +9F0FA Comment Length 0000 (0) │ │ │ │ +9F0FC Disk Start 0000 (0) │ │ │ │ +9F0FE Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F100 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F104 Local Header Offset 0006A45A (435290) │ │ │ │ +9F108 Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F108: Filename 'XXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F11B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F11D Length 0005 (5) │ │ │ │ +9F11F Flags 01 (1) 'Modification' │ │ │ │ +9F120 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F124 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F126 Length 000B (11) │ │ │ │ +9F128 Version 01 (1) │ │ │ │ +9F129 UID Size 04 (4) │ │ │ │ +9F12A UID 00000000 (0) │ │ │ │ +9F12E GID Size 04 (4) │ │ │ │ +9F12F GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F133 CENTRAL HEADER #60 02014B50 (33639248) │ │ │ │ +9F137 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F138 Created OS 03 (3) 'Unix' │ │ │ │ +9F139 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F13A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F13B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F13D Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F13F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F143 CRC 88B4664B (2293524043) │ │ │ │ +9F147 Compressed Size 0000248A (9354) │ │ │ │ +9F14B Uncompressed Size 0000B84C (47180) │ │ │ │ +9F14F Filename Length 0019 (25) │ │ │ │ +9F151 Extra Length 0018 (24) │ │ │ │ +9F153 Comment Length 0000 (0) │ │ │ │ +9F155 Disk Start 0000 (0) │ │ │ │ +9F157 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F159 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F15D Local Header Offset 0006AEEC (437996) │ │ │ │ +9F161 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F161: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F17A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F17C Length 0005 (5) │ │ │ │ +9F17E Flags 01 (1) 'Modification' │ │ │ │ +9F17F Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F183 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F185 Length 000B (11) │ │ │ │ +9F187 Version 01 (1) │ │ │ │ +9F188 UID Size 04 (4) │ │ │ │ +9F189 UID 00000000 (0) │ │ │ │ +9F18D GID Size 04 (4) │ │ │ │ +9F18E GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F192 CENTRAL HEADER #61 02014B50 (33639248) │ │ │ │ +9F196 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F197 Created OS 03 (3) 'Unix' │ │ │ │ +9F198 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F199 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F19A General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F19C Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F19E Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F1A2 CRC 75B88221 (1975026209) │ │ │ │ +9F1A6 Compressed Size 00000EF8 (3832) │ │ │ │ +9F1AA Uncompressed Size 00003A2C (14892) │ │ │ │ +9F1AE Filename Length 0024 (36) │ │ │ │ +9F1B0 Extra Length 0018 (24) │ │ │ │ +9F1B2 Comment Length 0000 (0) │ │ │ │ +9F1B4 Disk Start 0000 (0) │ │ │ │ +9F1B6 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F1B8 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F1BC Local Header Offset 0006D3C9 (447433) │ │ │ │ +9F1C0 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F1C0: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F1E4 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F1E6 Length 0005 (5) │ │ │ │ +9F1E8 Flags 01 (1) 'Modification' │ │ │ │ +9F1E9 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F1ED Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F1EF Length 000B (11) │ │ │ │ +9F1F1 Version 01 (1) │ │ │ │ +9F1F2 UID Size 04 (4) │ │ │ │ +9F1F3 UID 00000000 (0) │ │ │ │ +9F1F7 GID Size 04 (4) │ │ │ │ +9F1F8 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F1FC CENTRAL HEADER #62 02014B50 (33639248) │ │ │ │ +9F200 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F201 Created OS 03 (3) 'Unix' │ │ │ │ +9F202 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F203 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F204 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F206 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F208 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F20C CRC 7318E4E5 (1931011301) │ │ │ │ +9F210 Compressed Size 00001AC0 (6848) │ │ │ │ +9F214 Uncompressed Size 00005EDC (24284) │ │ │ │ +9F218 Filename Length 0017 (23) │ │ │ │ +9F21A Extra Length 0018 (24) │ │ │ │ +9F21C Comment Length 0000 (0) │ │ │ │ +9F21E Disk Start 0000 (0) │ │ │ │ +9F220 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F222 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F226 Local Header Offset 0006E31F (451359) │ │ │ │ +9F22A Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F22A: Filename 'XXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F241 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F243 Length 0005 (5) │ │ │ │ +9F245 Flags 01 (1) 'Modification' │ │ │ │ +9F246 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F24A Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F24C Length 000B (11) │ │ │ │ +9F24E Version 01 (1) │ │ │ │ +9F24F UID Size 04 (4) │ │ │ │ +9F250 UID 00000000 (0) │ │ │ │ +9F254 GID Size 04 (4) │ │ │ │ +9F255 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F259 CENTRAL HEADER #63 02014B50 (33639248) │ │ │ │ +9F25D Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F25E Created OS 03 (3) 'Unix' │ │ │ │ +9F25F Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F260 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F261 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F263 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F265 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F269 CRC 11E32AF1 (300100337) │ │ │ │ +9F26D Compressed Size 00000ED3 (3795) │ │ │ │ +9F271 Uncompressed Size 000038E2 (14562) │ │ │ │ +9F275 Filename Length 0023 (35) │ │ │ │ +9F277 Extra Length 0018 (24) │ │ │ │ +9F279 Comment Length 0000 (0) │ │ │ │ +9F27B Disk Start 0000 (0) │ │ │ │ +9F27D Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F27F Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F283 Local Header Offset 0006FE30 (458288) │ │ │ │ +9F287 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F287: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F2AA Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F2AC Length 0005 (5) │ │ │ │ +9F2AE Flags 01 (1) 'Modification' │ │ │ │ +9F2AF Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F2B3 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F2B5 Length 000B (11) │ │ │ │ +9F2B7 Version 01 (1) │ │ │ │ +9F2B8 UID Size 04 (4) │ │ │ │ +9F2B9 UID 00000000 (0) │ │ │ │ +9F2BD GID Size 04 (4) │ │ │ │ +9F2BE GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F2C2 CENTRAL HEADER #64 02014B50 (33639248) │ │ │ │ +9F2C6 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F2C7 Created OS 03 (3) 'Unix' │ │ │ │ +9F2C8 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F2C9 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F2CA General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F2CC Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F2CE Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F2D2 CRC 2DB7929F (767005343) │ │ │ │ +9F2D6 Compressed Size 00000113 (275) │ │ │ │ +9F2DA Uncompressed Size 000001F3 (499) │ │ │ │ +9F2DE Filename Length 001B (27) │ │ │ │ +9F2E0 Extra Length 0018 (24) │ │ │ │ +9F2E2 Comment Length 0000 (0) │ │ │ │ +9F2E4 Disk Start 0000 (0) │ │ │ │ +9F2E6 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F2E8 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F2EC Local Header Offset 00070D60 (462176) │ │ │ │ +9F2F0 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F2F0: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F30B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F30D Length 0005 (5) │ │ │ │ +9F30F Flags 01 (1) 'Modification' │ │ │ │ +9F310 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F314 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F316 Length 000B (11) │ │ │ │ +9F318 Version 01 (1) │ │ │ │ +9F319 UID Size 04 (4) │ │ │ │ +9F31A UID 00000000 (0) │ │ │ │ +9F31E GID Size 04 (4) │ │ │ │ +9F31F GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F323 CENTRAL HEADER #65 02014B50 (33639248) │ │ │ │ +9F327 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F328 Created OS 03 (3) 'Unix' │ │ │ │ +9F329 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F32A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F32B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F32D Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F32F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F333 CRC 75F3F7DB (1978922971) │ │ │ │ +9F337 Compressed Size 0000188E (6286) │ │ │ │ +9F33B Uncompressed Size 00008FAC (36780) │ │ │ │ +9F33F Filename Length 001D (29) │ │ │ │ +9F341 Extra Length 0018 (24) │ │ │ │ +9F343 Comment Length 0000 (0) │ │ │ │ +9F345 Disk Start 0000 (0) │ │ │ │ +9F347 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F349 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F34D Local Header Offset 00070EC8 (462536) │ │ │ │ +9F351 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F351: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F36E Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F370 Length 0005 (5) │ │ │ │ +9F372 Flags 01 (1) 'Modification' │ │ │ │ +9F373 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F377 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F379 Length 000B (11) │ │ │ │ +9F37B Version 01 (1) │ │ │ │ +9F37C UID Size 04 (4) │ │ │ │ +9F37D UID 00000000 (0) │ │ │ │ +9F381 GID Size 04 (4) │ │ │ │ +9F382 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F386 CENTRAL HEADER #66 02014B50 (33639248) │ │ │ │ +9F38A Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F38B Created OS 03 (3) 'Unix' │ │ │ │ +9F38C Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F38D Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F38E General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F390 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F392 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F396 CRC BFC41586 (3217298822) │ │ │ │ +9F39A Compressed Size 0000164D (5709) │ │ │ │ +9F39E Uncompressed Size 00003A9B (15003) │ │ │ │ +9F3A2 Filename Length 0015 (21) │ │ │ │ +9F3A4 Extra Length 0018 (24) │ │ │ │ +9F3A6 Comment Length 0000 (0) │ │ │ │ +9F3A8 Disk Start 0000 (0) │ │ │ │ +9F3AA Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F3AC Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F3B0 Local Header Offset 000727AD (468909) │ │ │ │ +9F3B4 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F3B4: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F3C9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F3CB Length 0005 (5) │ │ │ │ +9F3CD Flags 01 (1) 'Modification' │ │ │ │ +9F3CE Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F3D2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F3D4 Length 000B (11) │ │ │ │ +9F3D6 Version 01 (1) │ │ │ │ +9F3D7 UID Size 04 (4) │ │ │ │ +9F3D8 UID 00000000 (0) │ │ │ │ +9F3DC GID Size 04 (4) │ │ │ │ +9F3DD GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F3E1 CENTRAL HEADER #67 02014B50 (33639248) │ │ │ │ +9F3E5 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F3E6 Created OS 03 (3) 'Unix' │ │ │ │ +9F3E7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F3E8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F3E9 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F3EB Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F3ED Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F3F1 CRC 03068C70 (50760816) │ │ │ │ +9F3F5 Compressed Size 00003B4C (15180) │ │ │ │ +9F3F9 Uncompressed Size 0001185B (71771) │ │ │ │ +9F3FD Filename Length 0016 (22) │ │ │ │ +9F3FF Extra Length 0018 (24) │ │ │ │ +9F401 Comment Length 0000 (0) │ │ │ │ +9F403 Disk Start 0000 (0) │ │ │ │ +9F405 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F407 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F40B Local Header Offset 00073E49 (474697) │ │ │ │ +9F40F Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F40F: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F425 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F427 Length 0005 (5) │ │ │ │ +9F429 Flags 01 (1) 'Modification' │ │ │ │ +9F42A Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F42E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F430 Length 000B (11) │ │ │ │ +9F432 Version 01 (1) │ │ │ │ +9F433 UID Size 04 (4) │ │ │ │ +9F434 UID 00000000 (0) │ │ │ │ +9F438 GID Size 04 (4) │ │ │ │ +9F439 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F43D CENTRAL HEADER #68 02014B50 (33639248) │ │ │ │ +9F441 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F442 Created OS 03 (3) 'Unix' │ │ │ │ +9F443 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F444 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F445 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F447 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F449 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F44D CRC A66FBF68 (2792341352) │ │ │ │ +9F451 Compressed Size 00003E84 (16004) │ │ │ │ +9F455 Uncompressed Size 0001C17B (115067) │ │ │ │ +9F459 Filename Length 0019 (25) │ │ │ │ +9F45B Extra Length 0018 (24) │ │ │ │ +9F45D Comment Length 0000 (0) │ │ │ │ +9F45F Disk Start 0000 (0) │ │ │ │ +9F461 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F463 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F467 Local Header Offset 000779E5 (489957) │ │ │ │ +9F46B Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F46B: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F484 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F486 Length 0005 (5) │ │ │ │ +9F488 Flags 01 (1) 'Modification' │ │ │ │ +9F489 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F48D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F48F Length 000B (11) │ │ │ │ +9F491 Version 01 (1) │ │ │ │ +9F492 UID Size 04 (4) │ │ │ │ +9F493 UID 00000000 (0) │ │ │ │ +9F497 GID Size 04 (4) │ │ │ │ +9F498 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F49C CENTRAL HEADER #69 02014B50 (33639248) │ │ │ │ +9F4A0 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F4A1 Created OS 03 (3) 'Unix' │ │ │ │ +9F4A2 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F4A3 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F4A4 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F4A6 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F4A8 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F4AC CRC F178C158 (4051222872) │ │ │ │ +9F4B0 Compressed Size 0000083B (2107) │ │ │ │ +9F4B4 Uncompressed Size 00003383 (13187) │ │ │ │ +9F4B8 Filename Length 0011 (17) │ │ │ │ +9F4BA Extra Length 0018 (24) │ │ │ │ +9F4BC Comment Length 0000 (0) │ │ │ │ +9F4BE Disk Start 0000 (0) │ │ │ │ +9F4C0 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F4C2 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F4C6 Local Header Offset 0007B8BC (506044) │ │ │ │ +9F4CA Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F4CA: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F4DB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F4DD Length 0005 (5) │ │ │ │ +9F4DF Flags 01 (1) 'Modification' │ │ │ │ +9F4E0 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F4E4 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F4E6 Length 000B (11) │ │ │ │ +9F4E8 Version 01 (1) │ │ │ │ +9F4E9 UID Size 04 (4) │ │ │ │ +9F4EA UID 00000000 (0) │ │ │ │ +9F4EE GID Size 04 (4) │ │ │ │ +9F4EF GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F4F3 CENTRAL HEADER #70 02014B50 (33639248) │ │ │ │ +9F4F7 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F4F8 Created OS 03 (3) 'Unix' │ │ │ │ +9F4F9 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F4FA Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F4FB General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F4FD Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F4FF Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F503 CRC B51C9A39 (3038550585) │ │ │ │ +9F507 Compressed Size 00005186 (20870) │ │ │ │ +9F50B Uncompressed Size 0001FB6C (129900) │ │ │ │ +9F50F Filename Length 0015 (21) │ │ │ │ +9F511 Extra Length 0018 (24) │ │ │ │ +9F513 Comment Length 0000 (0) │ │ │ │ +9F515 Disk Start 0000 (0) │ │ │ │ +9F517 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F519 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F51D Local Header Offset 0007C142 (508226) │ │ │ │ +9F521 Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F521: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F536 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F538 Length 0005 (5) │ │ │ │ +9F53A Flags 01 (1) 'Modification' │ │ │ │ +9F53B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F53F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F541 Length 000B (11) │ │ │ │ +9F543 Version 01 (1) │ │ │ │ +9F544 UID Size 04 (4) │ │ │ │ +9F545 UID 00000000 (0) │ │ │ │ +9F549 GID Size 04 (4) │ │ │ │ +9F54A GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F54E CENTRAL HEADER #71 02014B50 (33639248) │ │ │ │ +9F552 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F553 Created OS 03 (3) 'Unix' │ │ │ │ +9F554 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F555 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F556 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F558 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F55A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F55E CRC F4A29658 (4104296024) │ │ │ │ +9F562 Compressed Size 00001B08 (6920) │ │ │ │ +9F566 Uncompressed Size 000081CF (33231) │ │ │ │ +9F56A Filename Length 0019 (25) │ │ │ │ +9F56C Extra Length 0018 (24) │ │ │ │ +9F56E Comment Length 0000 (0) │ │ │ │ +9F570 Disk Start 0000 (0) │ │ │ │ +9F572 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F574 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F578 Local Header Offset 00081317 (529175) │ │ │ │ +9F57C Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F57C: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F595 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F597 Length 0005 (5) │ │ │ │ +9F599 Flags 01 (1) 'Modification' │ │ │ │ +9F59A Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F59E Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F5A0 Length 000B (11) │ │ │ │ +9F5A2 Version 01 (1) │ │ │ │ +9F5A3 UID Size 04 (4) │ │ │ │ +9F5A4 UID 00000000 (0) │ │ │ │ +9F5A8 GID Size 04 (4) │ │ │ │ +9F5A9 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F5AD CENTRAL HEADER #72 02014B50 (33639248) │ │ │ │ +9F5B1 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F5B2 Created OS 03 (3) 'Unix' │ │ │ │ +9F5B3 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F5B4 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F5B5 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F5B7 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F5B9 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F5BD CRC 30082DE4 (805842404) │ │ │ │ +9F5C1 Compressed Size 00000D96 (3478) │ │ │ │ +9F5C5 Uncompressed Size 00002E9F (11935) │ │ │ │ +9F5C9 Filename Length 0018 (24) │ │ │ │ +9F5CB Extra Length 0018 (24) │ │ │ │ +9F5CD Comment Length 0000 (0) │ │ │ │ +9F5CF Disk Start 0000 (0) │ │ │ │ +9F5D1 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F5D3 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F5D7 Local Header Offset 00082E72 (536178) │ │ │ │ +9F5DB Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F5DB: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F5F3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F5F5 Length 0005 (5) │ │ │ │ +9F5F7 Flags 01 (1) 'Modification' │ │ │ │ +9F5F8 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F5FC Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F5FE Length 000B (11) │ │ │ │ +9F600 Version 01 (1) │ │ │ │ +9F601 UID Size 04 (4) │ │ │ │ +9F602 UID 00000000 (0) │ │ │ │ +9F606 GID Size 04 (4) │ │ │ │ +9F607 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F60B CENTRAL HEADER #73 02014B50 (33639248) │ │ │ │ +9F60F Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F610 Created OS 03 (3) 'Unix' │ │ │ │ +9F611 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F612 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F613 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F615 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F617 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F61B CRC 0252247A (38937722) │ │ │ │ +9F61F Compressed Size 000001E1 (481) │ │ │ │ +9F623 Uncompressed Size 00000323 (803) │ │ │ │ +9F627 Filename Length 0011 (17) │ │ │ │ +9F629 Extra Length 0018 (24) │ │ │ │ +9F62B Comment Length 0000 (0) │ │ │ │ +9F62D Disk Start 0000 (0) │ │ │ │ +9F62F Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F631 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F635 Local Header Offset 00083C5A (539738) │ │ │ │ +9F639 Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F639: Filename 'XXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F64A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F64C Length 0005 (5) │ │ │ │ +9F64E Flags 01 (1) 'Modification' │ │ │ │ +9F64F Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F653 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F655 Length 000B (11) │ │ │ │ +9F657 Version 01 (1) │ │ │ │ +9F658 UID Size 04 (4) │ │ │ │ +9F659 UID 00000000 (0) │ │ │ │ +9F65D GID Size 04 (4) │ │ │ │ +9F65E GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F662 CENTRAL HEADER #74 02014B50 (33639248) │ │ │ │ +9F666 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F667 Created OS 03 (3) 'Unix' │ │ │ │ +9F668 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F669 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F66A General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F66C Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F66E Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F672 CRC 05901E89 (93331081) │ │ │ │ +9F676 Compressed Size 000006C2 (1730) │ │ │ │ +9F67A Uncompressed Size 00001439 (5177) │ │ │ │ +9F67E Filename Length 0019 (25) │ │ │ │ +9F680 Extra Length 0018 (24) │ │ │ │ +9F682 Comment Length 0000 (0) │ │ │ │ +9F684 Disk Start 0000 (0) │ │ │ │ +9F686 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F688 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F68C Local Header Offset 00083E86 (540294) │ │ │ │ +9F690 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F690: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F6A9 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F6AB Length 0005 (5) │ │ │ │ +9F6AD Flags 01 (1) 'Modification' │ │ │ │ +9F6AE Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F6B2 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F6B4 Length 000B (11) │ │ │ │ +9F6B6 Version 01 (1) │ │ │ │ +9F6B7 UID Size 04 (4) │ │ │ │ +9F6B8 UID 00000000 (0) │ │ │ │ +9F6BC GID Size 04 (4) │ │ │ │ +9F6BD GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F6C1 CENTRAL HEADER #75 02014B50 (33639248) │ │ │ │ +9F6C5 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F6C6 Created OS 03 (3) 'Unix' │ │ │ │ +9F6C7 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F6C8 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F6C9 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F6CB Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F6CD Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F6D1 CRC 473A93FE (1195021310) │ │ │ │ +9F6D5 Compressed Size 00001B8B (7051) │ │ │ │ +9F6D9 Uncompressed Size 00009F03 (40707) │ │ │ │ +9F6DD Filename Length 0018 (24) │ │ │ │ +9F6DF Extra Length 0018 (24) │ │ │ │ +9F6E1 Comment Length 0000 (0) │ │ │ │ +9F6E3 Disk Start 0000 (0) │ │ │ │ +9F6E5 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F6E7 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F6EB Local Header Offset 0008459B (542107) │ │ │ │ +9F6EF Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F6EF: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F707 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F709 Length 0005 (5) │ │ │ │ +9F70B Flags 01 (1) 'Modification' │ │ │ │ +9F70C Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F710 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F712 Length 000B (11) │ │ │ │ +9F714 Version 01 (1) │ │ │ │ +9F715 UID Size 04 (4) │ │ │ │ +9F716 UID 00000000 (0) │ │ │ │ +9F71A GID Size 04 (4) │ │ │ │ +9F71B GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F71F CENTRAL HEADER #76 02014B50 (33639248) │ │ │ │ +9F723 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F724 Created OS 03 (3) 'Unix' │ │ │ │ +9F725 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F726 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F727 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F729 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F72B Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F72F CRC EC5C68E2 (3965479138) │ │ │ │ +9F733 Compressed Size 000016FD (5885) │ │ │ │ +9F737 Uncompressed Size 00008AB6 (35510) │ │ │ │ +9F73B Filename Length 0012 (18) │ │ │ │ +9F73D Extra Length 0018 (24) │ │ │ │ +9F73F Comment Length 0000 (0) │ │ │ │ +9F741 Disk Start 0000 (0) │ │ │ │ +9F743 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F745 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F749 Local Header Offset 00086178 (549240) │ │ │ │ +9F74D Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F74D: Filename 'XXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F75F Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F761 Length 0005 (5) │ │ │ │ +9F763 Flags 01 (1) 'Modification' │ │ │ │ +9F764 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F768 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F76A Length 000B (11) │ │ │ │ +9F76C Version 01 (1) │ │ │ │ +9F76D UID Size 04 (4) │ │ │ │ +9F76E UID 00000000 (0) │ │ │ │ +9F772 GID Size 04 (4) │ │ │ │ +9F773 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F777 CENTRAL HEADER #77 02014B50 (33639248) │ │ │ │ +9F77B Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F77C Created OS 03 (3) 'Unix' │ │ │ │ +9F77D Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F77E Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F77F General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F781 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F783 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F787 CRC BCE56D7C (3169152380) │ │ │ │ +9F78B Compressed Size 00001E11 (7697) │ │ │ │ +9F78F Uncompressed Size 00008803 (34819) │ │ │ │ +9F793 Filename Length 0016 (22) │ │ │ │ +9F795 Extra Length 0018 (24) │ │ │ │ +9F797 Comment Length 0000 (0) │ │ │ │ +9F799 Disk Start 0000 (0) │ │ │ │ +9F79B Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F79D Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F7A1 Local Header Offset 000878C1 (555201) │ │ │ │ +9F7A5 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F7A5: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F7BB Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F7BD Length 0005 (5) │ │ │ │ +9F7BF Flags 01 (1) 'Modification' │ │ │ │ +9F7C0 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F7C4 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F7C6 Length 000B (11) │ │ │ │ +9F7C8 Version 01 (1) │ │ │ │ +9F7C9 UID Size 04 (4) │ │ │ │ +9F7CA UID 00000000 (0) │ │ │ │ +9F7CE GID Size 04 (4) │ │ │ │ +9F7CF GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F7D3 CENTRAL HEADER #78 02014B50 (33639248) │ │ │ │ +9F7D7 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F7D8 Created OS 03 (3) 'Unix' │ │ │ │ +9F7D9 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F7DA Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F7DB General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F7DD Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F7DF Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F7E3 CRC 20D8554A (551048522) │ │ │ │ +9F7E7 Compressed Size 000029A6 (10662) │ │ │ │ +9F7EB Uncompressed Size 0000D04F (53327) │ │ │ │ +9F7EF Filename Length 001A (26) │ │ │ │ +9F7F1 Extra Length 0018 (24) │ │ │ │ +9F7F3 Comment Length 0000 (0) │ │ │ │ +9F7F5 Disk Start 0000 (0) │ │ │ │ +9F7F7 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F7F9 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F7FD Local Header Offset 00089722 (562978) │ │ │ │ +9F801 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F801: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F81B Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F81D Length 0005 (5) │ │ │ │ +9F81F Flags 01 (1) 'Modification' │ │ │ │ +9F820 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F824 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F826 Length 000B (11) │ │ │ │ +9F828 Version 01 (1) │ │ │ │ +9F829 UID Size 04 (4) │ │ │ │ +9F82A UID 00000000 (0) │ │ │ │ +9F82E GID Size 04 (4) │ │ │ │ +9F82F GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F833 CENTRAL HEADER #79 02014B50 (33639248) │ │ │ │ +9F837 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F838 Created OS 03 (3) 'Unix' │ │ │ │ +9F839 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F83A Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F83B General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F83D Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F83F Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F843 CRC 75E3F6F2 (1977874162) │ │ │ │ +9F847 Compressed Size 000009AC (2476) │ │ │ │ +9F84B Uncompressed Size 00001DB6 (7606) │ │ │ │ +9F84F Filename Length 0018 (24) │ │ │ │ +9F851 Extra Length 0018 (24) │ │ │ │ +9F853 Comment Length 0000 (0) │ │ │ │ +9F855 Disk Start 0000 (0) │ │ │ │ +9F857 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F859 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F85D Local Header Offset 0008C11C (573724) │ │ │ │ +9F861 Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F861: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F879 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F87B Length 0005 (5) │ │ │ │ +9F87D Flags 01 (1) 'Modification' │ │ │ │ +9F87E Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F882 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F884 Length 000B (11) │ │ │ │ +9F886 Version 01 (1) │ │ │ │ +9F887 UID Size 04 (4) │ │ │ │ +9F888 UID 00000000 (0) │ │ │ │ +9F88C GID Size 04 (4) │ │ │ │ +9F88D GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F891 CENTRAL HEADER #80 02014B50 (33639248) │ │ │ │ +9F895 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F896 Created OS 03 (3) 'Unix' │ │ │ │ +9F897 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F898 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F899 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F89B Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F89D Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F8A1 CRC F5E2129F (4125233823) │ │ │ │ +9F8A5 Compressed Size 000016BC (5820) │ │ │ │ +9F8A9 Uncompressed Size 000016CD (5837) │ │ │ │ +9F8AD Filename Length 0015 (21) │ │ │ │ +9F8AF Extra Length 0018 (24) │ │ │ │ +9F8B1 Comment Length 0000 (0) │ │ │ │ +9F8B3 Disk Start 0000 (0) │ │ │ │ +9F8B5 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F8B7 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F8BB Local Header Offset 0008CB1A (576282) │ │ │ │ +9F8BF Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F8BF: Filename 'XXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F8D4 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F8D6 Length 0005 (5) │ │ │ │ +9F8D8 Flags 01 (1) 'Modification' │ │ │ │ +9F8D9 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F8DD Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F8DF Length 000B (11) │ │ │ │ +9F8E1 Version 01 (1) │ │ │ │ +9F8E2 UID Size 04 (4) │ │ │ │ +9F8E3 UID 00000000 (0) │ │ │ │ +9F8E7 GID Size 04 (4) │ │ │ │ +9F8E8 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F8EC CENTRAL HEADER #81 02014B50 (33639248) │ │ │ │ +9F8F0 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F8F1 Created OS 03 (3) 'Unix' │ │ │ │ +9F8F2 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9F8F3 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F8F4 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9F8F6 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9F8F8 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F8FC CRC F5E2129F (4125233823) │ │ │ │ +9F900 Compressed Size 000016BC (5820) │ │ │ │ +9F904 Uncompressed Size 000016CD (5837) │ │ │ │ +9F908 Filename Length 001C (28) │ │ │ │ +9F90A Extra Length 0018 (24) │ │ │ │ +9F90C Comment Length 0000 (0) │ │ │ │ +9F90E Disk Start 0000 (0) │ │ │ │ +9F910 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F912 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F916 Local Header Offset 0008E225 (582181) │ │ │ │ +9F91A Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F91A: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F936 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F938 Length 0005 (5) │ │ │ │ +9F93A Flags 01 (1) 'Modification' │ │ │ │ +9F93B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F93F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F941 Length 000B (11) │ │ │ │ +9F943 Version 01 (1) │ │ │ │ +9F944 UID Size 04 (4) │ │ │ │ +9F945 UID 00000000 (0) │ │ │ │ +9F949 GID Size 04 (4) │ │ │ │ +9F94A GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F94E CENTRAL HEADER #82 02014B50 (33639248) │ │ │ │ +9F952 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F953 Created OS 03 (3) 'Unix' │ │ │ │ +9F954 Extract Zip Spec 0A (10) '1.0' │ │ │ │ +9F955 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F956 General Purpose Flag 0000 (0) │ │ │ │ +9F958 Compression Method 0000 (0) 'Stored' │ │ │ │ +9F95A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F95E CRC FC95F24B (4237685323) │ │ │ │ +9F962 Compressed Size 00001B84 (7044) │ │ │ │ +9F966 Uncompressed Size 00001B84 (7044) │ │ │ │ +9F96A Filename Length 0016 (22) │ │ │ │ +9F96C Extra Length 0018 (24) │ │ │ │ +9F96E Comment Length 0000 (0) │ │ │ │ +9F970 Disk Start 0000 (0) │ │ │ │ +9F972 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F974 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F978 Local Header Offset 0008F937 (588087) │ │ │ │ +9F97C Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F97C: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F992 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F994 Length 0005 (5) │ │ │ │ +9F996 Flags 01 (1) 'Modification' │ │ │ │ +9F997 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F99B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F99D Length 000B (11) │ │ │ │ +9F99F Version 01 (1) │ │ │ │ +9F9A0 UID Size 04 (4) │ │ │ │ +9F9A1 UID 00000000 (0) │ │ │ │ +9F9A5 GID Size 04 (4) │ │ │ │ +9F9A6 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9F9AA CENTRAL HEADER #83 02014B50 (33639248) │ │ │ │ +9F9AE Created Zip Spec 3D (61) '6.1' │ │ │ │ +9F9AF Created OS 03 (3) 'Unix' │ │ │ │ +9F9B0 Extract Zip Spec 0A (10) '1.0' │ │ │ │ +9F9B1 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9F9B2 General Purpose Flag 0000 (0) │ │ │ │ +9F9B4 Compression Method 0000 (0) 'Stored' │ │ │ │ +9F9B6 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9F9BA CRC D0D71F86 (3503759238) │ │ │ │ +9F9BE Compressed Size 00000B7B (2939) │ │ │ │ +9F9C2 Uncompressed Size 00000B7B (2939) │ │ │ │ +9F9C6 Filename Length 0016 (22) │ │ │ │ +9F9C8 Extra Length 0018 (24) │ │ │ │ +9F9CA Comment Length 0000 (0) │ │ │ │ +9F9CC Disk Start 0000 (0) │ │ │ │ +9F9CE Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9F9D0 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9F9D4 Local Header Offset 0009150B (595211) │ │ │ │ +9F9D8 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9F9D8: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9F9EE Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9F9F0 Length 0005 (5) │ │ │ │ +9F9F2 Flags 01 (1) 'Modification' │ │ │ │ +9F9F3 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9F9F7 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9F9F9 Length 000B (11) │ │ │ │ +9F9FB Version 01 (1) │ │ │ │ +9F9FC UID Size 04 (4) │ │ │ │ +9F9FD UID 00000000 (0) │ │ │ │ +9FA01 GID Size 04 (4) │ │ │ │ +9FA02 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FA06 CENTRAL HEADER #84 02014B50 (33639248) │ │ │ │ +9FA0A Created Zip Spec 3D (61) '6.1' │ │ │ │ +9FA0B Created OS 03 (3) 'Unix' │ │ │ │ +9FA0C Extract Zip Spec 0A (10) '1.0' │ │ │ │ +9FA0D Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9FA0E General Purpose Flag 0000 (0) │ │ │ │ +9FA10 Compression Method 0000 (0) 'Stored' │ │ │ │ +9FA12 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9FA16 CRC FFF9C4D2 (4294558930) │ │ │ │ +9FA1A Compressed Size 0000138F (5007) │ │ │ │ +9FA1E Uncompressed Size 0000138F (5007) │ │ │ │ +9FA22 Filename Length 0016 (22) │ │ │ │ +9FA24 Extra Length 0018 (24) │ │ │ │ +9FA26 Comment Length 0000 (0) │ │ │ │ +9FA28 Disk Start 0000 (0) │ │ │ │ +9FA2A Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9FA2C Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9FA30 Local Header Offset 000920D6 (598230) │ │ │ │ +9FA34 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9FA34: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9FA4A Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9FA4C Length 0005 (5) │ │ │ │ +9FA4E Flags 01 (1) 'Modification' │ │ │ │ +9FA4F Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9FA53 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9FA55 Length 000B (11) │ │ │ │ +9FA57 Version 01 (1) │ │ │ │ +9FA58 UID Size 04 (4) │ │ │ │ +9FA59 UID 00000000 (0) │ │ │ │ +9FA5D GID Size 04 (4) │ │ │ │ +9FA5E GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FA62 CENTRAL HEADER #85 02014B50 (33639248) │ │ │ │ +9FA66 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9FA67 Created OS 03 (3) 'Unix' │ │ │ │ +9FA68 Extract Zip Spec 0A (10) '1.0' │ │ │ │ +9FA69 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9FA6A General Purpose Flag 0000 (0) │ │ │ │ +9FA6C Compression Method 0000 (0) 'Stored' │ │ │ │ +9FA6E Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9FA72 CRC A1037E8E (2701360782) │ │ │ │ +9FA76 Compressed Size 0000145E (5214) │ │ │ │ +9FA7A Uncompressed Size 0000145E (5214) │ │ │ │ +9FA7E Filename Length 0016 (22) │ │ │ │ +9FA80 Extra Length 0018 (24) │ │ │ │ +9FA82 Comment Length 0000 (0) │ │ │ │ +9FA84 Disk Start 0000 (0) │ │ │ │ +9FA86 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9FA88 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9FA8C Local Header Offset 000934B5 (603317) │ │ │ │ +9FA90 Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9FA90: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9FAA6 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9FAA8 Length 0005 (5) │ │ │ │ +9FAAA Flags 01 (1) 'Modification' │ │ │ │ +9FAAB Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9FAAF Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9FAB1 Length 000B (11) │ │ │ │ +9FAB3 Version 01 (1) │ │ │ │ +9FAB4 UID Size 04 (4) │ │ │ │ +9FAB5 UID 00000000 (0) │ │ │ │ +9FAB9 GID Size 04 (4) │ │ │ │ +9FABA GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FABE CENTRAL HEADER #86 02014B50 (33639248) │ │ │ │ +9FAC2 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9FAC3 Created OS 03 (3) 'Unix' │ │ │ │ +9FAC4 Extract Zip Spec 0A (10) '1.0' │ │ │ │ +9FAC5 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9FAC6 General Purpose Flag 0000 (0) │ │ │ │ +9FAC8 Compression Method 0000 (0) 'Stored' │ │ │ │ +9FACA Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9FACE CRC 5E9E64F1 (1587438833) │ │ │ │ +9FAD2 Compressed Size 000008EC (2284) │ │ │ │ +9FAD6 Uncompressed Size 000008EC (2284) │ │ │ │ +9FADA Filename Length 0016 (22) │ │ │ │ +9FADC Extra Length 0018 (24) │ │ │ │ +9FADE Comment Length 0000 (0) │ │ │ │ +9FAE0 Disk Start 0000 (0) │ │ │ │ +9FAE2 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9FAE4 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9FAE8 Local Header Offset 00094963 (608611) │ │ │ │ +9FAEC Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9FAEC: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9FB02 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9FB04 Length 0005 (5) │ │ │ │ +9FB06 Flags 01 (1) 'Modification' │ │ │ │ +9FB07 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9FB0B Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9FB0D Length 000B (11) │ │ │ │ +9FB0F Version 01 (1) │ │ │ │ +9FB10 UID Size 04 (4) │ │ │ │ +9FB11 UID 00000000 (0) │ │ │ │ +9FB15 GID Size 04 (4) │ │ │ │ +9FB16 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FB1A CENTRAL HEADER #87 02014B50 (33639248) │ │ │ │ +9FB1E Created Zip Spec 3D (61) '6.1' │ │ │ │ +9FB1F Created OS 03 (3) 'Unix' │ │ │ │ +9FB20 Extract Zip Spec 0A (10) '1.0' │ │ │ │ +9FB21 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9FB22 General Purpose Flag 0000 (0) │ │ │ │ +9FB24 Compression Method 0000 (0) 'Stored' │ │ │ │ +9FB26 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9FB2A CRC 42E340AB (1122189483) │ │ │ │ +9FB2E Compressed Size 00001F2E (7982) │ │ │ │ +9FB32 Uncompressed Size 00001F2E (7982) │ │ │ │ +9FB36 Filename Length 001E (30) │ │ │ │ +9FB38 Extra Length 0018 (24) │ │ │ │ +9FB3A Comment Length 0000 (0) │ │ │ │ +9FB3C Disk Start 0000 (0) │ │ │ │ +9FB3E Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9FB40 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9FB44 Local Header Offset 0009529F (610975) │ │ │ │ +9FB48 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9FB48: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9FB66 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9FB68 Length 0005 (5) │ │ │ │ +9FB6A Flags 01 (1) 'Modification' │ │ │ │ +9FB6B Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9FB6F Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9FB71 Length 000B (11) │ │ │ │ +9FB73 Version 01 (1) │ │ │ │ +9FB74 UID Size 04 (4) │ │ │ │ +9FB75 UID 00000000 (0) │ │ │ │ +9FB79 GID Size 04 (4) │ │ │ │ +9FB7A GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FB7E CENTRAL HEADER #88 02014B50 (33639248) │ │ │ │ +9FB82 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9FB83 Created OS 03 (3) 'Unix' │ │ │ │ +9FB84 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9FB85 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9FB86 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9FB88 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9FB8A Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9FB8E CRC 2EA06FB0 (782266288) │ │ │ │ +9FB92 Compressed Size 00003D6E (15726) │ │ │ │ +9FB96 Uncompressed Size 00016649 (91721) │ │ │ │ +9FB9A Filename Length 001A (26) │ │ │ │ +9FB9C Extra Length 0018 (24) │ │ │ │ +9FB9E Comment Length 0000 (0) │ │ │ │ +9FBA0 Disk Start 0000 (0) │ │ │ │ +9FBA2 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9FBA4 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9FBA8 Local Header Offset 00097225 (619045) │ │ │ │ +9FBAC Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9FBAC: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9FBC6 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9FBC8 Length 0005 (5) │ │ │ │ +9FBCA Flags 01 (1) 'Modification' │ │ │ │ +9FBCB Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9FBCF Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9FBD1 Length 000B (11) │ │ │ │ +9FBD3 Version 01 (1) │ │ │ │ +9FBD4 UID Size 04 (4) │ │ │ │ +9FBD5 UID 00000000 (0) │ │ │ │ +9FBD9 GID Size 04 (4) │ │ │ │ +9FBDA GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FBDE CENTRAL HEADER #89 02014B50 (33639248) │ │ │ │ +9FBE2 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9FBE3 Created OS 03 (3) 'Unix' │ │ │ │ +9FBE4 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9FBE5 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9FBE6 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9FBE8 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9FBEA Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9FBEE CRC D1B91C98 (3518569624) │ │ │ │ +9FBF2 Compressed Size 000029C1 (10689) │ │ │ │ +9FBF6 Uncompressed Size 0000BA6A (47722) │ │ │ │ +9FBFA Filename Length 0018 (24) │ │ │ │ +9FBFC Extra Length 0018 (24) │ │ │ │ +9FBFE Comment Length 0000 (0) │ │ │ │ +9FC00 Disk Start 0000 (0) │ │ │ │ +9FC02 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9FC04 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9FC08 Local Header Offset 0009AFE7 (634855) │ │ │ │ +9FC0C Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9FC0C: Filename 'XXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9FC24 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9FC26 Length 0005 (5) │ │ │ │ +9FC28 Flags 01 (1) 'Modification' │ │ │ │ +9FC29 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9FC2D Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9FC2F Length 000B (11) │ │ │ │ +9FC31 Version 01 (1) │ │ │ │ +9FC32 UID Size 04 (4) │ │ │ │ +9FC33 UID 00000000 (0) │ │ │ │ +9FC37 GID Size 04 (4) │ │ │ │ +9FC38 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FC3C CENTRAL HEADER #90 02014B50 (33639248) │ │ │ │ +9FC40 Created Zip Spec 3D (61) '6.1' │ │ │ │ +9FC41 Created OS 03 (3) 'Unix' │ │ │ │ +9FC42 Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9FC43 Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9FC44 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9FC46 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9FC48 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9FC4C CRC DCB3B516 (3702764822) │ │ │ │ +9FC50 Compressed Size 000000AE (174) │ │ │ │ +9FC54 Uncompressed Size 000000FC (252) │ │ │ │ +9FC58 Filename Length 0016 (22) │ │ │ │ +9FC5A Extra Length 0018 (24) │ │ │ │ +9FC5C Comment Length 0000 (0) │ │ │ │ +9FC5E Disk Start 0000 (0) │ │ │ │ +9FC60 Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9FC62 Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9FC66 Local Header Offset 0009D9FA (645626) │ │ │ │ +9FC6A Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9FC6A: Filename 'XXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9FC80 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9FC82 Length 0005 (5) │ │ │ │ +9FC84 Flags 01 (1) 'Modification' │ │ │ │ +9FC85 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9FC89 Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9FC8B Length 000B (11) │ │ │ │ +9FC8D Version 01 (1) │ │ │ │ +9FC8E UID Size 04 (4) │ │ │ │ +9FC8F UID 00000000 (0) │ │ │ │ +9FC93 GID Size 04 (4) │ │ │ │ +9FC94 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FC98 CENTRAL HEADER #91 02014B50 (33639248) │ │ │ │ +9FC9C Created Zip Spec 3D (61) '6.1' │ │ │ │ +9FC9D Created OS 03 (3) 'Unix' │ │ │ │ +9FC9E Extract Zip Spec 14 (20) '2.0' │ │ │ │ +9FC9F Extract OS 00 (0) 'MS-DOS' │ │ │ │ +9FCA0 General Purpose Flag 0000 (0) │ │ │ │ + [Bits 1-2] 0 'Normal Compression' │ │ │ │ +9FCA2 Compression Method 0008 (8) 'Deflated' │ │ │ │ +9FCA4 Modification Time 5B925657 (1536317015) 'Thu Dec 18 10:50:46 2025' │ │ │ │ +9FCA8 CRC 58439733 (1480824627) │ │ │ │ +9FCAC Compressed Size 00000077 (119) │ │ │ │ +9FCB0 Uncompressed Size 000000A2 (162) │ │ │ │ +9FCB4 Filename Length 002D (45) │ │ │ │ +9FCB6 Extra Length 0018 (24) │ │ │ │ +9FCB8 Comment Length 0000 (0) │ │ │ │ +9FCBA Disk Start 0000 (0) │ │ │ │ +9FCBC Int File Attributes 0000 (0) │ │ │ │ + [Bit 0] 0 'Binary Data' │ │ │ │ +9FCBE Ext File Attributes 01A40000 (27525120) │ │ │ │ + [Bits 16-24] 01A4 (420) 'Unix attrib: rw-r--r--' │ │ │ │ +9FCC2 Local Header Offset 0009DAF8 (645880) │ │ │ │ +9FCC6 Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# │ │ │ │ +# WARNING: Offset 0x9FCC6: Filename 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' │ │ │ │ +# Zero length filename │ │ │ │ +# │ │ │ │ +9FCF3 Extra ID #1 5455 (21589) 'Extended Timestamp [UT]' │ │ │ │ +9FCF5 Length 0005 (5) │ │ │ │ +9FCF7 Flags 01 (1) 'Modification' │ │ │ │ +9FCF8 Modification Time 6943DC87 (1766055047) 'Thu Dec 18 10:50:47 2025' │ │ │ │ +9FCFC Extra ID #2 7875 (30837) 'Unix Extra type 3 [ux]' │ │ │ │ +9FCFE Length 000B (11) │ │ │ │ +9FD00 Version 01 (1) │ │ │ │ +9FD01 UID Size 04 (4) │ │ │ │ +9FD02 UID 00000000 (0) │ │ │ │ +9FD06 GID Size 04 (4) │ │ │ │ +9FD07 GID 00000000 (0) │ │ │ │ + │ │ │ │ +9FD0B END CENTRAL HEADER 06054B50 (101010256) │ │ │ │ +9FD0F Number of this disk 0000 (0) │ │ │ │ +9FD11 Central Dir Disk no 0000 (0) │ │ │ │ +9FD13 Entries in this disk 005B (91) │ │ │ │ +9FD15 Total Entries 005B (91) │ │ │ │ +9FD17 Size of Central Dir 00002135 (8501) │ │ │ │ +9FD1B Offset to Central Dir 0009DBD6 (646102) │ │ │ │ +9FD1F Comment Length 0000 (0) │ │ │ │ # │ │ │ │ # Warning Count: 182 │ │ │ │ # │ │ │ │ # Done │ │ │ ├── filetype from file(1) │ │ │ │ @@ -1 +1 @@ │ │ │ │ -Zip archive data, made by v6.1 UNIX, extract using at least v1.0, last modified Nov 27 2025 13:07:24, uncompressed size 20, method=store │ │ │ │ +Zip archive data, made by v6.1 UNIX, extract using at least v1.0, last modified Dec 18 2025 10:50:46, uncompressed size 20, method=store │ │ │ ├── OEBPS/typespec.xhtml │ │ │ │ @@ -143,122 +143,122 @@ │ │ │ │ and optional (=>) association types. If an association type is mandatory, an │ │ │ │ association with that type needs to be present. In the case of an optional │ │ │ │ association type it is not required for the key type to be present.

The notation #{} specifies the singleton type for the empty map. Note that │ │ │ │ this notation is not a shorthand for the map/0 type.

For convenience, the following types are also built-in. They can be thought as │ │ │ │ predefined aliases for the type unions also shown in the table.

Built-in typeDefined as
term/0any/0
binary/0<<_:_*8>>
nonempty_binary/0<<_:8, _:_*8>>
bitstring/0<<_:_*1>>
nonempty_bitstring/0<<_:1, _:_*1>>
boolean/0'false' | 'true'
byte/00..255
char/00..16#10ffff
nil/0[]
number/0integer/0 | float/0
list/0[any()]
maybe_improper_list/0maybe_improper_list(any(), any())
nonempty_list/0nonempty_list(any())
string/0[char()]
nonempty_string/0[char(),...]
iodata/0iolist() | binary()
iolist/0maybe_improper_list(byte() | binary() | iolist(), binary() | [])
map/0#{any() => any()}
function/0fun()
module/0atom/0
mfa/0{module(),atom(),arity()}
arity/00..255
identifier/0pid() | port() | reference()
node/0atom/0
timeout/0'infinity' | non_neg_integer()
no_return/0none/0

Table: Built-in types, predefined aliases

In addition, the following three built-in types exist and can be thought as │ │ │ │ defined below, though strictly their "type definition" is not valid syntax │ │ │ │ according to the type language defined above.

Built-in typeCan be thought defined by the syntax
non_neg_integer/00..
pos_integer/01..
neg_integer/0..-1

Table: Additional built-in types

Note

The following built-in list types also exist, but they are expected to be │ │ │ │ -rarely used. Hence, they have long names:

nonempty_maybe_improper_list() :: nonempty_maybe_improper_list(any(), any())
│ │ │ │ -nonempty_improper_list(Type1, Type2)
│ │ │ │ -nonempty_maybe_improper_list(Type1, Type2)

where the last two types define the set of Erlang terms one would expect.

Also for convenience, record notation is allowed to be used. Records are │ │ │ │ -shorthands for the corresponding tuples:

Record :: #Erlang_Atom{}
│ │ │ │ -        | #Erlang_Atom{Fields}

Records are extended to possibly contain type information. This is described in │ │ │ │ +rarely used. Hence, they have long names:

nonempty_maybe_improper_list() :: nonempty_maybe_improper_list(any(), any())
│ │ │ │ +nonempty_improper_list(Type1, Type2)
│ │ │ │ +nonempty_maybe_improper_list(Type1, Type2)

where the last two types define the set of Erlang terms one would expect.

Also for convenience, record notation is allowed to be used. Records are │ │ │ │ +shorthands for the corresponding tuples:

Record :: #Erlang_Atom{}
│ │ │ │ +        | #Erlang_Atom{Fields}

Records are extended to possibly contain type information. This is described in │ │ │ │ Type Information in Record Declarations.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Redefining built-in types │ │ │ │

│ │ │ │

Change

Starting from Erlang/OTP 26, it is permitted to define a type having the same │ │ │ │ name as a built-in type.

It is recommended to avoid deliberately reusing built-in names because it can be │ │ │ │ confusing. However, when an Erlang/OTP release introduces a new type, code that │ │ │ │ happened to define its own type having the same name will continue to work.

As an example, imagine that the Erlang/OTP 42 release introduces a new type │ │ │ │ -gadget() defined like this:

-type gadget() :: {'gadget', reference()}.

Further imagine that some code has its own (different) definition of gadget(), │ │ │ │ -for example:

-type gadget() :: #{}.

Since redefinitions are allowed, the code will still compile (but with a │ │ │ │ +gadget() defined like this:

-type gadget() :: {'gadget', reference()}.

Further imagine that some code has its own (different) definition of gadget(), │ │ │ │ +for example:

-type gadget() :: #{}.

Since redefinitions are allowed, the code will still compile (but with a │ │ │ │ warning), and Dialyzer will not emit any additional warnings.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Type Declarations of User-Defined Types │ │ │ │

│ │ │ │

As seen, the basic syntax of a type is an atom followed by closed parentheses. │ │ │ │ New types are declared using -type and -opaque attributes as in the │ │ │ │ -following:

-type my_struct_type() :: Type.
│ │ │ │ --opaque my_opaq_type() :: Type.

The type name is the atom my_struct_type, followed by parentheses. Type is a │ │ │ │ +following:

-type my_struct_type() :: Type.
│ │ │ │ +-opaque my_opaq_type() :: Type.

The type name is the atom my_struct_type, followed by parentheses. Type is a │ │ │ │ type as defined in the previous section. A current restriction is that Type │ │ │ │ can contain only predefined types, or user-defined types which are either of the │ │ │ │ following:

For module-local types, the restriction that their definition exists in the │ │ │ │ module is enforced by the compiler and results in a compilation error. (A │ │ │ │ similar restriction currently exists for records.)

Type declarations can also be parameterized by including type variables between │ │ │ │ the parentheses. The syntax of type variables is the same as Erlang variables, │ │ │ │ that is, starts with an upper-case letter. These variables is to │ │ │ │ -appear on the RHS of the definition. A concrete example follows:

-type orddict(Key, Val) :: [{Key, Val}].

A module can export some types to declare that other modules are allowed to │ │ │ │ -refer to them as remote types. This declaration has the following form:

-export_type([T1/A1, ..., Tk/Ak]).

Here the Tis are atoms (the name of the type) and the Ais are their arguments.

Example:

-export_type([my_struct_type/0, orddict/2]).

Assuming that these types are exported from module 'mod', you can refer to │ │ │ │ -them from other modules using remote type expressions like the following:

mod:my_struct_type()
│ │ │ │ -mod:orddict(atom(), term())

It is not allowed to refer to types that are not declared as exported.

Types declared as opaque represent sets of terms whose structure is not │ │ │ │ +appear on the RHS of the definition. A concrete example follows:

-type orddict(Key, Val) :: [{Key, Val}].

A module can export some types to declare that other modules are allowed to │ │ │ │ +refer to them as remote types. This declaration has the following form:

-export_type([T1/A1, ..., Tk/Ak]).

Here the Tis are atoms (the name of the type) and the Ais are their arguments.

Example:

-export_type([my_struct_type/0, orddict/2]).

Assuming that these types are exported from module 'mod', you can refer to │ │ │ │ +them from other modules using remote type expressions like the following:

mod:my_struct_type()
│ │ │ │ +mod:orddict(atom(), term())

It is not allowed to refer to types that are not declared as exported.

Types declared as opaque represent sets of terms whose structure is not │ │ │ │ supposed to be visible from outside of their defining module. That is, only the │ │ │ │ module defining them is allowed to depend on their term structure. Consequently, │ │ │ │ such types do not make much sense as module local - module local types are not │ │ │ │ accessible by other modules anyway - and is always to be exported.

Read more on Opaques

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Type Information in Record Declarations │ │ │ │

│ │ │ │

The types of record fields can be specified in the declaration of the record. │ │ │ │ -The syntax for this is as follows:

-record(rec, {field1 :: Type1, field2, field3 :: Type3}).

For fields without type annotations, their type defaults to any(). That is, the │ │ │ │ -previous example is a shorthand for the following:

-record(rec, {field1 :: Type1, field2 :: any(), field3 :: Type3}).

In the presence of initial values for fields, the type must be declared after │ │ │ │ -the initialization, as follows:

-record(rec, {field1 = [] :: Type1, field2, field3 = 42 :: Type3}).

The initial values for fields are to be compatible with (that is, a member of) │ │ │ │ +The syntax for this is as follows:

-record(rec, {field1 :: Type1, field2, field3 :: Type3}).

For fields without type annotations, their type defaults to any(). That is, the │ │ │ │ +previous example is a shorthand for the following:

-record(rec, {field1 :: Type1, field2 :: any(), field3 :: Type3}).

In the presence of initial values for fields, the type must be declared after │ │ │ │ +the initialization, as follows:

-record(rec, {field1 = [] :: Type1, field2, field3 = 42 :: Type3}).

The initial values for fields are to be compatible with (that is, a member of) │ │ │ │ the corresponding types. This is checked by the compiler and results in a │ │ │ │ compilation error if a violation is detected.

Change

Before Erlang/OTP 19, for fields without initial values, the singleton type │ │ │ │ 'undefined' was added to all declared types. In other words, the following │ │ │ │ -two record declarations had identical effects:

-record(rec, {f1 = 42 :: integer(),
│ │ │ │ -             f2      :: float(),
│ │ │ │ -             f3      :: 'a' | 'b'}).
│ │ │ │ +two record declarations had identical effects:

-record(rec, {f1 = 42 :: integer(),
│ │ │ │ +             f2      :: float(),
│ │ │ │ +             f3      :: 'a' | 'b'}).
│ │ │ │  
│ │ │ │ --record(rec, {f1 = 42 :: integer(),
│ │ │ │ -              f2      :: 'undefined' | float(),
│ │ │ │ -              f3      :: 'undefined' | 'a' | 'b'}).

This is no longer the case. If you require 'undefined' in your record field │ │ │ │ +-record(rec, {f1 = 42 :: integer(), │ │ │ │ + f2 :: 'undefined' | float(), │ │ │ │ + f3 :: 'undefined' | 'a' | 'b'}).

This is no longer the case. If you require 'undefined' in your record field │ │ │ │ type, you must explicitly add it to the typespec, as in the 2nd example.

Any record, containing type information or not, once defined, can be used as a │ │ │ │ type using the following syntax:

#rec{}

In addition, the record fields can be further specified when using a record type │ │ │ │ by adding type information about the field as follows:

#rec{some_field :: Type}

Any unspecified fields are assumed to have the type in the original record │ │ │ │ declaration.

Note

When records are used to create patterns for ETS and Mnesia match functions, │ │ │ │ -Dialyzer may need some help not to emit bad warnings. For example:

-type height() :: pos_integer().
│ │ │ │ --record(person, {name :: string(), height :: height()}).
│ │ │ │ +Dialyzer may need some help not to emit bad warnings. For example:

-type height() :: pos_integer().
│ │ │ │ +-record(person, {name :: string(), height :: height()}).
│ │ │ │  
│ │ │ │ -lookup(Name, Tab) ->
│ │ │ │ -    ets:match_object(Tab, #person{name = Name, _ = '_'}).

Dialyzer will emit a warning since '_' is not in the type of record field │ │ │ │ +lookup(Name, Tab) -> │ │ │ │ + ets:match_object(Tab, #person{name = Name, _ = '_'}).

Dialyzer will emit a warning since '_' is not in the type of record field │ │ │ │ height.

The recommended way of dealing with this is to declare the smallest record │ │ │ │ field types to accommodate all your needs, and then create refinements as │ │ │ │ -needed. The modified example:

-record(person, {name :: string(), height :: height() | '_'}).
│ │ │ │ +needed. The modified example:

-record(person, {name :: string(), height :: height() | '_'}).
│ │ │ │  
│ │ │ │ --type person() :: #person{height :: height()}.

In specifications and type declarations the type person() is to be preferred │ │ │ │ +-type person() :: #person{height :: height()}.

In specifications and type declarations the type person() is to be preferred │ │ │ │ before #person{}.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Specifications for Functions │ │ │ │

│ │ │ │

A specification (or contract) for a function is given using the -spec │ │ │ │ attribute. The general format is as follows:

-spec Function(ArgType1, ..., ArgTypeN) -> ReturnType.

An implementation of the function with the same name Function must exist in │ │ │ │ the current module, and the arity of the function must match the number of │ │ │ │ arguments, otherwise the compilation fails.

The following longer format with module name is also valid as long as Module │ │ │ │ is the name of the current module. This can be useful for documentation │ │ │ │ purposes.

-spec Module:Function(ArgType1, ..., ArgTypeN) -> ReturnType.

Also, for documentation purposes, argument names can be given:

-spec Function(ArgName1 :: Type1, ..., ArgNameN :: TypeN) -> RT.

A function specification can be overloaded. That is, it can have several types, │ │ │ │ -separated by a semicolon (;). For example:

-spec foo(T1, T2) -> T3;
│ │ │ │ -         (T4, T5) -> T6.

A current restriction, which currently results in a warning by Dialyzer, is that │ │ │ │ +separated by a semicolon (;). For example:

-spec foo(T1, T2) -> T3;
│ │ │ │ +         (T4, T5) -> T6.

A current restriction, which currently results in a warning by Dialyzer, is that │ │ │ │ the domains of the argument types cannot overlap. For example, the following │ │ │ │ -specification results in a warning:

-spec foo(pos_integer()) -> pos_integer();
│ │ │ │ -         (integer()) -> integer().

Type variables can be used in specifications to specify relations for the input │ │ │ │ +specification results in a warning:

-spec foo(pos_integer()) -> pos_integer();
│ │ │ │ +         (integer()) -> integer().

Type variables can be used in specifications to specify relations for the input │ │ │ │ and output arguments of a function. For example, the following specification │ │ │ │ defines the type of a polymorphic identity function:

-spec id(X) -> X.

Notice that the above specification does not restrict the input and output type │ │ │ │ in any way. These types can be constrained by guard-like subtype constraints and │ │ │ │ -provide bounded quantification:

-spec id(X) -> X when X :: tuple().

Currently, the :: constraint (read as "is a subtype of") is the only guard │ │ │ │ +provide bounded quantification:

-spec id(X) -> X when X :: tuple().

Currently, the :: constraint (read as "is a subtype of") is the only guard │ │ │ │ constraint that can be used in the when part of a -spec attribute.

Note

The above function specification uses multiple occurrences of the same type │ │ │ │ variable. That provides more type information than the following function │ │ │ │ -specification, where the type variables are missing:

-spec id(tuple()) -> tuple().

The latter specification says that the function takes some tuple and returns │ │ │ │ +specification, where the type variables are missing:

-spec id(tuple()) -> tuple().

The latter specification says that the function takes some tuple and returns │ │ │ │ some tuple. The specification with the X type variable specifies that the │ │ │ │ function takes a tuple and returns the same tuple.

However, it is up to the tools that process the specifications to choose │ │ │ │ whether to take this extra information into account or not.

The scope of a :: constraint is the (...) -> RetType specification after │ │ │ │ which it appears. To avoid confusion, it is suggested that different variables │ │ │ │ are used in different constituents of an overloaded contract, as shown in the │ │ │ │ -following example:

-spec foo({X, integer()}) -> X when X :: atom();
│ │ │ │ -         ([Y]) -> Y when Y :: number().

Some functions in Erlang are not meant to return; either because they define │ │ │ │ +following example:

-spec foo({X, integer()}) -> X when X :: atom();
│ │ │ │ +         ([Y]) -> Y when Y :: number().

Some functions in Erlang are not meant to return; either because they define │ │ │ │ servers or because they are used to throw exceptions, as in the following │ │ │ │ -function:

my_error(Err) -> throw({error, Err}).

For such functions, it is recommended to use the special no_return/0 type │ │ │ │ +function:

my_error(Err) -> throw({error, Err}).

For such functions, it is recommended to use the special no_return/0 type │ │ │ │ for their "return", through a contract of the following form:

-spec my_error(term()) -> no_return().

Note

Erlang uses the shorthand version _ as an anonymous type variable equivalent │ │ │ │ to term/0 or any/0. For example, the following function

-spec Function(string(), _) -> string().

is equivalent to:

-spec Function(string(), any()) -> string().
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/tablesdatabases.xhtml │ │ │ │ @@ -51,73 +51,73 @@ │ │ │ │ │ │ │ │ │ │ │ │ Deleting an Element │ │ │ │ │ │ │ │

The delete operation is considered successful if the element was not present │ │ │ │ in the table. Hence all attempts to check that the element is present in the │ │ │ │ Ets/Mnesia table before deletion are unnecessary. Here follows an example for │ │ │ │ -Ets tables:

DO

ets:delete(Tab, Key),

DO NOT

case ets:lookup(Tab, Key) of
│ │ │ │ -    [] ->
│ │ │ │ +Ets tables:

DO

ets:delete(Tab, Key),

DO NOT

case ets:lookup(Tab, Key) of
│ │ │ │ +    [] ->
│ │ │ │          ok;
│ │ │ │ -    [_|_] ->
│ │ │ │ -        ets:delete(Tab, Key)
│ │ │ │ +    [_|_] ->
│ │ │ │ +        ets:delete(Tab, Key)
│ │ │ │  end,

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Fetching Data │ │ │ │

│ │ │ │

Do not fetch data that you already have.

Consider that you have a module that handles the abstract data type Person. │ │ │ │ You export the interface function print_person/1, which uses the internal │ │ │ │ functions print_name/1, print_age/1, and print_occupation/1.

Note

If the function print_name/1, and so on, had been interface functions, the │ │ │ │ situation would have been different, as you do not want the user of the │ │ │ │ interface to know about the internal data representation.

DO

%%% Interface function
│ │ │ │ -print_person(PersonId) ->
│ │ │ │ +print_person(PersonId) ->
│ │ │ │      %% Look up the person in the named table person,
│ │ │ │ -    case ets:lookup(person, PersonId) of
│ │ │ │ -        [Person] ->
│ │ │ │ -            print_name(Person),
│ │ │ │ -            print_age(Person),
│ │ │ │ -            print_occupation(Person);
│ │ │ │ -        [] ->
│ │ │ │ -            io:format("No person with ID = ~p~n", [PersonID])
│ │ │ │ +    case ets:lookup(person, PersonId) of
│ │ │ │ +        [Person] ->
│ │ │ │ +            print_name(Person),
│ │ │ │ +            print_age(Person),
│ │ │ │ +            print_occupation(Person);
│ │ │ │ +        [] ->
│ │ │ │ +            io:format("No person with ID = ~p~n", [PersonID])
│ │ │ │      end.
│ │ │ │  
│ │ │ │  %%% Internal functions
│ │ │ │ -print_name(Person) ->
│ │ │ │ -    io:format("No person ~p~n", [Person#person.name]).
│ │ │ │ +print_name(Person) ->
│ │ │ │ +    io:format("No person ~p~n", [Person#person.name]).
│ │ │ │  
│ │ │ │ -print_age(Person) ->
│ │ │ │ -    io:format("No person ~p~n", [Person#person.age]).
│ │ │ │ +print_age(Person) ->
│ │ │ │ +    io:format("No person ~p~n", [Person#person.age]).
│ │ │ │  
│ │ │ │ -print_occupation(Person) ->
│ │ │ │ -    io:format("No person ~p~n", [Person#person.occupation]).

DO NOT

%%% Interface function
│ │ │ │ -print_person(PersonId) ->
│ │ │ │ +print_occupation(Person) ->
│ │ │ │ +    io:format("No person ~p~n", [Person#person.occupation]).

DO NOT

%%% Interface function
│ │ │ │ +print_person(PersonId) ->
│ │ │ │      %% Look up the person in the named table person,
│ │ │ │ -    case ets:lookup(person, PersonId) of
│ │ │ │ -        [Person] ->
│ │ │ │ -            print_name(PersonID),
│ │ │ │ -            print_age(PersonID),
│ │ │ │ -            print_occupation(PersonID);
│ │ │ │ -        [] ->
│ │ │ │ -            io:format("No person with ID = ~p~n", [PersonID])
│ │ │ │ +    case ets:lookup(person, PersonId) of
│ │ │ │ +        [Person] ->
│ │ │ │ +            print_name(PersonID),
│ │ │ │ +            print_age(PersonID),
│ │ │ │ +            print_occupation(PersonID);
│ │ │ │ +        [] ->
│ │ │ │ +            io:format("No person with ID = ~p~n", [PersonID])
│ │ │ │      end.
│ │ │ │  
│ │ │ │  %%% Internal functions
│ │ │ │ -print_name(PersonID) ->
│ │ │ │ -    [Person] = ets:lookup(person, PersonId),
│ │ │ │ -    io:format("No person ~p~n", [Person#person.name]).
│ │ │ │ -
│ │ │ │ -print_age(PersonID) ->
│ │ │ │ -    [Person] = ets:lookup(person, PersonId),
│ │ │ │ -    io:format("No person ~p~n", [Person#person.age]).
│ │ │ │ -
│ │ │ │ -print_occupation(PersonID) ->
│ │ │ │ -    [Person] = ets:lookup(person, PersonId),
│ │ │ │ -    io:format("No person ~p~n", [Person#person.occupation]).

│ │ │ │ +print_name(PersonID) -> │ │ │ │ + [Person] = ets:lookup(person, PersonId), │ │ │ │ + io:format("No person ~p~n", [Person#person.name]). │ │ │ │ + │ │ │ │ +print_age(PersonID) -> │ │ │ │ + [Person] = ets:lookup(person, PersonId), │ │ │ │ + io:format("No person ~p~n", [Person#person.age]). │ │ │ │ + │ │ │ │ +print_occupation(PersonID) -> │ │ │ │ + [Person] = ets:lookup(person, PersonId), │ │ │ │ + io:format("No person ~p~n", [Person#person.occupation]).

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Non-Persistent Database Storage │ │ │ │

│ │ │ │

For non-persistent database storage, prefer Ets tables over Mnesia │ │ │ │ local_content tables. Even the Mnesia dirty_write operations carry a fixed │ │ │ │ @@ -131,38 +131,38 @@ │ │ │ │ │ │ │ │

Assuming an Ets table that uses idno as key and contains the following:

[#person{idno = 1, name = "Adam",  age = 31, occupation = "mailman"},
│ │ │ │   #person{idno = 2, name = "Bryan", age = 31, occupation = "cashier"},
│ │ │ │   #person{idno = 3, name = "Bryan", age = 35, occupation = "banker"},
│ │ │ │   #person{idno = 4, name = "Carl",  age = 25, occupation = "mailman"}]

If you must return all data stored in the Ets table, you can use │ │ │ │ ets:tab2list/1. However, usually you are only interested in a subset of the │ │ │ │ information in which case ets:tab2list/1 is expensive. If you only want to │ │ │ │ -extract one field from each record, for example, the age of every person, then:

DO

ets:select(Tab, [{#person{idno='_',
│ │ │ │ +extract one field from each record, for example, the age of every person, then:

DO

ets:select(Tab, [{#person{idno='_',
│ │ │ │                            name='_',
│ │ │ │                            age='$1',
│ │ │ │ -                          occupation = '_'},
│ │ │ │ -                [],
│ │ │ │ -                ['$1']}]),

DO NOT

TabList = ets:tab2list(Tab),
│ │ │ │ -lists:map(fun(X) -> X#person.age end, TabList),

If you are only interested in the age of all persons named "Bryan", then:

DO

ets:select(Tab, [{#person{idno='_',
│ │ │ │ +                          occupation = '_'},
│ │ │ │ +                [],
│ │ │ │ +                ['$1']}]),

DO NOT

TabList = ets:tab2list(Tab),
│ │ │ │ +lists:map(fun(X) -> X#person.age end, TabList),

If you are only interested in the age of all persons named "Bryan", then:

DO

ets:select(Tab, [{#person{idno='_',
│ │ │ │                            name="Bryan",
│ │ │ │                            age='$1',
│ │ │ │ -                          occupation = '_'},
│ │ │ │ -                [],
│ │ │ │ -                ['$1']}])

DO NOT

TabList = ets:tab2list(Tab),
│ │ │ │ -lists:foldl(fun(X, Acc) -> case X#person.name of
│ │ │ │ +                          occupation = '_'},
│ │ │ │ +                [],
│ │ │ │ +                ['$1']}])

DO NOT

TabList = ets:tab2list(Tab),
│ │ │ │ +lists:foldl(fun(X, Acc) -> case X#person.name of
│ │ │ │                                  "Bryan" ->
│ │ │ │ -                                    [X#person.age|Acc];
│ │ │ │ +                                    [X#person.age|Acc];
│ │ │ │                                   _ ->
│ │ │ │                                       Acc
│ │ │ │                             end
│ │ │ │ -             end, [], TabList)

If you need all information stored in the Ets table about persons named "Bryan", │ │ │ │ -then:

DO

ets:select(Tab, [{#person{idno='_',
│ │ │ │ +             end, [], TabList)

If you need all information stored in the Ets table about persons named "Bryan", │ │ │ │ +then:

DO

ets:select(Tab, [{#person{idno='_',
│ │ │ │                            name="Bryan",
│ │ │ │                            age='_',
│ │ │ │ -                          occupation = '_'}, [], ['$_']}]),

DO NOT

TabList = ets:tab2list(Tab),
│ │ │ │ -lists:filter(fun(X) -> X#person.name == "Bryan" end, TabList),

│ │ │ │ + occupation = '_'}, [], ['$_']}]),

DO NOT

TabList = ets:tab2list(Tab),
│ │ │ │ +lists:filter(fun(X) -> X#person.name == "Bryan" end, TabList),

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ordered_set Tables │ │ │ │

│ │ │ │

If the data in the table is to be accessed so that the order of the keys in the │ │ │ │ table is significant, the table type ordered_set can be used instead of the │ │ │ │ @@ -198,20 +198,20 @@ │ │ │ │ Clearly, the second table would have to be kept consistent with the master │ │ │ │ table. Mnesia can do this for you, but a home-brew index table can be very │ │ │ │ efficient compared to the overhead involved in using Mnesia.

An index table for the table in the previous examples would have to be a bag (as │ │ │ │ keys would appear more than once) and can have the following contents:

[#index_entry{name="Adam", idno=1},
│ │ │ │   #index_entry{name="Bryan", idno=2},
│ │ │ │   #index_entry{name="Bryan", idno=3},
│ │ │ │   #index_entry{name="Carl", idno=4}]

Given this index table, a lookup of the age fields for all persons named │ │ │ │ -"Bryan" can be done as follows:

MatchingIDs = ets:lookup(IndexTable,"Bryan"),
│ │ │ │ -lists:map(fun(#index_entry{idno = ID}) ->
│ │ │ │ -                 [#person{age = Age}] = ets:lookup(PersonTable, ID),
│ │ │ │ +"Bryan" can be done as follows:

MatchingIDs = ets:lookup(IndexTable,"Bryan"),
│ │ │ │ +lists:map(fun(#index_entry{idno = ID}) ->
│ │ │ │ +                 [#person{age = Age}] = ets:lookup(PersonTable, ID),
│ │ │ │                   Age
│ │ │ │            end,
│ │ │ │ -          MatchingIDs),

Notice that this code does not use ets:match/2, but instead uses the │ │ │ │ + MatchingIDs),

Notice that this code does not use ets:match/2, but instead uses the │ │ │ │ ets:lookup/2 call. The lists:map/2 call is only used to traverse the idnos │ │ │ │ matching the name "Bryan" in the table; thus the number of lookups in the master │ │ │ │ table is minimized.

Keeping an index table introduces some overhead when inserting records in the │ │ │ │ table. The number of operations gained from the table must therefore be compared │ │ │ │ against the number of operations inserting objects in the table. However, notice │ │ │ │ that the gain is significant when the key can be used to lookup elements.

│ │ │ │ │ │ │ │ @@ -226,47 +226,47 @@ │ │ │ │ Secondary Index │ │ │ │

│ │ │ │

If you frequently do lookups on a field that is not the key of the table, you │ │ │ │ lose performance using mnesia:select() or │ │ │ │ mnesia:match_object() as these function traverse │ │ │ │ the whole table. Instead, you can create a secondary index and use │ │ │ │ mnesia:index_read/3 to get faster access at the expense of using more │ │ │ │ -memory.

Example:

-record(person, {idno, name, age, occupation}).
│ │ │ │ +memory.

Example:

-record(person, {idno, name, age, occupation}).
│ │ │ │          ...
│ │ │ │ -{atomic, ok} =
│ │ │ │ -mnesia:create_table(person, [{index,[#person.age]},
│ │ │ │ -                              {attributes,
│ │ │ │ -                                    record_info(fields, person)}]),
│ │ │ │ -{atomic, ok} = mnesia:add_table_index(person, age),
│ │ │ │ +{atomic, ok} =
│ │ │ │ +mnesia:create_table(person, [{index,[#person.age]},
│ │ │ │ +                              {attributes,
│ │ │ │ +                                    record_info(fields, person)}]),
│ │ │ │ +{atomic, ok} = mnesia:add_table_index(person, age),
│ │ │ │  ...
│ │ │ │  
│ │ │ │  PersonsAge42 =
│ │ │ │ -     mnesia:dirty_index_read(person, 42, #person.age),

│ │ │ │ + mnesia:dirty_index_read(person, 42, #person.age),

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Transactions │ │ │ │

│ │ │ │

Using transactions is a way to guarantee that the distributed Mnesia database │ │ │ │ remains consistent, even when many different processes update it in parallel. │ │ │ │ However, if you have real-time requirements it is recommended to use dirtry │ │ │ │ operations instead of transactions. When using dirty operations, you lose the │ │ │ │ consistency guarantee; this is usually solved by only letting one process update │ │ │ │ the table. Other processes must send update requests to that process.

Example:

...
│ │ │ │  %% Using transaction
│ │ │ │  
│ │ │ │ -Fun = fun() ->
│ │ │ │ -          [mnesia:read({Table, Key}),
│ │ │ │ -           mnesia:read({Table2, Key2})]
│ │ │ │ +Fun = fun() ->
│ │ │ │ +          [mnesia:read({Table, Key}),
│ │ │ │ +           mnesia:read({Table2, Key2})]
│ │ │ │        end,
│ │ │ │  
│ │ │ │ -{atomic, [Result1, Result2]}  = mnesia:transaction(Fun),
│ │ │ │ +{atomic, [Result1, Result2]}  = mnesia:transaction(Fun),
│ │ │ │  ...
│ │ │ │  
│ │ │ │  %% Same thing using dirty operations
│ │ │ │  ...
│ │ │ │  
│ │ │ │ -Result1 = mnesia:dirty_read({Table, Key}),
│ │ │ │ -Result2 = mnesia:dirty_read({Table2, Key2}),
│ │ │ │ +Result1 = mnesia:dirty_read({Table, Key}), │ │ │ │ +Result2 = mnesia:dirty_read({Table2, Key2}), │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/sup_princ.xhtml │ │ │ │ @@ -33,48 +33,48 @@ │ │ │ │ the order specified by this list, and are terminated in the reverse order.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Example │ │ │ │

│ │ │ │

The callback module for a supervisor starting the server from │ │ │ │ -gen_server Behaviour can look as follows:

-module(ch_sup).
│ │ │ │ --behaviour(supervisor).
│ │ │ │ +gen_server Behaviour can look as follows:

-module(ch_sup).
│ │ │ │ +-behaviour(supervisor).
│ │ │ │  
│ │ │ │ --export([start_link/0]).
│ │ │ │ --export([init/1]).
│ │ │ │ +-export([start_link/0]).
│ │ │ │ +-export([init/1]).
│ │ │ │  
│ │ │ │ -start_link() ->
│ │ │ │ -    supervisor:start_link(ch_sup, []).
│ │ │ │ +start_link() ->
│ │ │ │ +    supervisor:start_link(ch_sup, []).
│ │ │ │  
│ │ │ │ -init(_Args) ->
│ │ │ │ -    SupFlags = #{strategy => one_for_one, intensity => 1, period => 5},
│ │ │ │ -    ChildSpecs = [#{id => ch3,
│ │ │ │ -                    start => {ch3, start_link, []},
│ │ │ │ +init(_Args) ->
│ │ │ │ +    SupFlags = #{strategy => one_for_one, intensity => 1, period => 5},
│ │ │ │ +    ChildSpecs = [#{id => ch3,
│ │ │ │ +                    start => {ch3, start_link, []},
│ │ │ │                      restart => permanent,
│ │ │ │                      shutdown => brutal_kill,
│ │ │ │                      type => worker,
│ │ │ │ -                    modules => [ch3]}],
│ │ │ │ -    {ok, {SupFlags, ChildSpecs}}.

The SupFlags variable in the return value from init/1 represents the │ │ │ │ + modules => [ch3]}], │ │ │ │ + {ok, {SupFlags, ChildSpecs}}.

The SupFlags variable in the return value from init/1 represents the │ │ │ │ supervisor flags.

The ChildSpecs variable in the return value from init/1 is a list of │ │ │ │ child specifications.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Supervisor Flags │ │ │ │

│ │ │ │ -

This is the type definition for the supervisor flags:

sup_flags() = #{strategy => strategy(),           % optional
│ │ │ │ -                intensity => non_neg_integer(),   % optional
│ │ │ │ -                period => pos_integer(),          % optional
│ │ │ │ -                auto_shutdown => auto_shutdown()} % optional
│ │ │ │ -    strategy() = one_for_all
│ │ │ │ +

This is the type definition for the supervisor flags:

sup_flags() = #{strategy => strategy(),           % optional
│ │ │ │ +                intensity => non_neg_integer(),   % optional
│ │ │ │ +                period => pos_integer(),          % optional
│ │ │ │ +                auto_shutdown => auto_shutdown()} % optional
│ │ │ │ +    strategy() = one_for_all
│ │ │ │                 | one_for_one
│ │ │ │                 | rest_for_one
│ │ │ │                 | simple_one_for_one
│ │ │ │ -    auto_shutdown() = never
│ │ │ │ +    auto_shutdown() = never
│ │ │ │                      | any_significant
│ │ │ │                      | all_significant

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -313,28 +313,28 @@ │ │ │ │ exhaust the Maximum Restart Intensity of the │ │ │ │ parent supervisor.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Child Specification │ │ │ │

│ │ │ │ -

The type definition for a child specification is as follows:

child_spec() = #{id => child_id(),             % mandatory
│ │ │ │ -                 start => mfargs(),            % mandatory
│ │ │ │ -                 restart => restart(),         % optional
│ │ │ │ -                 significant => significant(), % optional
│ │ │ │ -                 shutdown => shutdown(),       % optional
│ │ │ │ -                 type => worker(),             % optional
│ │ │ │ -                 modules => modules()}         % optional
│ │ │ │ -    child_id() = term()
│ │ │ │ -    mfargs() = {M :: module(), F :: atom(), A :: [term()]}
│ │ │ │ -    modules() = [module()] | dynamic
│ │ │ │ -    restart() = permanent | transient | temporary
│ │ │ │ -    significant() = boolean()
│ │ │ │ -    shutdown() = brutal_kill | timeout()
│ │ │ │ -    worker() = worker | supervisor
  • id is used to identify the child specification internally by the supervisor.

    The id key is mandatory.

    Note that this identifier occasionally has been called "name". As far as │ │ │ │ +

    The type definition for a child specification is as follows:

    child_spec() = #{id => child_id(),             % mandatory
    │ │ │ │ +                 start => mfargs(),            % mandatory
    │ │ │ │ +                 restart => restart(),         % optional
    │ │ │ │ +                 significant => significant(), % optional
    │ │ │ │ +                 shutdown => shutdown(),       % optional
    │ │ │ │ +                 type => worker(),             % optional
    │ │ │ │ +                 modules => modules()}         % optional
    │ │ │ │ +    child_id() = term()
    │ │ │ │ +    mfargs() = {M :: module(), F :: atom(), A :: [term()]}
    │ │ │ │ +    modules() = [module()] | dynamic
    │ │ │ │ +    restart() = permanent | transient | temporary
    │ │ │ │ +    significant() = boolean()
    │ │ │ │ +    shutdown() = brutal_kill | timeout()
    │ │ │ │ +    worker() = worker | supervisor
    • id is used to identify the child specification internally by the supervisor.

      The id key is mandatory.

      Note that this identifier occasionally has been called "name". As far as │ │ │ │ possible, the terms "identifier" or "id" are now used but in order to keep │ │ │ │ backwards compatibility, some occurrences of "name" can still be found, for │ │ │ │ example in error messages.

    • start defines the function call used to start the child process. It is a │ │ │ │ module-function-arguments tuple used as apply(M, F, A).

      It is to be (or result in) a call to any of the following:

      The start key is mandatory.

    • restart defines when a terminated child process is to be │ │ │ │ restarted.

      • A permanent child process is always restarted.
      • A temporary child process is never restarted (not even when the supervisor │ │ │ │ restart strategy is rest_for_one or one_for_all and a sibling death │ │ │ │ @@ -362,53 +362,53 @@ │ │ │ │ supervisor, the default value infinity will be used.

      • type specifies whether the child process is a supervisor or a worker.

        The type key is optional. If it is not given, the default value worker │ │ │ │ will be used.

      • modules has to be a list consisting of a single element. The value │ │ │ │ of that element depends on the behaviour of the process:

        • If the child process is a gen_event, the element has to be the atom │ │ │ │ dynamic.
        • Otherwise, the element should be Module, where Module is the │ │ │ │ name of the callback module.

        This information is used by the release handler during upgrades and │ │ │ │ downgrades; see Release Handling.

        The modules key is optional. If it is not given, it defaults to [M], where │ │ │ │ M comes from the child's start {M,F,A}.

      Example: The child specification to start the server ch3 in the previous │ │ │ │ -example look as follows:

      #{id => ch3,
      │ │ │ │ -  start => {ch3, start_link, []},
      │ │ │ │ +example look as follows:

      #{id => ch3,
      │ │ │ │ +  start => {ch3, start_link, []},
      │ │ │ │    restart => permanent,
      │ │ │ │    shutdown => brutal_kill,
      │ │ │ │    type => worker,
      │ │ │ │ -  modules => [ch3]}

      or simplified, relying on the default values:

      #{id => ch3,
      │ │ │ │ +  modules => [ch3]}

      or simplified, relying on the default values:

      #{id => ch3,
      │ │ │ │    start => {ch3, start_link, []},
      │ │ │ │    shutdown => brutal_kill}

      Example: A child specification to start the event manager from the chapter about │ │ │ │ -gen_event:

      #{id => error_man,
      │ │ │ │ -  start => {gen_event, start_link, [{local, error_man}]},
      │ │ │ │ -  modules => dynamic}

      Both server and event manager are registered processes which can be expected to │ │ │ │ +gen_event:

      #{id => error_man,
      │ │ │ │ +  start => {gen_event, start_link, [{local, error_man}]},
      │ │ │ │ +  modules => dynamic}

      Both server and event manager are registered processes which can be expected to │ │ │ │ be always accessible. Thus they are specified to be permanent.

      ch3 does not need to do any cleaning up before termination. Thus, no shutdown │ │ │ │ time is needed, but brutal_kill is sufficient. error_man can need some time │ │ │ │ for the event handlers to clean up, thus the shutdown time is set to 5000 ms │ │ │ │ -(which is the default value).

      Example: A child specification to start another supervisor:

      #{id => sup,
      │ │ │ │ -  start => {sup, start_link, []},
      │ │ │ │ +(which is the default value).

      Example: A child specification to start another supervisor:

      #{id => sup,
      │ │ │ │ +  start => {sup, start_link, []},
      │ │ │ │    restart => transient,
      │ │ │ │ -  type => supervisor} % will cause default shutdown=>infinity

      │ │ │ │ + type => supervisor} % will cause default shutdown=>infinity

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Starting a Supervisor │ │ │ │

      │ │ │ │

      In the previous example, the supervisor is started by calling │ │ │ │ -ch_sup:start_link():

      start_link() ->
      │ │ │ │ -    supervisor:start_link(ch_sup, []).

      ch_sup:start_link calls function supervisor:start_link/2, which spawns and │ │ │ │ +ch_sup:start_link():

      start_link() ->
      │ │ │ │ +    supervisor:start_link(ch_sup, []).

      ch_sup:start_link calls function supervisor:start_link/2, which spawns and │ │ │ │ links to a new process, a supervisor.

      • The first argument, ch_sup, is the name of the callback module, that is, the │ │ │ │ module where the init callback function is located.
      • The second argument, [], is a term that is passed as is to the callback │ │ │ │ function init. Here, init does not need any data and ignores the argument.

      In this case, the supervisor is not registered. Instead its pid must be used. A │ │ │ │ name can be specified by calling │ │ │ │ supervisor:start_link({local, Name}, Module, Args) │ │ │ │ or │ │ │ │ supervisor:start_link({global, Name}, Module, Args).

      The new supervisor process calls the callback function ch_sup:init([]). init │ │ │ │ -has to return {ok, {SupFlags, ChildSpecs}}:

      init(_Args) ->
      │ │ │ │ -    SupFlags = #{},
      │ │ │ │ -    ChildSpecs = [#{id => ch3,
      │ │ │ │ -                    start => {ch3, start_link, []},
      │ │ │ │ -                    shutdown => brutal_kill}],
      │ │ │ │ -    {ok, {SupFlags, ChildSpecs}}.

      Subsequently, the supervisor starts its child processes according to the child │ │ │ │ +has to return {ok, {SupFlags, ChildSpecs}}:

      init(_Args) ->
      │ │ │ │ +    SupFlags = #{},
      │ │ │ │ +    ChildSpecs = [#{id => ch3,
      │ │ │ │ +                    start => {ch3, start_link, []},
      │ │ │ │ +                    shutdown => brutal_kill}],
      │ │ │ │ +    {ok, {SupFlags, ChildSpecs}}.

      Subsequently, the supervisor starts its child processes according to the child │ │ │ │ specifications in the start specification. In this case there is a single child │ │ │ │ process, called ch3.

      supervisor:start_link/3 is synchronous. It does not return until all child │ │ │ │ processes have been started.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Adding a Child Process │ │ │ │ @@ -437,31 +437,31 @@ │ │ │ │ │ │ │ │ │ │ │ │ Simplified one_for_one Supervisors │ │ │ │

      │ │ │ │

      A supervisor with restart strategy simple_one_for_one is a simplified │ │ │ │ one_for_one supervisor, where all child processes are dynamically added │ │ │ │ instances of the same process.

      The following is an example of a callback module for a simple_one_for_one │ │ │ │ -supervisor:

      -module(simple_sup).
      │ │ │ │ --behaviour(supervisor).
      │ │ │ │ +supervisor:

      -module(simple_sup).
      │ │ │ │ +-behaviour(supervisor).
      │ │ │ │  
      │ │ │ │ --export([start_link/0]).
      │ │ │ │ --export([init/1]).
      │ │ │ │ +-export([start_link/0]).
      │ │ │ │ +-export([init/1]).
      │ │ │ │  
      │ │ │ │ -start_link() ->
      │ │ │ │ -    supervisor:start_link(simple_sup, []).
      │ │ │ │ +start_link() ->
      │ │ │ │ +    supervisor:start_link(simple_sup, []).
      │ │ │ │  
      │ │ │ │ -init(_Args) ->
      │ │ │ │ -    SupFlags = #{strategy => simple_one_for_one,
      │ │ │ │ +init(_Args) ->
      │ │ │ │ +    SupFlags = #{strategy => simple_one_for_one,
      │ │ │ │                   intensity => 0,
      │ │ │ │ -                 period => 1},
      │ │ │ │ -    ChildSpecs = [#{id => call,
      │ │ │ │ -                    start => {call, start_link, []},
      │ │ │ │ -                    shutdown => brutal_kill}],
      │ │ │ │ -    {ok, {SupFlags, ChildSpecs}}.

      When started, the supervisor does not start any child │ │ │ │ + period => 1}, │ │ │ │ + ChildSpecs = [#{id => call, │ │ │ │ + start => {call, start_link, []}, │ │ │ │ + shutdown => brutal_kill}], │ │ │ │ + {ok, {SupFlags, ChildSpecs}}.

      When started, the supervisor does not start any child │ │ │ │ processes. Instead, all child processes need to be added dynamically by │ │ │ │ calling supervisor:start_child(Sup, List).

      Sup is the pid, or name, of the supervisor. List is an arbitrary list of │ │ │ │ terms, which are added to the list of arguments specified in the child │ │ │ │ specification. If the start function is specified as {M, F, A}, the child │ │ │ │ process is started by calling apply(M, F, A++List).

      For example, adding a child to simple_sup above:

      supervisor:start_child(Pid, [id1])

      The result is that the child process is started by calling │ │ │ │ apply(call, start_link, []++[id1]), or actually:

      call:start_link(id1)

      A child under a simple_one_for_one supervisor can be terminated with the │ │ │ │ following:

      supervisor:terminate_child(Sup, Pid)

      Sup is the pid, or name, of the supervisor and Pid is the pid of the child.

      Because a simple_one_for_one supervisor can have many children, it shuts them │ │ │ ├── OEBPS/statem.xhtml │ │ │ │ @@ -29,15 +29,15 @@ │ │ │ │ │ │ │ │

      Established Automata Theory does not deal much with how a state transition │ │ │ │ is triggered, but assumes that the output is a function of the input │ │ │ │ (and the state) and that they are some kind of values.

      For an Event-Driven State Machine, the input is an event that triggers │ │ │ │ a state transition and the output is actions executed during │ │ │ │ the state transition. Analogously to the mathematical model │ │ │ │ of a Finite State Machine, it can be described as a set of relations │ │ │ │ -of the following form:

      State(S) x Event(E) -> Actions(A), State(S')

      These relations are interpreted as follows: if we are in state S, │ │ │ │ +of the following form:

      State(S) x Event(E) -> Actions(A), State(S')

      These relations are interpreted as follows: if we are in state S, │ │ │ │ and event E occurs, we are to perform actions A, and make a transition │ │ │ │ to state S'. Notice that S' can be equal to S, │ │ │ │ and that A can be empty.

      In gen_statem we define a state change as a state transition in which the │ │ │ │ new state S' is different from the current state S, where "different" means │ │ │ │ Erlang's strict inequality: =/= also known as "does not match". gen_statem │ │ │ │ does more things during state changes than during other state transitions.

      As A and S' depend only on S and E, the kind of state machine described │ │ │ │ here is a Mealy machine (see, for example, the Wikipedia article │ │ │ │ @@ -310,20 +310,20 @@ │ │ │ │ │ │ │ │ State Enter Calls │ │ │ │ │ │ │ │

      The gen_statem behaviour can, if this is enabled, regardless of callback │ │ │ │ mode, automatically call the state callback │ │ │ │ with special arguments whenever the state changes, so you can write │ │ │ │ state enter actions near the rest of the state transition rules. │ │ │ │ -It typically looks like this:

      StateName(enter, OldState, Data) ->
      │ │ │ │ +It typically looks like this:

      StateName(enter, OldState, Data) ->
      │ │ │ │      ... code for state enter actions here ...
      │ │ │ │ -    {keep_state, NewData};
      │ │ │ │ -StateName(EventType, EventContent, Data) ->
      │ │ │ │ +    {keep_state, NewData};
      │ │ │ │ +StateName(EventType, EventContent, Data) ->
      │ │ │ │      ... code for actions here ...
      │ │ │ │ -    {next_state, NewStateName, NewData}.

      Since the state enter call is not an event there are restrictions on the │ │ │ │ + {next_state, NewStateName, NewData}.

      Since the state enter call is not an event there are restrictions on the │ │ │ │ allowed return value and state transition actions. │ │ │ │ You must not change the state, postpone this non-event, │ │ │ │ insert any events, or change the │ │ │ │ callback module.

      The first state that is entered after gen_statem:init/1 will get │ │ │ │ a state enter call with OldState equal to the current state.

      You may repeat the state enter call using the {repeat_state,...} return │ │ │ │ value from the state callback. In this case │ │ │ │ OldState will also be equal to the current state.

      Depending on how your state machine is specified, this can be a very useful │ │ │ │ @@ -404,72 +404,72 @@ │ │ │ │ │ │ │ │ locked --> check_code : {button, Button}\n* Collect Buttons │ │ │ │ check_code --> locked : Incorrect code │ │ │ │ check_code --> open : Correct code\n* do_unlock()\n* Clear Buttons\n* Set state_timeout 10 s │ │ │ │ │ │ │ │ open --> open : {button, Digit} │ │ │ │ open --> locked : state_timeout\n* do_lock()

      This code lock state machine can be implemented using gen_statem with │ │ │ │ -the following callback module:

      -module(code_lock).
      │ │ │ │ --behaviour(gen_statem).
      │ │ │ │ --define(NAME, code_lock).
      │ │ │ │ +the following callback module:

      -module(code_lock).
      │ │ │ │ +-behaviour(gen_statem).
      │ │ │ │ +-define(NAME, code_lock).
      │ │ │ │  
      │ │ │ │ --export([start_link/1]).
      │ │ │ │ --export([button/1]).
      │ │ │ │ --export([init/1,callback_mode/0,terminate/3]).
      │ │ │ │ --export([locked/3,open/3]).
      │ │ │ │ -
      │ │ │ │ -start_link(Code) ->
      │ │ │ │ -    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
      │ │ │ │ -
      │ │ │ │ -button(Button) ->
      │ │ │ │ -    gen_statem:cast(?NAME, {button,Button}).
      │ │ │ │ -
      │ │ │ │ -init(Code) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    Data = #{code => Code, length => length(Code), buttons => []},
      │ │ │ │ -    {ok, locked, Data}.
      │ │ │ │ -
      │ │ │ │ -callback_mode() ->
      │ │ │ │ -    state_functions.
      locked(
      │ │ │ │ -  cast, {button,Button},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +-export([start_link/1]).
      │ │ │ │ +-export([button/1]).
      │ │ │ │ +-export([init/1,callback_mode/0,terminate/3]).
      │ │ │ │ +-export([locked/3,open/3]).
      │ │ │ │ +
      │ │ │ │ +start_link(Code) ->
      │ │ │ │ +    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
      │ │ │ │ +
      │ │ │ │ +button(Button) ->
      │ │ │ │ +    gen_statem:cast(?NAME, {button,Button}).
      │ │ │ │ +
      │ │ │ │ +init(Code) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    Data = #{code => Code, length => length(Code), buttons => []},
      │ │ │ │ +    {ok, locked, Data}.
      │ │ │ │ +
      │ │ │ │ +callback_mode() ->
      │ │ │ │ +    state_functions.
      locked(
      │ │ │ │ +  cast, {button,Button},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │      NewButtons =
      │ │ │ │          if
      │ │ │ │ -            length(Buttons) < Length ->
      │ │ │ │ +            length(Buttons) < Length ->
      │ │ │ │                  Buttons;
      │ │ │ │              true ->
      │ │ │ │ -                tl(Buttons)
      │ │ │ │ -        end ++ [Button],
      │ │ │ │ +                tl(Buttons)
      │ │ │ │ +        end ++ [Button],
      │ │ │ │      if
      │ │ │ │          NewButtons =:= Code -> % Correct
      │ │ │ │ -	    do_unlock(),
      │ │ │ │ -            {next_state, open, Data#{buttons := []},
      │ │ │ │ -             [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ +	    do_unlock(),
      │ │ │ │ +            {next_state, open, Data#{buttons := []},
      │ │ │ │ +             [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │  	true -> % Incomplete | Incorrect
      │ │ │ │ -            {next_state, locked, Data#{buttons := NewButtons}}
      │ │ │ │ -    end.
      open(state_timeout, lock,  Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {next_state, locked, Data};
      │ │ │ │ -open(cast, {button,_}, Data) ->
      │ │ │ │ -    {next_state, open, Data}.
      do_lock() ->
      │ │ │ │ -    io:format("Lock~n", []).
      │ │ │ │ -do_unlock() ->
      │ │ │ │ -    io:format("Unlock~n", []).
      │ │ │ │ +            {next_state, locked, Data#{buttons := NewButtons}}
      │ │ │ │ +    end.
      open(state_timeout, lock,  Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {next_state, locked, Data};
      │ │ │ │ +open(cast, {button,_}, Data) ->
      │ │ │ │ +    {next_state, open, Data}.
      do_lock() ->
      │ │ │ │ +    io:format("Lock~n", []).
      │ │ │ │ +do_unlock() ->
      │ │ │ │ +    io:format("Unlock~n", []).
      │ │ │ │  
      │ │ │ │ -terminate(_Reason, State, _Data) ->
      │ │ │ │ -    State =/= locked andalso do_lock(),
      │ │ │ │ +terminate(_Reason, State, _Data) ->
      │ │ │ │ +    State =/= locked andalso do_lock(),
      │ │ │ │      ok.

      The code is explained in the next sections.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Starting gen_statem │ │ │ │

      │ │ │ │

      In the example in the previous section, gen_statem is started by calling │ │ │ │ -code_lock:start_link(Code):

      start_link(Code) ->
      │ │ │ │ -    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).

      start_link/1 calls function gen_statem:start_link/4, │ │ │ │ +code_lock:start_link(Code):

      start_link(Code) ->
      │ │ │ │ +    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).

      start_link/1 calls function gen_statem:start_link/4, │ │ │ │ which spawns and links to a new process, a gen_statem.

      • The first argument, {local,?NAME}, specifies the name. In this case, the │ │ │ │ gen_statem is locally registered as code_lock through the macro ?NAME.

        If the name is omitted, the gen_statem is not registered. Instead its pid │ │ │ │ must be used. The name can also be specified as {global, Name}, then the │ │ │ │ gen_statem is registered using global:register_name/2 in Kernel.

      • The second argument, ?MODULE, is the name of the callback module, │ │ │ │ that is, the module where the callback functions are located, │ │ │ │ which is this module.

        The interface functions (start_link/1 and button/1) are located in the │ │ │ │ same module as the callback functions (init/1, locked/3, and open/3). │ │ │ │ @@ -479,184 +479,184 @@ │ │ │ │ see gen_statem:start_link/3.

      If name registration succeeds, the new gen_statem process calls callback │ │ │ │ function code_lock:init(Code). This function is expected to return │ │ │ │ {ok, State, Data}, where State is the initial state of the gen_statem, │ │ │ │ in this case locked; assuming that the door is locked to begin with. │ │ │ │ Data is the internal server data of the gen_statem. Here the server data │ │ │ │ is a map() with key code that stores the correct │ │ │ │ button sequence, key length store its length, and key buttons │ │ │ │ -that stores the collected buttons up to the same length.

      init(Code) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    Data = #{code => Code, length => length(Code), buttons => []},
      │ │ │ │ -    {ok, locked, Data}.

      Function gen_statem:start_link/3,4 │ │ │ │ +that stores the collected buttons up to the same length.

      init(Code) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    Data = #{code => Code, length => length(Code), buttons => []},
      │ │ │ │ +    {ok, locked, Data}.

      Function gen_statem:start_link/3,4 │ │ │ │ is synchronous. It does not return until the gen_statem is initialized │ │ │ │ and is ready to receive events.

      Function gen_statem:start_link/3,4 │ │ │ │ must be used if the gen_statem is part of a supervision tree, that is, │ │ │ │ started by a supervisor. Function, │ │ │ │ gen_statem:start/3,4 can be used to start │ │ │ │ a standalone gen_statem, meaning it is not part of a supervision tree.

      Function Module:callback_mode/0 selects │ │ │ │ the CallbackMode for the callback module, │ │ │ │ in this case state_functions. │ │ │ │ -That is, each state has its own handler function:

      callback_mode() ->
      │ │ │ │ +That is, each state has its own handler function:

      callback_mode() ->
      │ │ │ │      state_functions.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Handling Events │ │ │ │

      │ │ │ │

      The function notifying the code lock about a button event is implemented using │ │ │ │ -gen_statem:cast/2:

      button(Button) ->
      │ │ │ │ -    gen_statem:cast(?NAME, {button,Button}).

      The first argument is the name of the gen_statem and must agree with │ │ │ │ +gen_statem:cast/2:

      button(Button) ->
      │ │ │ │ +    gen_statem:cast(?NAME, {button,Button}).

      The first argument is the name of the gen_statem and must agree with │ │ │ │ the name used to start it. So, we use the same macro ?NAME as when starting. │ │ │ │ {button, Button} is the event content.

      The event is sent to the gen_statem. When the event is received, the │ │ │ │ gen_statem calls StateName(cast, Event, Data), which is expected │ │ │ │ to return a tuple {next_state, NewStateName, NewData}, or │ │ │ │ {next_state, NewStateName, NewData, Actions}. StateName is the name │ │ │ │ of the current state and NewStateName is the name of the next state. │ │ │ │ NewData is a new value for the server data of the gen_statem, │ │ │ │ -and Actions is a list of actions to be performed by the gen_statem engine.

      locked(
      │ │ │ │ -  cast, {button,Button},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +and Actions is a list of actions to be performed by the gen_statem engine.

      locked(
      │ │ │ │ +  cast, {button,Button},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │      NewButtons =
      │ │ │ │          if
      │ │ │ │ -            length(Buttons) < Length ->
      │ │ │ │ +            length(Buttons) < Length ->
      │ │ │ │                  Buttons;
      │ │ │ │              true ->
      │ │ │ │ -                tl(Buttons)
      │ │ │ │ -        end ++ [Button],
      │ │ │ │ +                tl(Buttons)
      │ │ │ │ +        end ++ [Button],
      │ │ │ │      if
      │ │ │ │          NewButtons =:= Code -> % Correct
      │ │ │ │ -	    do_unlock(),
      │ │ │ │ -            {next_state, open, Data#{buttons := []},
      │ │ │ │ -             [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ +	    do_unlock(),
      │ │ │ │ +            {next_state, open, Data#{buttons := []},
      │ │ │ │ +             [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │  	true -> % Incomplete | Incorrect
      │ │ │ │ -            {next_state, locked, Data#{buttons := NewButtons}}
      │ │ │ │ +            {next_state, locked, Data#{buttons := NewButtons}}
      │ │ │ │      end.

      In state locked, when a button is pressed, it is collected with the │ │ │ │ previously pressed buttons up to the length of the correct code, then │ │ │ │ compared with the correct code. Depending on the result, the door is │ │ │ │ either unlocked and the gen_statem goes to state open, or the door │ │ │ │ remains in state locked.

      When changing to state open, the collected buttons are reset, the lock │ │ │ │ -unlocked, and a state time-out for 10 seconds is started.

      open(cast, {button,_}, Data) ->
      │ │ │ │ -    {next_state, open, Data}.

      In state open, a button event is ignored by staying in the same state. │ │ │ │ +unlocked, and a state time-out for 10 seconds is started.

      open(cast, {button,_}, Data) ->
      │ │ │ │ +    {next_state, open, Data}.

      In state open, a button event is ignored by staying in the same state. │ │ │ │ This can also be done by returning {keep_state, Data}, or in this case │ │ │ │ since Data is unchanged, by returning keep_state_and_data.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ State Time-Outs │ │ │ │

      │ │ │ │

      When a correct code has been given, the door is unlocked and the following │ │ │ │ -tuple is returned from locked/2:

      {next_state, open, Data#{buttons := []},
      │ │ │ │ - [{state_timeout,10_000,lock}]}; % Time in milliseconds

      10,000 is a time-out value in milliseconds. After this time (10 seconds), │ │ │ │ +tuple is returned from locked/2:

      {next_state, open, Data#{buttons := []},
      │ │ │ │ + [{state_timeout,10_000,lock}]}; % Time in milliseconds

      10,000 is a time-out value in milliseconds. After this time (10 seconds), │ │ │ │ a time-out occurs. Then, StateName(state_timeout, lock, Data) is called. │ │ │ │ The time-out occurs when the door has been in state open for 10 seconds. │ │ │ │ -After that the door is locked again:

      open(state_timeout, lock,  Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {next_state, locked, Data};

      The timer for a state time-out is automatically canceled when │ │ │ │ +After that the door is locked again:

      open(state_timeout, lock,  Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {next_state, locked, Data};

      The timer for a state time-out is automatically canceled when │ │ │ │ the state machine does a state change.

      You can restart, cancel, or update a state time-out. See section │ │ │ │ Time-Outs for details.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ All State Events │ │ │ │

      │ │ │ │

      Sometimes events can arrive in any state of the gen_statem. It is convenient │ │ │ │ to handle these in a common state handler function that all state functions │ │ │ │ call for events not specific to the state.

      Consider a code_length/0 function that returns the length │ │ │ │ of the correct code. We dispatch all events that are not state-specific │ │ │ │ to the common function handle_common/3:

      ...
      │ │ │ │ --export([button/1,code_length/0]).
      │ │ │ │ +-export([button/1,code_length/0]).
      │ │ │ │  ...
      │ │ │ │  
      │ │ │ │ -code_length() ->
      │ │ │ │ -    gen_statem:call(?NAME, code_length).
      │ │ │ │ +code_length() ->
      │ │ │ │ +    gen_statem:call(?NAME, code_length).
      │ │ │ │  
      │ │ │ │  ...
      │ │ │ │ -locked(...) -> ... ;
      │ │ │ │ -locked(EventType, EventContent, Data) ->
      │ │ │ │ -    handle_common(EventType, EventContent, Data).
      │ │ │ │ +locked(...) -> ... ;
      │ │ │ │ +locked(EventType, EventContent, Data) ->
      │ │ │ │ +    handle_common(EventType, EventContent, Data).
      │ │ │ │  
      │ │ │ │  ...
      │ │ │ │ -open(...) -> ... ;
      │ │ │ │ -open(EventType, EventContent, Data) ->
      │ │ │ │ -    handle_common(EventType, EventContent, Data).
      │ │ │ │ -
      │ │ │ │ -handle_common({call,From}, code_length, #{code := Code} = Data) ->
      │ │ │ │ -    {keep_state, Data,
      │ │ │ │ -     [{reply,From,length(Code)}]}.

      Another way to do it is through a convenience macro ?HANDLE_COMMON/0:

      ...
      │ │ │ │ --export([button/1,code_length/0]).
      │ │ │ │ +open(...) -> ... ;
      │ │ │ │ +open(EventType, EventContent, Data) ->
      │ │ │ │ +    handle_common(EventType, EventContent, Data).
      │ │ │ │ +
      │ │ │ │ +handle_common({call,From}, code_length, #{code := Code} = Data) ->
      │ │ │ │ +    {keep_state, Data,
      │ │ │ │ +     [{reply,From,length(Code)}]}.

      Another way to do it is through a convenience macro ?HANDLE_COMMON/0:

      ...
      │ │ │ │ +-export([button/1,code_length/0]).
      │ │ │ │  ...
      │ │ │ │  
      │ │ │ │ -code_length() ->
      │ │ │ │ -    gen_statem:call(?NAME, code_length).
      │ │ │ │ +code_length() ->
      │ │ │ │ +    gen_statem:call(?NAME, code_length).
      │ │ │ │  
      │ │ │ │ --define(HANDLE_COMMON,
      │ │ │ │ -    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, D)).
      │ │ │ │ +-define(HANDLE_COMMON,
      │ │ │ │ +    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, D)).
      │ │ │ │  %%
      │ │ │ │ -handle_common({call,From}, code_length, #{code := Code} = Data) ->
      │ │ │ │ -    {keep_state, Data,
      │ │ │ │ -     [{reply,From,length(Code)}]}.
      │ │ │ │ +handle_common({call,From}, code_length, #{code := Code} = Data) ->
      │ │ │ │ +    {keep_state, Data,
      │ │ │ │ +     [{reply,From,length(Code)}]}.
      │ │ │ │  
      │ │ │ │  ...
      │ │ │ │ -locked(...) -> ... ;
      │ │ │ │ +locked(...) -> ... ;
      │ │ │ │  ?HANDLE_COMMON.
      │ │ │ │  
      │ │ │ │  ...
      │ │ │ │ -open(...) -> ... ;
      │ │ │ │ +open(...) -> ... ;
      │ │ │ │  ?HANDLE_COMMON.

      This example uses gen_statem:call/2, which waits for a reply from the server. │ │ │ │ The reply is sent with a {reply, From, Reply} tuple in an action list in the │ │ │ │ {keep_state, ...} tuple that retains the current state. This return form is │ │ │ │ convenient when you want to stay in the current state but do not know or care │ │ │ │ about what it is.

      If the common state callback needs to know the current state a function │ │ │ │ -handle_common/4 can be used instead:

      -define(HANDLE_COMMON,
      │ │ │ │ -    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, ?FUNCTION_NAME, D)).

      │ │ │ │ +handle_common/4 can be used instead:

      -define(HANDLE_COMMON,
      │ │ │ │ +    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, ?FUNCTION_NAME, D)).

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ One State Callback │ │ │ │

      │ │ │ │

      If callback mode handle_event_function is used, │ │ │ │ all events are handled in │ │ │ │ Module:handle_event/4 and we can │ │ │ │ (but do not have to) use an event-centered approach where we first branch │ │ │ │ depending on event and then depending on state:

      ...
      │ │ │ │ --export([handle_event/4]).
      │ │ │ │ +-export([handle_event/4]).
      │ │ │ │  
      │ │ │ │  ...
      │ │ │ │ -callback_mode() ->
      │ │ │ │ +callback_mode() ->
      │ │ │ │      handle_event_function.
      │ │ │ │  
      │ │ │ │ -handle_event(cast, {button,Button}, State, #{code := Code} = Data) ->
      │ │ │ │ +handle_event(cast, {button,Button}, State, #{code := Code} = Data) ->
      │ │ │ │      case State of
      │ │ │ │  	locked ->
      │ │ │ │ -            #{length := Length, buttons := Buttons} = Data,
      │ │ │ │ +            #{length := Length, buttons := Buttons} = Data,
      │ │ │ │              NewButtons =
      │ │ │ │                  if
      │ │ │ │ -                    length(Buttons) < Length ->
      │ │ │ │ +                    length(Buttons) < Length ->
      │ │ │ │                          Buttons;
      │ │ │ │                      true ->
      │ │ │ │ -                        tl(Buttons)
      │ │ │ │ -                end ++ [Button],
      │ │ │ │ +                        tl(Buttons)
      │ │ │ │ +                end ++ [Button],
      │ │ │ │              if
      │ │ │ │                  NewButtons =:= Code -> % Correct
      │ │ │ │ -                    do_unlock(),
      │ │ │ │ -                    {next_state, open, Data#{buttons := []},
      │ │ │ │ -                     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ +                    do_unlock(),
      │ │ │ │ +                    {next_state, open, Data#{buttons := []},
      │ │ │ │ +                     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │                  true -> % Incomplete | Incorrect
      │ │ │ │ -                    {keep_state, Data#{buttons := NewButtons}}
      │ │ │ │ +                    {keep_state, Data#{buttons := NewButtons}}
      │ │ │ │              end;
      │ │ │ │  	open ->
      │ │ │ │              keep_state_and_data
      │ │ │ │      end;
      │ │ │ │ -handle_event(state_timeout, lock, open, Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {next_state, locked, Data};
      │ │ │ │ -handle_event(
      │ │ │ │ -  {call,From}, code_length, _State, #{code := Code} = Data) ->
      │ │ │ │ -    {keep_state, Data,
      │ │ │ │ -     [{reply,From,length(Code)}]}.
      │ │ │ │ +handle_event(state_timeout, lock, open, Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {next_state, locked, Data};
      │ │ │ │ +handle_event(
      │ │ │ │ +  {call,From}, code_length, _State, #{code := Code} = Data) ->
      │ │ │ │ +    {keep_state, Data,
      │ │ │ │ +     [{reply,From,length(Code)}]}.
      │ │ │ │  
      │ │ │ │  ...

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Stopping │ │ │ │

      │ │ │ │ @@ -668,59 +668,59 @@ │ │ │ │ │ │ │ │

      If the gen_statem is part of a supervision tree, no stop function is needed. │ │ │ │ The gen_statem is automatically terminated by its supervisor. Exactly how │ │ │ │ this is done is defined by a shutdown strategy │ │ │ │ set in the supervisor.

      If it is necessary to clean up before termination, the shutdown strategy │ │ │ │ must be a time-out value and the gen_statem must in function init/1 │ │ │ │ set itself to trap exit signals by calling │ │ │ │ -process_flag(trap_exit, true):

      init(Args) ->
      │ │ │ │ -    process_flag(trap_exit, true),
      │ │ │ │ -    do_lock(),
      │ │ │ │ +process_flag(trap_exit, true):

      init(Args) ->
      │ │ │ │ +    process_flag(trap_exit, true),
      │ │ │ │ +    do_lock(),
      │ │ │ │      ...

      When ordered to shut down, the gen_statem then calls callback function │ │ │ │ terminate(shutdown, State, Data).

      In this example, function terminate/3 locks the door if it is open, │ │ │ │ so we do not accidentally leave the door open │ │ │ │ -when the supervision tree terminates:

      terminate(_Reason, State, _Data) ->
      │ │ │ │ -    State =/= locked andalso do_lock(),
      │ │ │ │ +when the supervision tree terminates:

      terminate(_Reason, State, _Data) ->
      │ │ │ │ +    State =/= locked andalso do_lock(),
      │ │ │ │      ok.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Standalone gen_statem │ │ │ │

      │ │ │ │

      If the gen_statem is not part of a supervision tree, it can be stopped │ │ │ │ using gen_statem:stop/1, preferably through │ │ │ │ an API function:

      ...
      │ │ │ │ --export([start_link/1,stop/0]).
      │ │ │ │ +-export([start_link/1,stop/0]).
      │ │ │ │  
      │ │ │ │  ...
      │ │ │ │ -stop() ->
      │ │ │ │ -    gen_statem:stop(?NAME).

      This makes the gen_statem call callback function terminate/3 just like │ │ │ │ +stop() -> │ │ │ │ + gen_statem:stop(?NAME).

      This makes the gen_statem call callback function terminate/3 just like │ │ │ │ for a supervised server and waits for the process to terminate.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Event Time-Outs │ │ │ │

      │ │ │ │

      A time-out feature inherited from gen_statem's predecessor gen_fsm, │ │ │ │ is an event time-out, that is, if an event arrives the timer is canceled. │ │ │ │ You get either an event or a time-out, but not both.

      It is ordered by the │ │ │ │ transition action {timeout, Time, EventContent}, │ │ │ │ or just an integer Time, even without the enclosing actions list (the latter │ │ │ │ is a form inherited from gen_fsm).

      This type of time-out is useful, for example, to act on inactivity. │ │ │ │ Let's restart the code sequence if no button is pressed for say 30 seconds:

      ...
      │ │ │ │  
      │ │ │ │ -locked(timeout, _, Data) ->
      │ │ │ │ -    {next_state, locked, Data#{buttons := []}};
      │ │ │ │ -locked(
      │ │ │ │ -  cast, {button,Button},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +locked(timeout, _, Data) ->
      │ │ │ │ +    {next_state, locked, Data#{buttons := []}};
      │ │ │ │ +locked(
      │ │ │ │ +  cast, {button,Button},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │  ...
      │ │ │ │  	true -> % Incomplete | Incorrect
      │ │ │ │ -            {next_state, locked, Data#{buttons := NewButtons},
      │ │ │ │ -             30_000} % Time in milliseconds
      │ │ │ │ +            {next_state, locked, Data#{buttons := NewButtons},
      │ │ │ │ +             30_000} % Time in milliseconds
      │ │ │ │  ...

      Whenever we receive a button event we start an event time-out of 30 seconds, │ │ │ │ and if we get an event type of timeout we reset the remaining │ │ │ │ code sequence.

      An event time-out is canceled by any other event so you either get │ │ │ │ some other event or the time-out event. Therefore, canceling, │ │ │ │ restarting, or updating an event time-out is neither possible nor │ │ │ │ necessary. Whatever event you act on has already canceled │ │ │ │ the event time-out, so there is never a running event time-out │ │ │ │ @@ -739,30 +739,30 @@ │ │ │ │ another, maybe cancel the time-out without changing states, or perhaps run │ │ │ │ multiple time-outs in parallel. All this can be accomplished with │ │ │ │ generic time-outs. They may look a little │ │ │ │ bit like event time-outs but contain │ │ │ │ a name to allow for any number of them simultaneously and they are │ │ │ │ not automatically canceled.

      Here is how to accomplish the state time-out in the previous example │ │ │ │ by instead using a generic time-out named for example open:

      ...
      │ │ │ │ -locked(
      │ │ │ │ -  cast, {button,Button},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +locked(
      │ │ │ │ +  cast, {button,Button},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │  ...
      │ │ │ │      if
      │ │ │ │          NewButtons =:= Code -> % Correct
      │ │ │ │ -	    do_unlock(),
      │ │ │ │ -            {next_state, open, Data#{buttons := []},
      │ │ │ │ -             [{{timeout,open},10_000,lock}]}; % Time in milliseconds
      │ │ │ │ +	    do_unlock(),
      │ │ │ │ +            {next_state, open, Data#{buttons := []},
      │ │ │ │ +             [{{timeout,open},10_000,lock}]}; % Time in milliseconds
      │ │ │ │  ...
      │ │ │ │  
      │ │ │ │ -open({timeout,open}, lock, Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {next_state,locked,Data};
      │ │ │ │ -open(cast, {button,_}, Data) ->
      │ │ │ │ -    {keep_state,Data};
      │ │ │ │ +open({timeout,open}, lock, Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {next_state,locked,Data};
      │ │ │ │ +open(cast, {button,_}, Data) ->
      │ │ │ │ +    {keep_state,Data};
      │ │ │ │  ...

      Specific generic time-outs can just as state time-outs │ │ │ │ be restarted or canceled by setting it to a new time or infinity.

      In this particular case we do not need to cancel the time-out since │ │ │ │ the time-out event is the only possible reason to do a state change │ │ │ │ from open to locked.

      Instead of bothering with when to cancel a time-out, a late time-out event │ │ │ │ can be handled by ignoring it if it arrives in a state │ │ │ │ where it is known to be late.

      You can restart, cancel, or update a generic time-out. │ │ │ │ See section Time-Outs for details.

      │ │ │ │ @@ -774,32 +774,32 @@ │ │ │ │

      The most versatile way to handle time-outs is to use Erlang Timers; see │ │ │ │ erlang:start_timer/3,4. Most time-out tasks │ │ │ │ can be performed with the time-out features in gen_statem, │ │ │ │ but an example of one that cannot is if you should need the return value │ │ │ │ from erlang:cancel_timer(Tref), that is, │ │ │ │ the remaining time of the timer.

      Here is how to accomplish the state time-out in the previous example │ │ │ │ by instead using an Erlang Timer:

      ...
      │ │ │ │ -locked(
      │ │ │ │ -  cast, {button,Button},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +locked(
      │ │ │ │ +  cast, {button,Button},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │  ...
      │ │ │ │      if
      │ │ │ │          NewButtons =:= Code -> % Correct
      │ │ │ │ -	    do_unlock(),
      │ │ │ │ +	    do_unlock(),
      │ │ │ │  	    Tref =
      │ │ │ │ -                 erlang:start_timer(
      │ │ │ │ -                     10_000, self(), lock), % Time in milliseconds
      │ │ │ │ -            {next_state, open, Data#{buttons := [], timer => Tref}};
      │ │ │ │ +                 erlang:start_timer(
      │ │ │ │ +                     10_000, self(), lock), % Time in milliseconds
      │ │ │ │ +            {next_state, open, Data#{buttons := [], timer => Tref}};
      │ │ │ │  ...
      │ │ │ │  
      │ │ │ │ -open(info, {timeout,Tref,lock}, #{timer := Tref} = Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {next_state,locked,maps:remove(timer, Data)};
      │ │ │ │ -open(cast, {button,_}, Data) ->
      │ │ │ │ -    {keep_state,Data};
      │ │ │ │ +open(info, {timeout,Tref,lock}, #{timer := Tref} = Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {next_state,locked,maps:remove(timer, Data)};
      │ │ │ │ +open(cast, {button,_}, Data) ->
      │ │ │ │ +    {keep_state,Data};
      │ │ │ │  ...

      Removing the timer key from the map when we do a state change to locked │ │ │ │ is not strictly necessary since we can only get into state open │ │ │ │ with an updated timer map value. But it can be nice to not have │ │ │ │ outdated values in the state Data.

      If you need to cancel a timer because of some other event, you can use │ │ │ │ erlang:cancel_timer(Tref). Note that no time-out │ │ │ │ message will arrive after this (because the timer has been │ │ │ │ explicitly canceled), unless you have already postponed one earlier │ │ │ │ @@ -815,16 +815,16 @@ │ │ │ │ Postponing Events │ │ │ │

      │ │ │ │

      If you want to ignore a particular event in the current state and handle it │ │ │ │ in a future state, you can postpone the event. A postponed event │ │ │ │ is retried after a state change, that is, OldState =/= NewState.

      Postponing is ordered by the │ │ │ │ transition action postpone.

      In this example, instead of ignoring button events while in the open state, │ │ │ │ we can postpone them handle them later in the locked state:

      ...
      │ │ │ │ -open(cast, {button,_}, Data) ->
      │ │ │ │ -    {keep_state,Data,[postpone]};
      │ │ │ │ +open(cast, {button,_}, Data) ->
      │ │ │ │ +    {keep_state,Data,[postpone]};
      │ │ │ │  ...

      Since a postponed event is only retried after a state change, you have to │ │ │ │ think about where to keep a state data item. You can keep it in the server │ │ │ │ Data or in the State itself, for example by having two more or less │ │ │ │ identical states to keep a boolean value, or by using a complex state (see │ │ │ │ section Complex State) with │ │ │ │ callback mode │ │ │ │ handle_event_function. If a change │ │ │ │ @@ -845,55 +845,55 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Selective Receive │ │ │ │ │ │ │ │

      Erlang's selective receive statement is often used to describe simple state │ │ │ │ machine examples in straightforward Erlang code. The following is a possible │ │ │ │ -implementation of the first example:

      -module(code_lock).
      │ │ │ │ --define(NAME, code_lock_1).
      │ │ │ │ --export([start_link/1,button/1]).
      │ │ │ │ -
      │ │ │ │ -start_link(Code) ->
      │ │ │ │ -    spawn(
      │ │ │ │ -      fun () ->
      │ │ │ │ -	      true = register(?NAME, self()),
      │ │ │ │ -	      do_lock(),
      │ │ │ │ -	      locked(Code, length(Code), [])
      │ │ │ │ -      end).
      │ │ │ │ +implementation of the first example:

      -module(code_lock).
      │ │ │ │ +-define(NAME, code_lock_1).
      │ │ │ │ +-export([start_link/1,button/1]).
      │ │ │ │ +
      │ │ │ │ +start_link(Code) ->
      │ │ │ │ +    spawn(
      │ │ │ │ +      fun () ->
      │ │ │ │ +	      true = register(?NAME, self()),
      │ │ │ │ +	      do_lock(),
      │ │ │ │ +	      locked(Code, length(Code), [])
      │ │ │ │ +      end).
      │ │ │ │  
      │ │ │ │ -button(Button) ->
      │ │ │ │ -    ?NAME ! {button,Button}.
      locked(Code, Length, Buttons) ->
      │ │ │ │ +button(Button) ->
      │ │ │ │ +    ?NAME ! {button,Button}.
      locked(Code, Length, Buttons) ->
      │ │ │ │      receive
      │ │ │ │ -        {button,Button} ->
      │ │ │ │ +        {button,Button} ->
      │ │ │ │              NewButtons =
      │ │ │ │                  if
      │ │ │ │ -                    length(Buttons) < Length ->
      │ │ │ │ +                    length(Buttons) < Length ->
      │ │ │ │                          Buttons;
      │ │ │ │                      true ->
      │ │ │ │ -                        tl(Buttons)
      │ │ │ │ -                end ++ [Button],
      │ │ │ │ +                        tl(Buttons)
      │ │ │ │ +                end ++ [Button],
      │ │ │ │              if
      │ │ │ │                  NewButtons =:= Code -> % Correct
      │ │ │ │ -                    do_unlock(),
      │ │ │ │ -		    open(Code, Length);
      │ │ │ │ +                    do_unlock(),
      │ │ │ │ +		    open(Code, Length);
      │ │ │ │                  true -> % Incomplete | Incorrect
      │ │ │ │ -                    locked(Code, Length, NewButtons)
      │ │ │ │ +                    locked(Code, Length, NewButtons)
      │ │ │ │              end
      │ │ │ │ -    end.
      open(Code, Length) ->
      │ │ │ │ +    end.
      open(Code, Length) ->
      │ │ │ │      receive
      │ │ │ │      after 10_000 -> % Time in milliseconds
      │ │ │ │ -	    do_lock(),
      │ │ │ │ -	    locked(Code, Length, [])
      │ │ │ │ +	    do_lock(),
      │ │ │ │ +	    locked(Code, Length, [])
      │ │ │ │      end.
      │ │ │ │  
      │ │ │ │ -do_lock() ->
      │ │ │ │ -    io:format("Locked~n", []).
      │ │ │ │ -do_unlock() ->
      │ │ │ │ -    io:format("Open~n", []).

      The selective receive in this case causes open to implicitly postpone any │ │ │ │ +do_lock() -> │ │ │ │ + io:format("Locked~n", []). │ │ │ │ +do_unlock() -> │ │ │ │ + io:format("Open~n", []).

      The selective receive in this case causes open to implicitly postpone any │ │ │ │ events to the locked state.

      A catch-all receive should never be used from a gen_statem behaviour │ │ │ │ (or from any gen_* behaviour), as the receive statement is within │ │ │ │ the gen_* engine itself. sys-compatible behaviours must respond to │ │ │ │ system messages and therefore do that in their engine receive loop, │ │ │ │ passing non-system messages to the callback module. Using a catch-all │ │ │ │ receive can result in system messages being discarded, which in turn │ │ │ │ can lead to unexpected behaviour. If a selective receive must be used, │ │ │ │ @@ -916,40 +916,40 @@ │ │ │ │ section), especially if only one or a few states have state enter actions, │ │ │ │ this is a perfect use case for the built in │ │ │ │ state enter calls.

      You return a list containing state_enter from your │ │ │ │ callback_mode/0 function and the │ │ │ │ gen_statem engine will call your state callback once with an event │ │ │ │ (enter, OldState, ...) whenever it does a state change. Then you │ │ │ │ just need to handle these event-like calls in all states.

      ...
      │ │ │ │ -init(Code) ->
      │ │ │ │ -    process_flag(trap_exit, true),
      │ │ │ │ -    Data = #{code => Code, length = length(Code)},
      │ │ │ │ -    {ok, locked, Data}.
      │ │ │ │ -
      │ │ │ │ -callback_mode() ->
      │ │ │ │ -    [state_functions,state_enter].
      │ │ │ │ -
      │ │ │ │ -locked(enter, _OldState, Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {keep_state,Data#{buttons => []}};
      │ │ │ │ -locked(
      │ │ │ │ -  cast, {button,Button},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +init(Code) ->
      │ │ │ │ +    process_flag(trap_exit, true),
      │ │ │ │ +    Data = #{code => Code, length = length(Code)},
      │ │ │ │ +    {ok, locked, Data}.
      │ │ │ │ +
      │ │ │ │ +callback_mode() ->
      │ │ │ │ +    [state_functions,state_enter].
      │ │ │ │ +
      │ │ │ │ +locked(enter, _OldState, Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {keep_state,Data#{buttons => []}};
      │ │ │ │ +locked(
      │ │ │ │ +  cast, {button,Button},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │  ...
      │ │ │ │      if
      │ │ │ │          NewButtons =:= Code -> % Correct
      │ │ │ │ -            {next_state, open, Data};
      │ │ │ │ +            {next_state, open, Data};
      │ │ │ │  ...
      │ │ │ │  
      │ │ │ │ -open(enter, _OldState, _Data) ->
      │ │ │ │ -    do_unlock(),
      │ │ │ │ -    {keep_state_and_data,
      │ │ │ │ -     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ -open(state_timeout, lock, Data) ->
      │ │ │ │ -    {next_state, locked, Data};
      │ │ │ │ +open(enter, _OldState, _Data) ->
      │ │ │ │ +    do_unlock(),
      │ │ │ │ +    {keep_state_and_data,
      │ │ │ │ +     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ +open(state_timeout, lock, Data) ->
      │ │ │ │ +    {next_state, locked, Data};
      │ │ │ │  ...

      You can repeat the state enter code by returning one of │ │ │ │ {repeat_state, ...},{repeat_state_and_data, _}, │ │ │ │ or repeat_state_and_data that otherwise behaves exactly like their │ │ │ │ keep_state siblings. See the type │ │ │ │ state_callback_result() │ │ │ │ in the Reference Manual.

      │ │ │ │ │ │ │ │ @@ -971,44 +971,44 @@ │ │ │ │ to dispatch pre-processed events as internal events to the main state │ │ │ │ machine.

      Using internal events also can make it easier to synchronize the state │ │ │ │ machines.

      A variant of this is to use a complex state with │ │ │ │ one state callback, modeling the state │ │ │ │ with, for example, a tuple {MainFSMState, SubFSMState}.

      To illustrate this we make up an example where the buttons instead generate │ │ │ │ down and up (press and release) events, and the lock responds │ │ │ │ to an up event only after the corresponding down event.

      ...
      │ │ │ │ --export([down/1, up/1]).
      │ │ │ │ +-export([down/1, up/1]).
      │ │ │ │  ...
      │ │ │ │ -down(Button) ->
      │ │ │ │ -    gen_statem:cast(?NAME, {down,Button}).
      │ │ │ │ +down(Button) ->
      │ │ │ │ +    gen_statem:cast(?NAME, {down,Button}).
      │ │ │ │  
      │ │ │ │ -up(Button) ->
      │ │ │ │ -    gen_statem:cast(?NAME, {up,Button}).
      │ │ │ │ +up(Button) ->
      │ │ │ │ +    gen_statem:cast(?NAME, {up,Button}).
      │ │ │ │  
      │ │ │ │  ...
      │ │ │ │  
      │ │ │ │ -locked(enter, _OldState, Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {keep_state,Data#{buttons => []}};
      │ │ │ │ -locked(
      │ │ │ │ -  internal, {button,Button},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ -...
      handle_common(cast, {down,Button}, Data) ->
      │ │ │ │ -    {keep_state, Data#{button => Button}};
      │ │ │ │ -handle_common(cast, {up,Button}, Data) ->
      │ │ │ │ +locked(enter, _OldState, Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {keep_state,Data#{buttons => []}};
      │ │ │ │ +locked(
      │ │ │ │ +  internal, {button,Button},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +...
      handle_common(cast, {down,Button}, Data) ->
      │ │ │ │ +    {keep_state, Data#{button => Button}};
      │ │ │ │ +handle_common(cast, {up,Button}, Data) ->
      │ │ │ │      case Data of
      │ │ │ │ -        #{button := Button} ->
      │ │ │ │ -            {keep_state,maps:remove(button, Data),
      │ │ │ │ -             [{next_event,internal,{button,Button}}]};
      │ │ │ │ -        #{} ->
      │ │ │ │ +        #{button := Button} ->
      │ │ │ │ +            {keep_state,maps:remove(button, Data),
      │ │ │ │ +             [{next_event,internal,{button,Button}}]};
      │ │ │ │ +        #{} ->
      │ │ │ │              keep_state_and_data
      │ │ │ │      end;
      │ │ │ │  ...
      │ │ │ │  
      │ │ │ │ -open(internal, {button,_}, Data) ->
      │ │ │ │ -    {keep_state,Data,[postpone]};
      │ │ │ │ +open(internal, {button,_}, Data) ->
      │ │ │ │ +    {keep_state,Data,[postpone]};
      │ │ │ │  ...

      If you start this program with code_lock:start([17]) you can unlock with │ │ │ │ code_lock:down(17), code_lock:up(17).

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Example Revisited │ │ │ │

      │ │ │ │ @@ -1036,152 +1036,152 @@ │ │ │ │ Also, the state diagram does not show that the code_length/0 call │ │ │ │ must be handled in every state.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Callback Mode: state_functions │ │ │ │

      │ │ │ │ -

      Using state functions:

      -module(code_lock).
      │ │ │ │ --behaviour(gen_statem).
      │ │ │ │ --define(NAME, code_lock_2).
      │ │ │ │ +

      Using state functions:

      -module(code_lock).
      │ │ │ │ +-behaviour(gen_statem).
      │ │ │ │ +-define(NAME, code_lock_2).
      │ │ │ │  
      │ │ │ │ --export([start_link/1,stop/0]).
      │ │ │ │ --export([down/1,up/1,code_length/0]).
      │ │ │ │ --export([init/1,callback_mode/0,terminate/3]).
      │ │ │ │ --export([locked/3,open/3]).
      │ │ │ │ -
      │ │ │ │ -start_link(Code) ->
      │ │ │ │ -    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
      │ │ │ │ -stop() ->
      │ │ │ │ -    gen_statem:stop(?NAME).
      │ │ │ │ -
      │ │ │ │ -down(Button) ->
      │ │ │ │ -    gen_statem:cast(?NAME, {down,Button}).
      │ │ │ │ -up(Button) ->
      │ │ │ │ -    gen_statem:cast(?NAME, {up,Button}).
      │ │ │ │ -code_length() ->
      │ │ │ │ -    gen_statem:call(?NAME, code_length).
      init(Code) ->
      │ │ │ │ -    process_flag(trap_exit, true),
      │ │ │ │ -    Data = #{code => Code, length => length(Code), buttons => []},
      │ │ │ │ -    {ok, locked, Data}.
      │ │ │ │ +-export([start_link/1,stop/0]).
      │ │ │ │ +-export([down/1,up/1,code_length/0]).
      │ │ │ │ +-export([init/1,callback_mode/0,terminate/3]).
      │ │ │ │ +-export([locked/3,open/3]).
      │ │ │ │ +
      │ │ │ │ +start_link(Code) ->
      │ │ │ │ +    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
      │ │ │ │ +stop() ->
      │ │ │ │ +    gen_statem:stop(?NAME).
      │ │ │ │ +
      │ │ │ │ +down(Button) ->
      │ │ │ │ +    gen_statem:cast(?NAME, {down,Button}).
      │ │ │ │ +up(Button) ->
      │ │ │ │ +    gen_statem:cast(?NAME, {up,Button}).
      │ │ │ │ +code_length() ->
      │ │ │ │ +    gen_statem:call(?NAME, code_length).
      init(Code) ->
      │ │ │ │ +    process_flag(trap_exit, true),
      │ │ │ │ +    Data = #{code => Code, length => length(Code), buttons => []},
      │ │ │ │ +    {ok, locked, Data}.
      │ │ │ │  
      │ │ │ │ -callback_mode() ->
      │ │ │ │ -    [state_functions,state_enter].
      │ │ │ │ +callback_mode() ->
      │ │ │ │ +    [state_functions,state_enter].
      │ │ │ │  
      │ │ │ │ --define(HANDLE_COMMON,
      │ │ │ │ -    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, D)).
      │ │ │ │ +-define(HANDLE_COMMON,
      │ │ │ │ +    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, D)).
      │ │ │ │  %%
      │ │ │ │ -handle_common(cast, {down,Button}, Data) ->
      │ │ │ │ -    {keep_state, Data#{button => Button}};
      │ │ │ │ -handle_common(cast, {up,Button}, Data) ->
      │ │ │ │ +handle_common(cast, {down,Button}, Data) ->
      │ │ │ │ +    {keep_state, Data#{button => Button}};
      │ │ │ │ +handle_common(cast, {up,Button}, Data) ->
      │ │ │ │      case Data of
      │ │ │ │ -        #{button := Button} ->
      │ │ │ │ -            {keep_state, maps:remove(button, Data),
      │ │ │ │ -             [{next_event,internal,{button,Button}}]};
      │ │ │ │ -        #{} ->
      │ │ │ │ +        #{button := Button} ->
      │ │ │ │ +            {keep_state, maps:remove(button, Data),
      │ │ │ │ +             [{next_event,internal,{button,Button}}]};
      │ │ │ │ +        #{} ->
      │ │ │ │              keep_state_and_data
      │ │ │ │      end;
      │ │ │ │ -handle_common({call,From}, code_length, #{code := Code}) ->
      │ │ │ │ -    {keep_state_and_data,
      │ │ │ │ -     [{reply,From,length(Code)}]}.
      locked(enter, _OldState, Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {keep_state, Data#{buttons := []}};
      │ │ │ │ -locked(state_timeout, button, Data) ->
      │ │ │ │ -    {keep_state, Data#{buttons := []}};
      │ │ │ │ -locked(
      │ │ │ │ -  internal, {button,Button},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +handle_common({call,From}, code_length, #{code := Code}) ->
      │ │ │ │ +    {keep_state_and_data,
      │ │ │ │ +     [{reply,From,length(Code)}]}.
      locked(enter, _OldState, Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {keep_state, Data#{buttons := []}};
      │ │ │ │ +locked(state_timeout, button, Data) ->
      │ │ │ │ +    {keep_state, Data#{buttons := []}};
      │ │ │ │ +locked(
      │ │ │ │ +  internal, {button,Button},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │      NewButtons =
      │ │ │ │          if
      │ │ │ │ -            length(Buttons) < Length ->
      │ │ │ │ +            length(Buttons) < Length ->
      │ │ │ │                  Buttons;
      │ │ │ │              true ->
      │ │ │ │ -                tl(Buttons)
      │ │ │ │ -        end ++ [Button],
      │ │ │ │ +                tl(Buttons)
      │ │ │ │ +        end ++ [Button],
      │ │ │ │      if
      │ │ │ │          NewButtons =:= Code -> % Correct
      │ │ │ │ -            {next_state, open, Data};
      │ │ │ │ +            {next_state, open, Data};
      │ │ │ │  	true -> % Incomplete | Incorrect
      │ │ │ │ -            {keep_state, Data#{buttons := NewButtons},
      │ │ │ │ -             [{state_timeout,30_000,button}]} % Time in milliseconds
      │ │ │ │ +            {keep_state, Data#{buttons := NewButtons},
      │ │ │ │ +             [{state_timeout,30_000,button}]} % Time in milliseconds
      │ │ │ │      end;
      │ │ │ │ -?HANDLE_COMMON.
      open(enter, _OldState, _Data) ->
      │ │ │ │ -    do_unlock(),
      │ │ │ │ -    {keep_state_and_data,
      │ │ │ │ -     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ -open(state_timeout, lock, Data) ->
      │ │ │ │ -    {next_state, locked, Data};
      │ │ │ │ -open(internal, {button,_}, _) ->
      │ │ │ │ -    {keep_state_and_data, [postpone]};
      │ │ │ │ +?HANDLE_COMMON.
      open(enter, _OldState, _Data) ->
      │ │ │ │ +    do_unlock(),
      │ │ │ │ +    {keep_state_and_data,
      │ │ │ │ +     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ +open(state_timeout, lock, Data) ->
      │ │ │ │ +    {next_state, locked, Data};
      │ │ │ │ +open(internal, {button,_}, _) ->
      │ │ │ │ +    {keep_state_and_data, [postpone]};
      │ │ │ │  ?HANDLE_COMMON.
      │ │ │ │  
      │ │ │ │ -do_lock() ->
      │ │ │ │ -    io:format("Locked~n", []).
      │ │ │ │ -do_unlock() ->
      │ │ │ │ -    io:format("Open~n", []).
      │ │ │ │ +do_lock() ->
      │ │ │ │ +    io:format("Locked~n", []).
      │ │ │ │ +do_unlock() ->
      │ │ │ │ +    io:format("Open~n", []).
      │ │ │ │  
      │ │ │ │ -terminate(_Reason, State, _Data) ->
      │ │ │ │ -    State =/= locked andalso do_lock(),
      │ │ │ │ +terminate(_Reason, State, _Data) ->
      │ │ │ │ +    State =/= locked andalso do_lock(),
      │ │ │ │      ok.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Callback Mode: handle_event_function │ │ │ │

      │ │ │ │

      This section describes what to change in the example to use one │ │ │ │ handle_event/4 function. The previously used approach to first branch │ │ │ │ depending on event does not work that well here because of │ │ │ │ -the state enter calls, so this example first branches depending on state:

      -export([handle_event/4]).
      callback_mode() ->
      │ │ │ │ -    [handle_event_function,state_enter].
      %%
      │ │ │ │ +the state enter calls, so this example first branches depending on state:

      -export([handle_event/4]).
      callback_mode() ->
      │ │ │ │ +    [handle_event_function,state_enter].
      %%
      │ │ │ │  %% State: locked
      │ │ │ │ -handle_event(enter, _OldState, locked, Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {keep_state, Data#{buttons := []}};
      │ │ │ │ -handle_event(state_timeout, button, locked, Data) ->
      │ │ │ │ -    {keep_state, Data#{buttons := []}};
      │ │ │ │ -handle_event(
      │ │ │ │ -  internal, {button,Button}, locked,
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +handle_event(enter, _OldState, locked, Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {keep_state, Data#{buttons := []}};
      │ │ │ │ +handle_event(state_timeout, button, locked, Data) ->
      │ │ │ │ +    {keep_state, Data#{buttons := []}};
      │ │ │ │ +handle_event(
      │ │ │ │ +  internal, {button,Button}, locked,
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │      NewButtons =
      │ │ │ │          if
      │ │ │ │ -            length(Buttons) < Length ->
      │ │ │ │ +            length(Buttons) < Length ->
      │ │ │ │                  Buttons;
      │ │ │ │              true ->
      │ │ │ │ -                tl(Buttons)
      │ │ │ │ -        end ++ [Button],
      │ │ │ │ +                tl(Buttons)
      │ │ │ │ +        end ++ [Button],
      │ │ │ │      if
      │ │ │ │          NewButtons =:= Code -> % Correct
      │ │ │ │ -            {next_state, open, Data};
      │ │ │ │ +            {next_state, open, Data};
      │ │ │ │  	true -> % Incomplete | Incorrect
      │ │ │ │ -            {keep_state, Data#{buttons := NewButtons},
      │ │ │ │ -             [{state_timeout,30_000,button}]} % Time in milliseconds
      │ │ │ │ +            {keep_state, Data#{buttons := NewButtons},
      │ │ │ │ +             [{state_timeout,30_000,button}]} % Time in milliseconds
      │ │ │ │      end;
      %%
      │ │ │ │  %% State: open
      │ │ │ │ -handle_event(enter, _OldState, open, _Data) ->
      │ │ │ │ -    do_unlock(),
      │ │ │ │ -    {keep_state_and_data,
      │ │ │ │ -     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ -handle_event(state_timeout, lock, open, Data) ->
      │ │ │ │ -    {next_state, locked, Data};
      │ │ │ │ -handle_event(internal, {button,_}, open, _) ->
      │ │ │ │ -    {keep_state_and_data,[postpone]};
      %% Common events
      │ │ │ │ -handle_event(cast, {down,Button}, _State, Data) ->
      │ │ │ │ -    {keep_state, Data#{button => Button}};
      │ │ │ │ -handle_event(cast, {up,Button}, _State, Data) ->
      │ │ │ │ +handle_event(enter, _OldState, open, _Data) ->
      │ │ │ │ +    do_unlock(),
      │ │ │ │ +    {keep_state_and_data,
      │ │ │ │ +     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ +handle_event(state_timeout, lock, open, Data) ->
      │ │ │ │ +    {next_state, locked, Data};
      │ │ │ │ +handle_event(internal, {button,_}, open, _) ->
      │ │ │ │ +    {keep_state_and_data,[postpone]};
      %% Common events
      │ │ │ │ +handle_event(cast, {down,Button}, _State, Data) ->
      │ │ │ │ +    {keep_state, Data#{button => Button}};
      │ │ │ │ +handle_event(cast, {up,Button}, _State, Data) ->
      │ │ │ │      case Data of
      │ │ │ │ -        #{button := Button} ->
      │ │ │ │ -            {keep_state, maps:remove(button, Data),
      │ │ │ │ -             [{next_event,internal,{button,Button}},
      │ │ │ │ -              {state_timeout,30_000,button}]}; % Time in milliseconds
      │ │ │ │ -        #{} ->
      │ │ │ │ +        #{button := Button} ->
      │ │ │ │ +            {keep_state, maps:remove(button, Data),
      │ │ │ │ +             [{next_event,internal,{button,Button}},
      │ │ │ │ +              {state_timeout,30_000,button}]}; % Time in milliseconds
      │ │ │ │ +        #{} ->
      │ │ │ │              keep_state_and_data
      │ │ │ │      end;
      │ │ │ │ -handle_event({call,From}, code_length, _State, #{length := Length}) ->
      │ │ │ │ -    {keep_state_and_data,
      │ │ │ │ -     [{reply,From,Length}]}.

      Notice that postponing buttons from the open state to the locked state │ │ │ │ +handle_event({call,From}, code_length, _State, #{length := Length}) -> │ │ │ │ + {keep_state_and_data, │ │ │ │ + [{reply,From,Length}]}.

      Notice that postponing buttons from the open state to the locked state │ │ │ │ seems like a strange thing to do for a code lock, but it at least │ │ │ │ illustrates event postponing.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Filter the State │ │ │ │

      │ │ │ │ @@ -1191,30 +1191,30 @@ │ │ │ │ and which digits that remain to unlock.

      This state data can be regarded as sensitive, and maybe not what you want │ │ │ │ in the error log because of some unpredictable event.

      Another reason to filter the state can be that the state is too large to print, │ │ │ │ as it fills the error log with uninteresting details.

      To avoid this, you can format the internal state that gets in the error log │ │ │ │ and gets returned from sys:get_status/1,2 │ │ │ │ by implementing function │ │ │ │ Module:format_status/2, │ │ │ │ for example like this:

      ...
      │ │ │ │ --export([init/1,terminate/3,format_status/2]).
      │ │ │ │ +-export([init/1,terminate/3,format_status/2]).
      │ │ │ │  ...
      │ │ │ │  
      │ │ │ │ -format_status(Opt, [_PDict,State,Data]) ->
      │ │ │ │ +format_status(Opt, [_PDict,State,Data]) ->
      │ │ │ │      StateData =
      │ │ │ │ -	{State,
      │ │ │ │ -	 maps:filter(
      │ │ │ │ -	   fun (code, _) -> false;
      │ │ │ │ -	       (_, _) -> true
      │ │ │ │ +	{State,
      │ │ │ │ +	 maps:filter(
      │ │ │ │ +	   fun (code, _) -> false;
      │ │ │ │ +	       (_, _) -> true
      │ │ │ │  	   end,
      │ │ │ │ -	   Data)},
      │ │ │ │ +	   Data)},
      │ │ │ │      case Opt of
      │ │ │ │  	terminate ->
      │ │ │ │  	    StateData;
      │ │ │ │  	normal ->
      │ │ │ │ -	    [{data,[{"State",StateData}]}]
      │ │ │ │ +	    [{data,[{"State",StateData}]}]
      │ │ │ │      end.

      It is not mandatory to implement a │ │ │ │ Module:format_status/2 function. │ │ │ │ If you do not, a default implementation is used that does the same │ │ │ │ as this example function without filtering the Data term, that is, │ │ │ │ StateData = {State, Data}, in this example containing sensitive information.

      │ │ │ │ │ │ │ │ │ │ │ │ @@ -1227,104 +1227,104 @@ │ │ │ │ like a tuple.

      One reason to use this is when you have a state item that when changed │ │ │ │ should cancel the state time-out, or one that affects │ │ │ │ the event handling in combination with postponing events. We will go for │ │ │ │ the latter and complicate the previous example by introducing │ │ │ │ a configurable lock button (this is the state item in question), │ │ │ │ which in the open state immediately locks the door, and an API function │ │ │ │ set_lock_button/1 to set the lock button.

      Suppose now that we call set_lock_button while the door is open, │ │ │ │ -and we have already postponed a button event that was the new lock button:

      1> code_lock:start_link([a,b,c], x).
      │ │ │ │ -{ok,<0.666.0>}
      │ │ │ │ -2> code_lock:button(a).
      │ │ │ │ +and we have already postponed a button event that was the new lock button:

      1> code_lock:start_link([a,b,c], x).
      │ │ │ │ +{ok,<0.666.0>}
      │ │ │ │ +2> code_lock:button(a).
      │ │ │ │  ok
      │ │ │ │ -3> code_lock:button(b).
      │ │ │ │ +3> code_lock:button(b).
      │ │ │ │  ok
      │ │ │ │ -4> code_lock:button(c).
      │ │ │ │ +4> code_lock:button(c).
      │ │ │ │  ok
      │ │ │ │  Open
      │ │ │ │ -5> code_lock:button(y).
      │ │ │ │ +5> code_lock:button(y).
      │ │ │ │  ok
      │ │ │ │ -6> code_lock:set_lock_button(y).
      │ │ │ │ +6> code_lock:set_lock_button(y).
      │ │ │ │  x
      │ │ │ │  % What should happen here?  Immediate lock or nothing?

      We could say that the button was pressed too early so it should not be │ │ │ │ recognized as the lock button. Or we can make the lock button part of │ │ │ │ the state so when we then change the lock button in the locked state, │ │ │ │ the change becomes a state change and all postponed events are retried, │ │ │ │ therefore the lock is immediately locked!

      We define the state as {StateName, LockButton}, where StateName │ │ │ │ -is as before and LockButton is the current lock button:

      -module(code_lock).
      │ │ │ │ --behaviour(gen_statem).
      │ │ │ │ --define(NAME, code_lock_3).
      │ │ │ │ +is as before and LockButton is the current lock button:

      -module(code_lock).
      │ │ │ │ +-behaviour(gen_statem).
      │ │ │ │ +-define(NAME, code_lock_3).
      │ │ │ │  
      │ │ │ │ --export([start_link/2,stop/0]).
      │ │ │ │ --export([button/1,set_lock_button/1]).
      │ │ │ │ --export([init/1,callback_mode/0,terminate/3]).
      │ │ │ │ --export([handle_event/4]).
      │ │ │ │ -
      │ │ │ │ -start_link(Code, LockButton) ->
      │ │ │ │ -    gen_statem:start_link(
      │ │ │ │ -        {local,?NAME}, ?MODULE, {Code,LockButton}, []).
      │ │ │ │ -stop() ->
      │ │ │ │ -    gen_statem:stop(?NAME).
      │ │ │ │ -
      │ │ │ │ -button(Button) ->
      │ │ │ │ -    gen_statem:cast(?NAME, {button,Button}).
      │ │ │ │ -set_lock_button(LockButton) ->
      │ │ │ │ -    gen_statem:call(?NAME, {set_lock_button,LockButton}).
      init({Code,LockButton}) ->
      │ │ │ │ -    process_flag(trap_exit, true),
      │ │ │ │ -    Data = #{code => Code, length => length(Code), buttons => []},
      │ │ │ │ -    {ok, {locked,LockButton}, Data}.
      │ │ │ │ +-export([start_link/2,stop/0]).
      │ │ │ │ +-export([button/1,set_lock_button/1]).
      │ │ │ │ +-export([init/1,callback_mode/0,terminate/3]).
      │ │ │ │ +-export([handle_event/4]).
      │ │ │ │ +
      │ │ │ │ +start_link(Code, LockButton) ->
      │ │ │ │ +    gen_statem:start_link(
      │ │ │ │ +        {local,?NAME}, ?MODULE, {Code,LockButton}, []).
      │ │ │ │ +stop() ->
      │ │ │ │ +    gen_statem:stop(?NAME).
      │ │ │ │ +
      │ │ │ │ +button(Button) ->
      │ │ │ │ +    gen_statem:cast(?NAME, {button,Button}).
      │ │ │ │ +set_lock_button(LockButton) ->
      │ │ │ │ +    gen_statem:call(?NAME, {set_lock_button,LockButton}).
      init({Code,LockButton}) ->
      │ │ │ │ +    process_flag(trap_exit, true),
      │ │ │ │ +    Data = #{code => Code, length => length(Code), buttons => []},
      │ │ │ │ +    {ok, {locked,LockButton}, Data}.
      │ │ │ │  
      │ │ │ │ -callback_mode() ->
      │ │ │ │ -    [handle_event_function,state_enter].
      │ │ │ │ +callback_mode() ->
      │ │ │ │ +    [handle_event_function,state_enter].
      │ │ │ │  
      │ │ │ │  %% State: locked
      │ │ │ │ -handle_event(enter, _OldState, {locked,_}, Data) ->
      │ │ │ │ -    do_lock(),
      │ │ │ │ -    {keep_state, Data#{buttons := []}};
      │ │ │ │ -handle_event(state_timeout, button, {locked,_}, Data) ->
      │ │ │ │ -    {keep_state, Data#{buttons := []}};
      │ │ │ │ -handle_event(
      │ │ │ │ -  cast, {button,Button}, {locked,LockButton},
      │ │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │ +handle_event(enter, _OldState, {locked,_}, Data) ->
      │ │ │ │ +    do_lock(),
      │ │ │ │ +    {keep_state, Data#{buttons := []}};
      │ │ │ │ +handle_event(state_timeout, button, {locked,_}, Data) ->
      │ │ │ │ +    {keep_state, Data#{buttons := []}};
      │ │ │ │ +handle_event(
      │ │ │ │ +  cast, {button,Button}, {locked,LockButton},
      │ │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
      │ │ │ │      NewButtons =
      │ │ │ │          if
      │ │ │ │ -            length(Buttons) < Length ->
      │ │ │ │ +            length(Buttons) < Length ->
      │ │ │ │                  Buttons;
      │ │ │ │              true ->
      │ │ │ │ -                tl(Buttons)
      │ │ │ │ -        end ++ [Button],
      │ │ │ │ +                tl(Buttons)
      │ │ │ │ +        end ++ [Button],
      │ │ │ │      if
      │ │ │ │          NewButtons =:= Code -> % Correct
      │ │ │ │ -            {next_state, {open,LockButton}, Data};
      │ │ │ │ +            {next_state, {open,LockButton}, Data};
      │ │ │ │  	true -> % Incomplete | Incorrect
      │ │ │ │ -            {keep_state, Data#{buttons := NewButtons},
      │ │ │ │ -             [{state_timeout,30_000,button}]} % Time in milliseconds
      │ │ │ │ +            {keep_state, Data#{buttons := NewButtons},
      │ │ │ │ +             [{state_timeout,30_000,button}]} % Time in milliseconds
      │ │ │ │      end;
      %%
      │ │ │ │  %% State: open
      │ │ │ │ -handle_event(enter, _OldState, {open,_}, _Data) ->
      │ │ │ │ -    do_unlock(),
      │ │ │ │ -    {keep_state_and_data,
      │ │ │ │ -     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ -handle_event(state_timeout, lock, {open,LockButton}, Data) ->
      │ │ │ │ -    {next_state, {locked,LockButton}, Data};
      │ │ │ │ -handle_event(cast, {button,LockButton}, {open,LockButton}, Data) ->
      │ │ │ │ -    {next_state, {locked,LockButton}, Data};
      │ │ │ │ -handle_event(cast, {button,_}, {open,_}, _Data) ->
      │ │ │ │ -    {keep_state_and_data,[postpone]};
      %%
      │ │ │ │ +handle_event(enter, _OldState, {open,_}, _Data) ->
      │ │ │ │ +    do_unlock(),
      │ │ │ │ +    {keep_state_and_data,
      │ │ │ │ +     [{state_timeout,10_000,lock}]}; % Time in milliseconds
      │ │ │ │ +handle_event(state_timeout, lock, {open,LockButton}, Data) ->
      │ │ │ │ +    {next_state, {locked,LockButton}, Data};
      │ │ │ │ +handle_event(cast, {button,LockButton}, {open,LockButton}, Data) ->
      │ │ │ │ +    {next_state, {locked,LockButton}, Data};
      │ │ │ │ +handle_event(cast, {button,_}, {open,_}, _Data) ->
      │ │ │ │ +    {keep_state_and_data,[postpone]};
      %%
      │ │ │ │  %% Common events
      │ │ │ │ -handle_event(
      │ │ │ │ -  {call,From}, {set_lock_button,NewLockButton},
      │ │ │ │ -  {StateName,OldLockButton}, Data) ->
      │ │ │ │ -    {next_state, {StateName,NewLockButton}, Data,
      │ │ │ │ -     [{reply,From,OldLockButton}]}.
      do_lock() ->
      │ │ │ │ -    io:format("Locked~n", []).
      │ │ │ │ -do_unlock() ->
      │ │ │ │ -    io:format("Open~n", []).
      │ │ │ │ +handle_event(
      │ │ │ │ +  {call,From}, {set_lock_button,NewLockButton},
      │ │ │ │ +  {StateName,OldLockButton}, Data) ->
      │ │ │ │ +    {next_state, {StateName,NewLockButton}, Data,
      │ │ │ │ +     [{reply,From,OldLockButton}]}.
      do_lock() ->
      │ │ │ │ +    io:format("Locked~n", []).
      │ │ │ │ +do_unlock() ->
      │ │ │ │ +    io:format("Open~n", []).
      │ │ │ │  
      │ │ │ │ -terminate(_Reason, State, _Data) ->
      │ │ │ │ -    State =/= locked andalso do_lock(),
      │ │ │ │ +terminate(_Reason, State, _Data) ->
      │ │ │ │ +    State =/= locked andalso do_lock(),
      │ │ │ │      ok.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Hibernation │ │ │ │

      │ │ │ │

      If you have many servers in one node and they have some state(s) in their │ │ │ │ @@ -1333,19 +1333,19 @@ │ │ │ │ footprint of a server can be minimized by hibernating it through │ │ │ │ proc_lib:hibernate/3.

      Note

      It is rather costly to hibernate a process; see erlang:hibernate/3. It is │ │ │ │ not something you want to do after every event.

      We can in this example hibernate in the {open, _} state, │ │ │ │ because what normally occurs in that state is that the state time-out │ │ │ │ after a while triggers a transition to {locked, _}:

      ...
      │ │ │ │  %%
      │ │ │ │  %% State: open
      │ │ │ │ -handle_event(enter, _OldState, {open,_}, _Data) ->
      │ │ │ │ -    do_unlock(),
      │ │ │ │ -    {keep_state_and_data,
      │ │ │ │ -     [{state_timeout,10_000,lock}, % Time in milliseconds
      │ │ │ │ -      hibernate]};
      │ │ │ │ +handle_event(enter, _OldState, {open,_}, _Data) ->
      │ │ │ │ +    do_unlock(),
      │ │ │ │ +    {keep_state_and_data,
      │ │ │ │ +     [{state_timeout,10_000,lock}, % Time in milliseconds
      │ │ │ │ +      hibernate]};
      │ │ │ │  ...

      The atom hibernate in the action list on the │ │ │ │ last line when entering the {open, _} state is the only change. If any event │ │ │ │ arrives in the {open, _}, state, we do not bother to rehibernate, │ │ │ │ so the server stays awake after any event.

      To change that we would need to insert action hibernate in more places. │ │ │ │ For example, the state-independent set_lock_button operation │ │ │ │ would have to use hibernate but only in the {open, _} state, │ │ │ │ which would clutter the code.

      Another not uncommon scenario is to use the │ │ │ ├── OEBPS/spec_proc.xhtml │ │ │ │ @@ -28,72 +28,72 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Simple Debugging │ │ │ │

      │ │ │ │

      The sys module has functions for simple debugging of processes implemented │ │ │ │ using behaviours. The code_lock example from │ │ │ │ -gen_statem Behaviour is used to illustrate this:

      Erlang/OTP 27 [erts-15.0] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
      │ │ │ │ +gen_statem Behaviour is used to illustrate this:

      Erlang/OTP 27 [erts-15.0] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
      │ │ │ │  
      │ │ │ │ -Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
      │ │ │ │ -1> code_lock:start_link([1,2,3,4]).
      │ │ │ │ +Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
      │ │ │ │ +1> code_lock:start_link([1,2,3,4]).
      │ │ │ │  Lock
      │ │ │ │ -{ok,<0.90.0>}
      │ │ │ │ -2> sys:statistics(code_lock, true).
      │ │ │ │ +{ok,<0.90.0>}
      │ │ │ │ +2> sys:statistics(code_lock, true).
      │ │ │ │  ok
      │ │ │ │ -3> sys:trace(code_lock, true).
      │ │ │ │ +3> sys:trace(code_lock, true).
      │ │ │ │  ok
      │ │ │ │ -4> code_lock:button(1).
      │ │ │ │ -*DBG* code_lock receive cast {button,1} in state locked
      │ │ │ │ +4> code_lock:button(1).
      │ │ │ │ +*DBG* code_lock receive cast {button,1} in state locked
      │ │ │ │  ok
      │ │ │ │ -*DBG* code_lock consume cast {button,1} in state locked
      │ │ │ │ -5> code_lock:button(2).
      │ │ │ │ -*DBG* code_lock receive cast {button,2} in state locked
      │ │ │ │ +*DBG* code_lock consume cast {button,1} in state locked
      │ │ │ │ +5> code_lock:button(2).
      │ │ │ │ +*DBG* code_lock receive cast {button,2} in state locked
      │ │ │ │  ok
      │ │ │ │ -*DBG* code_lock consume cast {button,2} in state locked
      │ │ │ │ -6> code_lock:button(3).
      │ │ │ │ -*DBG* code_lock receive cast {button,3} in state locked
      │ │ │ │ +*DBG* code_lock consume cast {button,2} in state locked
      │ │ │ │ +6> code_lock:button(3).
      │ │ │ │ +*DBG* code_lock receive cast {button,3} in state locked
      │ │ │ │  ok
      │ │ │ │ -*DBG* code_lock consume cast {button,3} in state locked
      │ │ │ │ -7> code_lock:button(4).
      │ │ │ │ -*DBG* code_lock receive cast {button,4} in state locked
      │ │ │ │ +*DBG* code_lock consume cast {button,3} in state locked
      │ │ │ │ +7> code_lock:button(4).
      │ │ │ │ +*DBG* code_lock receive cast {button,4} in state locked
      │ │ │ │  ok
      │ │ │ │  Unlock
      │ │ │ │ -*DBG* code_lock consume cast {button,4} in state locked => open
      │ │ │ │ -*DBG* code_lock start_timer {state_timeout,10000,lock,[]} in state open
      │ │ │ │ +*DBG* code_lock consume cast {button,4} in state locked => open
      │ │ │ │ +*DBG* code_lock start_timer {state_timeout,10000,lock,[]} in state open
      │ │ │ │  *DBG* code_lock receive state_timeout lock in state open
      │ │ │ │  Lock
      │ │ │ │  *DBG* code_lock consume state_timeout lock in state open => locked
      │ │ │ │ -8> sys:statistics(code_lock, get).
      │ │ │ │ -{ok,[{start_time,{{2024,5,3},{8,11,1}}},
      │ │ │ │ -     {current_time,{{2024,5,3},{8,11,48}}},
      │ │ │ │ -     {reductions,4098},
      │ │ │ │ -     {messages_in,5},
      │ │ │ │ -     {messages_out,0}]}
      │ │ │ │ -9> sys:statistics(code_lock, false).
      │ │ │ │ +8> sys:statistics(code_lock, get).
      │ │ │ │ +{ok,[{start_time,{{2024,5,3},{8,11,1}}},
      │ │ │ │ +     {current_time,{{2024,5,3},{8,11,48}}},
      │ │ │ │ +     {reductions,4098},
      │ │ │ │ +     {messages_in,5},
      │ │ │ │ +     {messages_out,0}]}
      │ │ │ │ +9> sys:statistics(code_lock, false).
      │ │ │ │  ok
      │ │ │ │ -10> sys:trace(code_lock, false).
      │ │ │ │ +10> sys:trace(code_lock, false).
      │ │ │ │  ok
      │ │ │ │ -11> sys:get_status(code_lock).
      │ │ │ │ -{status,<0.90.0>,
      │ │ │ │ -        {module,gen_statem},
      │ │ │ │ -        [[{'$initial_call',{code_lock,init,1}},
      │ │ │ │ -          {'$ancestors',[<0.88.0>,<0.87.0>,<0.70.0>,<0.65.0>,<0.69.0>,
      │ │ │ │ -                         <0.64.0>,kernel_sup,<0.47.0>]}],
      │ │ │ │ -         running,<0.88.0>,[],
      │ │ │ │ -         [{header,"Status for state machine code_lock"},
      │ │ │ │ -          {data,[{"Status",running},
      │ │ │ │ -                 {"Parent",<0.88.0>},
      │ │ │ │ -                 {"Modules",[code_lock]},
      │ │ │ │ -                 {"Time-outs",{0,[]}},
      │ │ │ │ -                 {"Logged Events",[]},
      │ │ │ │ -                 {"Postponed",[]}]},
      │ │ │ │ -          {data,[{"State",
      │ │ │ │ -                  {locked,#{code => [1,2,3,4],
      │ │ │ │ -                            length => 4,buttons => []}}}]}]]}

      │ │ │ │ +11> sys:get_status(code_lock). │ │ │ │ +{status,<0.90.0>, │ │ │ │ + {module,gen_statem}, │ │ │ │ + [[{'$initial_call',{code_lock,init,1}}, │ │ │ │ + {'$ancestors',[<0.88.0>,<0.87.0>,<0.70.0>,<0.65.0>,<0.69.0>, │ │ │ │ + <0.64.0>,kernel_sup,<0.47.0>]}], │ │ │ │ + running,<0.88.0>,[], │ │ │ │ + [{header,"Status for state machine code_lock"}, │ │ │ │ + {data,[{"Status",running}, │ │ │ │ + {"Parent",<0.88.0>}, │ │ │ │ + {"Modules",[code_lock]}, │ │ │ │ + {"Time-outs",{0,[]}}, │ │ │ │ + {"Logged Events",[]}, │ │ │ │ + {"Postponed",[]}]}, │ │ │ │ + {data,[{"State", │ │ │ │ + {locked,#{code => [1,2,3,4], │ │ │ │ + length => 4,buttons => []}}}]}]]}

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Special Processes │ │ │ │

      │ │ │ │

      This section describes how to write a process that complies to the OTP design │ │ │ │ principles, without using a standard behaviour. Such a process is to:

      System messages are messages with a special meaning, used in the supervision │ │ │ │ @@ -103,238 +103,238 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Example │ │ │ │ │ │ │ │

      Here follows the simple server from │ │ │ │ Overview, │ │ │ │ -implemented using sys and proc_lib to fit into a supervision tree:

      -module(ch4).
      │ │ │ │ --export([start_link/0]).
      │ │ │ │ --export([alloc/0, free/1]).
      │ │ │ │ --export([init/1]).
      │ │ │ │ --export([system_continue/3, system_terminate/4,
      │ │ │ │ +implemented using sys and proc_lib to fit into a supervision tree:

      -module(ch4).
      │ │ │ │ +-export([start_link/0]).
      │ │ │ │ +-export([alloc/0, free/1]).
      │ │ │ │ +-export([init/1]).
      │ │ │ │ +-export([system_continue/3, system_terminate/4,
      │ │ │ │           write_debug/3,
      │ │ │ │ -         system_get_state/1, system_replace_state/2]).
      │ │ │ │ +         system_get_state/1, system_replace_state/2]).
      │ │ │ │  
      │ │ │ │ -start_link() ->
      │ │ │ │ -    proc_lib:start_link(ch4, init, [self()]).
      │ │ │ │ +start_link() ->
      │ │ │ │ +    proc_lib:start_link(ch4, init, [self()]).
      │ │ │ │  
      │ │ │ │ -alloc() ->
      │ │ │ │ -    ch4 ! {self(), alloc},
      │ │ │ │ +alloc() ->
      │ │ │ │ +    ch4 ! {self(), alloc},
      │ │ │ │      receive
      │ │ │ │ -        {ch4, Res} ->
      │ │ │ │ +        {ch4, Res} ->
      │ │ │ │              Res
      │ │ │ │      end.
      │ │ │ │  
      │ │ │ │ -free(Ch) ->
      │ │ │ │ -    ch4 ! {free, Ch},
      │ │ │ │ +free(Ch) ->
      │ │ │ │ +    ch4 ! {free, Ch},
      │ │ │ │      ok.
      │ │ │ │  
      │ │ │ │ -init(Parent) ->
      │ │ │ │ -    register(ch4, self()),
      │ │ │ │ -    Chs = channels(),
      │ │ │ │ -    Deb = sys:debug_options([]),
      │ │ │ │ -    proc_lib:init_ack(Parent, {ok, self()}),
      │ │ │ │ -    loop(Chs, Parent, Deb).
      │ │ │ │ +init(Parent) ->
      │ │ │ │ +    register(ch4, self()),
      │ │ │ │ +    Chs = channels(),
      │ │ │ │ +    Deb = sys:debug_options([]),
      │ │ │ │ +    proc_lib:init_ack(Parent, {ok, self()}),
      │ │ │ │ +    loop(Chs, Parent, Deb).
      │ │ │ │  
      │ │ │ │ -loop(Chs, Parent, Deb) ->
      │ │ │ │ +loop(Chs, Parent, Deb) ->
      │ │ │ │      receive
      │ │ │ │ -        {From, alloc} ->
      │ │ │ │ -            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
      │ │ │ │ -                                    ch4, {in, alloc, From}),
      │ │ │ │ -            {Ch, Chs2} = alloc(Chs),
      │ │ │ │ -            From ! {ch4, Ch},
      │ │ │ │ -            Deb3 = sys:handle_debug(Deb2, fun ch4:write_debug/3,
      │ │ │ │ -                                    ch4, {out, {ch4, Ch}, From}),
      │ │ │ │ -            loop(Chs2, Parent, Deb3);
      │ │ │ │ -        {free, Ch} ->
      │ │ │ │ -            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
      │ │ │ │ -                                    ch4, {in, {free, Ch}}),
      │ │ │ │ -            Chs2 = free(Ch, Chs),
      │ │ │ │ -            loop(Chs2, Parent, Deb2);
      │ │ │ │ -
      │ │ │ │ -        {system, From, Request} ->
      │ │ │ │ -            sys:handle_system_msg(Request, From, Parent,
      │ │ │ │ -                                  ch4, Deb, Chs)
      │ │ │ │ +        {From, alloc} ->
      │ │ │ │ +            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
      │ │ │ │ +                                    ch4, {in, alloc, From}),
      │ │ │ │ +            {Ch, Chs2} = alloc(Chs),
      │ │ │ │ +            From ! {ch4, Ch},
      │ │ │ │ +            Deb3 = sys:handle_debug(Deb2, fun ch4:write_debug/3,
      │ │ │ │ +                                    ch4, {out, {ch4, Ch}, From}),
      │ │ │ │ +            loop(Chs2, Parent, Deb3);
      │ │ │ │ +        {free, Ch} ->
      │ │ │ │ +            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
      │ │ │ │ +                                    ch4, {in, {free, Ch}}),
      │ │ │ │ +            Chs2 = free(Ch, Chs),
      │ │ │ │ +            loop(Chs2, Parent, Deb2);
      │ │ │ │ +
      │ │ │ │ +        {system, From, Request} ->
      │ │ │ │ +            sys:handle_system_msg(Request, From, Parent,
      │ │ │ │ +                                  ch4, Deb, Chs)
      │ │ │ │      end.
      │ │ │ │  
      │ │ │ │ -system_continue(Parent, Deb, Chs) ->
      │ │ │ │ -    loop(Chs, Parent, Deb).
      │ │ │ │ +system_continue(Parent, Deb, Chs) ->
      │ │ │ │ +    loop(Chs, Parent, Deb).
      │ │ │ │  
      │ │ │ │ -system_terminate(Reason, _Parent, _Deb, _Chs) ->
      │ │ │ │ -    exit(Reason).
      │ │ │ │ +system_terminate(Reason, _Parent, _Deb, _Chs) ->
      │ │ │ │ +    exit(Reason).
      │ │ │ │  
      │ │ │ │ -system_get_state(Chs) ->
      │ │ │ │ -    {ok, Chs}.
      │ │ │ │ +system_get_state(Chs) ->
      │ │ │ │ +    {ok, Chs}.
      │ │ │ │  
      │ │ │ │ -system_replace_state(StateFun, Chs) ->
      │ │ │ │ -    NChs = StateFun(Chs),
      │ │ │ │ -    {ok, NChs, NChs}.
      │ │ │ │ +system_replace_state(StateFun, Chs) ->
      │ │ │ │ +    NChs = StateFun(Chs),
      │ │ │ │ +    {ok, NChs, NChs}.
      │ │ │ │  
      │ │ │ │ -write_debug(Dev, Event, Name) ->
      │ │ │ │ -    io:format(Dev, "~p event = ~p~n", [Name, Event]).

      As it is not relevant to the example, the channel handling functions have been │ │ │ │ +write_debug(Dev, Event, Name) -> │ │ │ │ + io:format(Dev, "~p event = ~p~n", [Name, Event]).

      As it is not relevant to the example, the channel handling functions have been │ │ │ │ omitted. To compile this example, the │ │ │ │ implementation of channel handling │ │ │ │ needs to be added to the module.

      Here is an example showing how the debugging functions in the sys │ │ │ │ module can be used for ch4:

      % erl
      │ │ │ │ -Erlang/OTP 27 [erts-15.0] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
      │ │ │ │ +Erlang/OTP 27 [erts-15.0] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
      │ │ │ │  
      │ │ │ │ -Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
      │ │ │ │ -1> ch4:start_link().
      │ │ │ │ -{ok,<0.90.0>}
      │ │ │ │ -2> sys:statistics(ch4, true).
      │ │ │ │ +Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
      │ │ │ │ +1> ch4:start_link().
      │ │ │ │ +{ok,<0.90.0>}
      │ │ │ │ +2> sys:statistics(ch4, true).
      │ │ │ │  ok
      │ │ │ │ -3> sys:trace(ch4, true).
      │ │ │ │ +3> sys:trace(ch4, true).
      │ │ │ │  ok
      │ │ │ │ -4> ch4:alloc().
      │ │ │ │ -ch4 event = {in,alloc,<0.88.0>}
      │ │ │ │ -ch4 event = {out,{ch4,1},<0.88.0>}
      │ │ │ │ +4> ch4:alloc().
      │ │ │ │ +ch4 event = {in,alloc,<0.88.0>}
      │ │ │ │ +ch4 event = {out,{ch4,1},<0.88.0>}
      │ │ │ │  1
      │ │ │ │ -5> ch4:free(ch1).
      │ │ │ │ -ch4 event = {in,{free,ch1}}
      │ │ │ │ +5> ch4:free(ch1).
      │ │ │ │ +ch4 event = {in,{free,ch1}}
      │ │ │ │  ok
      │ │ │ │ -6> sys:statistics(ch4, get).
      │ │ │ │ -{ok,[{start_time,{{2024,5,3},{8,26,13}}},
      │ │ │ │ -     {current_time,{{2024,5,3},{8,26,49}}},
      │ │ │ │ -     {reductions,202},
      │ │ │ │ -     {messages_in,2},
      │ │ │ │ -     {messages_out,1}]}
      │ │ │ │ -7> sys:statistics(ch4, false).
      │ │ │ │ +6> sys:statistics(ch4, get).
      │ │ │ │ +{ok,[{start_time,{{2024,5,3},{8,26,13}}},
      │ │ │ │ +     {current_time,{{2024,5,3},{8,26,49}}},
      │ │ │ │ +     {reductions,202},
      │ │ │ │ +     {messages_in,2},
      │ │ │ │ +     {messages_out,1}]}
      │ │ │ │ +7> sys:statistics(ch4, false).
      │ │ │ │  ok
      │ │ │ │ -8> sys:trace(ch4, false).
      │ │ │ │ +8> sys:trace(ch4, false).
      │ │ │ │  ok
      │ │ │ │ -9> sys:get_status(ch4).
      │ │ │ │ -{status,<0.90.0>,
      │ │ │ │ -        {module,ch4},
      │ │ │ │ -        [[{'$initial_call',{ch4,init,1}},
      │ │ │ │ -          {'$ancestors',[<0.88.0>,<0.87.0>,<0.70.0>,<0.65.0>,<0.69.0>,
      │ │ │ │ -                         <0.64.0>,kernel_sup,<0.47.0>]}],
      │ │ │ │ -         running,<0.88.0>,[],
      │ │ │ │ -         {[1],[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19|...]}]}

      │ │ │ │ +9> sys:get_status(ch4). │ │ │ │ +{status,<0.90.0>, │ │ │ │ + {module,ch4}, │ │ │ │ + [[{'$initial_call',{ch4,init,1}}, │ │ │ │ + {'$ancestors',[<0.88.0>,<0.87.0>,<0.70.0>,<0.65.0>,<0.69.0>, │ │ │ │ + <0.64.0>,kernel_sup,<0.47.0>]}], │ │ │ │ + running,<0.88.0>,[], │ │ │ │ + {[1],[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19|...]}]}

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Starting the Process │ │ │ │

      │ │ │ │

      A function in the proc_lib module is to be used to start the process. Several │ │ │ │ functions are available, for example, │ │ │ │ proc_lib:spawn_link/3,4 │ │ │ │ for asynchronous start and │ │ │ │ proc_lib:start_link/3,4,5 for synchronous start.

      Information necessary for a process within a supervision tree, such as │ │ │ │ details on ancestors and the initial call, is stored when a process │ │ │ │ is started through one of these functions.

      If the process terminates with a reason other than normal or shutdown, a │ │ │ │ crash report is generated. For more information about the crash report, see │ │ │ │ Logging in Kernel User's Guide.

      In the example, synchronous start is used. The process starts by calling │ │ │ │ -ch4:start_link():

      start_link() ->
      │ │ │ │ -    proc_lib:start_link(ch4, init, [self()]).

      ch4:start_link/0 calls proc_lib:start_link/3, which takes a module │ │ │ │ +ch4:start_link():

      start_link() ->
      │ │ │ │ +    proc_lib:start_link(ch4, init, [self()]).

      ch4:start_link/0 calls proc_lib:start_link/3, which takes a module │ │ │ │ name, a function name, and an argument list as arguments. It then │ │ │ │ spawns a new process and establishes a link. The new process starts │ │ │ │ by executing the given function, here ch4:init(Pid), where Pid is │ │ │ │ the pid of the parent process (obtained by the call to │ │ │ │ self() in the call to proc_lib:start_link/3).

      All initialization, including name registration, is done in init/1. The new │ │ │ │ -process has to acknowledge that it has been started to the parent:

      init(Parent) ->
      │ │ │ │ +process has to acknowledge that it has been started to the parent:

      init(Parent) ->
      │ │ │ │      ...
      │ │ │ │ -    proc_lib:init_ack(Parent, {ok, self()}),
      │ │ │ │ -    loop(...).

      proc_lib:start_link/3 is synchronous and does not return until │ │ │ │ + proc_lib:init_ack(Parent, {ok, self()}), │ │ │ │ + loop(...).

      proc_lib:start_link/3 is synchronous and does not return until │ │ │ │ proc_lib:init_ack/1,2 or │ │ │ │ proc_lib:init_fail/2,3 has been called, │ │ │ │ or the process has exited.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Debugging │ │ │ │

      │ │ │ │

      To support the debug facilities in sys, a debug structure is needed. The │ │ │ │ -Deb term is initialized using sys:debug_options/1:

      init(Parent) ->
      │ │ │ │ +Deb term is initialized using sys:debug_options/1:

      init(Parent) ->
      │ │ │ │      ...
      │ │ │ │ -    Deb = sys:debug_options([]),
      │ │ │ │ +    Deb = sys:debug_options([]),
      │ │ │ │      ...
      │ │ │ │ -    loop(Chs, Parent, Deb).

      sys:debug_options/1 takes a list of options. Given an empty list as in this │ │ │ │ + loop(Chs, Parent, Deb).

      sys:debug_options/1 takes a list of options. Given an empty list as in this │ │ │ │ example means that debugging is initially disabled. For information about the │ │ │ │ possible options, see sys in STDLIB.

      For each system event to be logged or traced, the following function │ │ │ │ -is to be called:

      sys:handle_debug(Deb, Func, Info, Event) => Deb1

      The arguments have the follow meaning:

      • Deb is the debug structure as returned from sys:debug_options/1.
      • Func is a fun specifying a (user-defined) function used to format trace │ │ │ │ +is to be called:

        sys:handle_debug(Deb, Func, Info, Event) => Deb1

        The arguments have the follow meaning:

        • Deb is the debug structure as returned from sys:debug_options/1.
        • Func is a fun specifying a (user-defined) function used to format trace │ │ │ │ output. For each system event, the format function is called as │ │ │ │ Func(Dev, Event, Info), where:
          • Dev is the I/O device to which the output is to be printed. See io │ │ │ │ in STDLIB.
          • Event and Info are passed as-is from the call to sys:handle_debug/4.
        • Info is used to pass more information to Func. It can be any term, and it │ │ │ │ is passed as-is.
        • Event is the system event. It is up to the user to define what a system │ │ │ │ event is and how it is to be represented. Typically, at least incoming and │ │ │ │ outgoing messages are considered system events and represented by the tuples │ │ │ │ {in,Msg[,From]} and {out,Msg,To[,State]}, respectively.

        sys:handle_debug/4 returns an updated debug structure Deb1.

        In the example, sys:handle_debug/4 is called for each incoming and │ │ │ │ outgoing message. The format function Func is the function │ │ │ │ -ch4:write_debug/3, which prints the message using io:format/3.

        loop(Chs, Parent, Deb) ->
        │ │ │ │ +ch4:write_debug/3, which prints the message using io:format/3.

        loop(Chs, Parent, Deb) ->
        │ │ │ │      receive
        │ │ │ │ -        {From, alloc} ->
        │ │ │ │ -            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
        │ │ │ │ -                                    ch4, {in, alloc, From}),
        │ │ │ │ -            {Ch, Chs2} = alloc(Chs),
        │ │ │ │ -            From ! {ch4, Ch},
        │ │ │ │ -            Deb3 = sys:handle_debug(Deb2, fun ch4:write_debug/3,
        │ │ │ │ -                                    ch4, {out, {ch4, Ch}, From}),
        │ │ │ │ -            loop(Chs2, Parent, Deb3);
        │ │ │ │ -        {free, Ch} ->
        │ │ │ │ -            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
        │ │ │ │ -                                    ch4, {in, {free, Ch}}),
        │ │ │ │ -            Chs2 = free(Ch, Chs),
        │ │ │ │ -            loop(Chs2, Parent, Deb2);
        │ │ │ │ +        {From, alloc} ->
        │ │ │ │ +            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
        │ │ │ │ +                                    ch4, {in, alloc, From}),
        │ │ │ │ +            {Ch, Chs2} = alloc(Chs),
        │ │ │ │ +            From ! {ch4, Ch},
        │ │ │ │ +            Deb3 = sys:handle_debug(Deb2, fun ch4:write_debug/3,
        │ │ │ │ +                                    ch4, {out, {ch4, Ch}, From}),
        │ │ │ │ +            loop(Chs2, Parent, Deb3);
        │ │ │ │ +        {free, Ch} ->
        │ │ │ │ +            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
        │ │ │ │ +                                    ch4, {in, {free, Ch}}),
        │ │ │ │ +            Chs2 = free(Ch, Chs),
        │ │ │ │ +            loop(Chs2, Parent, Deb2);
        │ │ │ │          ...
        │ │ │ │      end.
        │ │ │ │  
        │ │ │ │ -write_debug(Dev, Event, Name) ->
        │ │ │ │ -    io:format(Dev, "~p event = ~p~n", [Name, Event]).

        │ │ │ │ +write_debug(Dev, Event, Name) -> │ │ │ │ + io:format(Dev, "~p event = ~p~n", [Name, Event]).

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Handling System Messages │ │ │ │

        │ │ │ │

        System messages are received as:

        {system, From, Request}

        The content and meaning of these messages are not to be interpreted by the │ │ │ │ -process. Instead the following function is to be called:

        sys:handle_system_msg(Request, From, Parent, Module, Deb, State)

        The arguments have the following meaning:

        • Request and From from the received system message are to be │ │ │ │ +process. Instead the following function is to be called:

          sys:handle_system_msg(Request, From, Parent, Module, Deb, State)

          The arguments have the following meaning:

          • Request and From from the received system message are to be │ │ │ │ passed as-is to the call to sys:handle_system_msg/6.
          • Parent is the pid of the parent process.
          • Module is the name of the module implementing the speciall process.
          • Deb is the debug structure.
          • State is a term describing the internal state and is passed on to │ │ │ │ Module:system_continue/3, Module:system_terminate/4/ │ │ │ │ Module:system_get_state/1, and Module:system_replace_state/2.

          sys:handle_system_msg/6 does not return. It handles the system │ │ │ │ message and eventually calls either of the following functions:

          • Module:system_continue(Parent, Deb, State) - if process execution is to │ │ │ │ continue.

          • Module:system_terminate(Reason, Parent, Deb, State) - if the │ │ │ │ process is to terminate.

          While handling the system message, sys:handle_system_msg/6 can call │ │ │ │ one of the following functions:

          • Module:system_get_state(State) - if the process is to return its state.

          • Module:system_replace_state(StateFun, State) - if the process is │ │ │ │ to replace its state using the fun StateFun fun. See sys:replace_state/3 │ │ │ │ for more information.

          • system_code_change(Misc, Module, OldVsn, Extra) - if the process is to │ │ │ │ perform a code change.

          A process in a supervision tree is expected to terminate with the same reason as │ │ │ │ -its parent.

          In the example, system messages are handed by the following code:

          loop(Chs, Parent, Deb) ->
          │ │ │ │ +its parent.

          In the example, system messages are handed by the following code:

          loop(Chs, Parent, Deb) ->
          │ │ │ │      receive
          │ │ │ │          ...
          │ │ │ │  
          │ │ │ │ -        {system, From, Request} ->
          │ │ │ │ -            sys:handle_system_msg(Request, From, Parent,
          │ │ │ │ -                                  ch4, Deb, Chs)
          │ │ │ │ +        {system, From, Request} ->
          │ │ │ │ +            sys:handle_system_msg(Request, From, Parent,
          │ │ │ │ +                                  ch4, Deb, Chs)
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │ -system_continue(Parent, Deb, Chs) ->
          │ │ │ │ -    loop(Chs, Parent, Deb).
          │ │ │ │ +system_continue(Parent, Deb, Chs) ->
          │ │ │ │ +    loop(Chs, Parent, Deb).
          │ │ │ │  
          │ │ │ │ -system_terminate(Reason, Parent, Deb, Chs) ->
          │ │ │ │ -    exit(Reason).
          │ │ │ │ +system_terminate(Reason, Parent, Deb, Chs) ->
          │ │ │ │ +    exit(Reason).
          │ │ │ │  
          │ │ │ │ -system_get_state(Chs) ->
          │ │ │ │ -    {ok, Chs, Chs}.
          │ │ │ │ +system_get_state(Chs) ->
          │ │ │ │ +    {ok, Chs, Chs}.
          │ │ │ │  
          │ │ │ │ -system_replace_state(StateFun, Chs) ->
          │ │ │ │ -    NChs = StateFun(Chs),
          │ │ │ │ -    {ok, NChs, NChs}.

          If a special process is configured to trap exits, it must take notice │ │ │ │ +system_replace_state(StateFun, Chs) -> │ │ │ │ + NChs = StateFun(Chs), │ │ │ │ + {ok, NChs, NChs}.

          If a special process is configured to trap exits, it must take notice │ │ │ │ of 'EXIT' messages from its parent process and terminate using the │ │ │ │ -same exit reason once the parent process has terminated.

          Here is an example:

          init(Parent) ->
          │ │ │ │ +same exit reason once the parent process has terminated.

          Here is an example:

          init(Parent) ->
          │ │ │ │      ...,
          │ │ │ │ -    process_flag(trap_exit, true),
          │ │ │ │ +    process_flag(trap_exit, true),
          │ │ │ │      ...,
          │ │ │ │ -    loop(Parent).
          │ │ │ │ +    loop(Parent).
          │ │ │ │  
          │ │ │ │ -loop(Parent) ->
          │ │ │ │ +loop(Parent) ->
          │ │ │ │      receive
          │ │ │ │          ...
          │ │ │ │ -        {'EXIT', Parent, Reason} ->
          │ │ │ │ +        {'EXIT', Parent, Reason} ->
          │ │ │ │              %% Clean up here, if needed.
          │ │ │ │ -            exit(Reason);
          │ │ │ │ +            exit(Reason);
          │ │ │ │          ...
          │ │ │ │      end.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ User-Defined Behaviours │ │ │ │

          │ │ │ │ @@ -353,69 +353,69 @@ │ │ │ │ function. Note that the -optional_callbacks attribute is to be used together │ │ │ │ with the -callback attribute; it cannot be combined with the │ │ │ │ behaviour_info() function described below.

          Tools that need to know about optional callback functions can call │ │ │ │ Behaviour:behaviour_info(optional_callbacks) to get a list of all optional │ │ │ │ callback functions.

          Note

          We recommend using the -callback attribute rather than the │ │ │ │ behaviour_info() function. The reason is that the extra type information can │ │ │ │ be used by tools to produce documentation or find discrepancies.

          As an alternative to the -callback and -optional_callbacks attributes you │ │ │ │ -may directly implement and export behaviour_info():

          behaviour_info(callbacks) ->
          │ │ │ │ -    [{Name1, Arity1},...,{NameN, ArityN}].

          where each {Name, Arity} specifies the name and arity of a callback function. │ │ │ │ +may directly implement and export behaviour_info():

          behaviour_info(callbacks) ->
          │ │ │ │ +    [{Name1, Arity1},...,{NameN, ArityN}].

          where each {Name, Arity} specifies the name and arity of a callback function. │ │ │ │ This function is otherwise automatically generated by the compiler using the │ │ │ │ -callback attributes.

          When the compiler encounters the module attribute -behaviour(Behaviour). in a │ │ │ │ module Mod, it calls Behaviour:behaviour_info(callbacks) and compares the │ │ │ │ result with the set of functions actually exported from Mod, and issues a │ │ │ │ warning if any callback function is missing.

          Example:

          %% User-defined behaviour module
          │ │ │ │ --module(simple_server).
          │ │ │ │ --export([start_link/2, init/3, ...]).
          │ │ │ │ +-module(simple_server).
          │ │ │ │ +-export([start_link/2, init/3, ...]).
          │ │ │ │  
          │ │ │ │ --callback init(State :: term()) -> 'ok'.
          │ │ │ │ --callback handle_req(Req :: term(), State :: term()) -> {'ok', Reply :: term()}.
          │ │ │ │ --callback terminate() -> 'ok'.
          │ │ │ │ --callback format_state(State :: term()) -> term().
          │ │ │ │ +-callback init(State :: term()) -> 'ok'.
          │ │ │ │ +-callback handle_req(Req :: term(), State :: term()) -> {'ok', Reply :: term()}.
          │ │ │ │ +-callback terminate() -> 'ok'.
          │ │ │ │ +-callback format_state(State :: term()) -> term().
          │ │ │ │  
          │ │ │ │ --optional_callbacks([format_state/1]).
          │ │ │ │ +-optional_callbacks([format_state/1]).
          │ │ │ │  
          │ │ │ │  %% Alternatively you may define:
          │ │ │ │  %%
          │ │ │ │  %% -export([behaviour_info/1]).
          │ │ │ │  %% behaviour_info(callbacks) ->
          │ │ │ │  %%     [{init,1},
          │ │ │ │  %%      {handle_req,2},
          │ │ │ │  %%      {terminate,0}].
          │ │ │ │  
          │ │ │ │ -start_link(Name, Module) ->
          │ │ │ │ -    proc_lib:start_link(?MODULE, init, [self(), Name, Module]).
          │ │ │ │ +start_link(Name, Module) ->
          │ │ │ │ +    proc_lib:start_link(?MODULE, init, [self(), Name, Module]).
          │ │ │ │  
          │ │ │ │ -init(Parent, Name, Module) ->
          │ │ │ │ -    register(Name, self()),
          │ │ │ │ +init(Parent, Name, Module) ->
          │ │ │ │ +    register(Name, self()),
          │ │ │ │      ...,
          │ │ │ │ -    Dbg = sys:debug_options([]),
          │ │ │ │ -    proc_lib:init_ack(Parent, {ok, self()}),
          │ │ │ │ -    loop(Parent, Module, Deb, ...).
          │ │ │ │ +    Dbg = sys:debug_options([]),
          │ │ │ │ +    proc_lib:init_ack(Parent, {ok, self()}),
          │ │ │ │ +    loop(Parent, Module, Deb, ...).
          │ │ │ │  
          │ │ │ │ -...

          In a callback module:

          -module(db).
          │ │ │ │ --behaviour(simple_server).
          │ │ │ │ +...

          In a callback module:

          -module(db).
          │ │ │ │ +-behaviour(simple_server).
          │ │ │ │  
          │ │ │ │ --export([init/1, handle_req/2, terminate/0]).
          │ │ │ │ +-export([init/1, handle_req/2, terminate/0]).
          │ │ │ │  
          │ │ │ │  ...

          The contracts specified with -callback attributes in behaviour modules can be │ │ │ │ further refined by adding -spec attributes in callback modules. This can be │ │ │ │ useful as -callback contracts are usually generic. The same callback module │ │ │ │ -with contracts for the callbacks:

          -module(db).
          │ │ │ │ --behaviour(simple_server).
          │ │ │ │ +with contracts for the callbacks:

          -module(db).
          │ │ │ │ +-behaviour(simple_server).
          │ │ │ │  
          │ │ │ │ --export([init/1, handle_req/2, terminate/0]).
          │ │ │ │ +-export([init/1, handle_req/2, terminate/0]).
          │ │ │ │  
          │ │ │ │ --record(state, {field1 :: [atom()], field2 :: integer()}).
          │ │ │ │ +-record(state, {field1 :: [atom()], field2 :: integer()}).
          │ │ │ │  
          │ │ │ │ --type state()   :: #state{}.
          │ │ │ │ --type request() :: {'store', term(), term()};
          │ │ │ │ -                   {'lookup', term()}.
          │ │ │ │ +-type state()   :: #state{}.
          │ │ │ │ +-type request() :: {'store', term(), term()};
          │ │ │ │ +                   {'lookup', term()}.
          │ │ │ │  
          │ │ │ │  ...
          │ │ │ │  
          │ │ │ │ --spec handle_req(request(), state()) -> {'ok', term()}.
          │ │ │ │ +-spec handle_req(request(), state()) -> {'ok', term()}.
          │ │ │ │  
          │ │ │ │  ...

          Each -spec contract is to be a subtype of the respective -callback contract.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/seq_prog.xhtml │ │ │ │ @@ -41,293 +41,293 @@ │ │ │ │
          7 │ │ │ │ 2>

          As shown, the Erlang shell numbers the lines that can be entered, (as 1> 2>) and │ │ │ │ that it correctly says that 2 + 5 is 7. If you make writing mistakes in the │ │ │ │ shell, you can delete with the backspace key, as in most shells. There are many │ │ │ │ more editing commands in the shell (see │ │ │ │ tty - A command line interface in ERTS User's Guide).

          (Notice that many line numbers given by the shell in the following examples are │ │ │ │ out of sequence. This is because this tutorial was written and code-tested in │ │ │ │ -separate sessions).

          Here is a bit more complex calculation:

          2> (42 + 77) * 66 / 3.
          │ │ │ │ +separate sessions).

          Here is a bit more complex calculation:

          2> (42 + 77) * 66 / 3.
          │ │ │ │  2618.0

          Notice the use of brackets, the multiplication operator *, and the division │ │ │ │ operator /, as in normal arithmetic (see │ │ │ │ Expressions).

          Press Control-C to shut down the Erlang system and the Erlang shell.

          The following output is shown:

          BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
          │ │ │ │         (v)ersion (k)ill (D)b-tables (d)istribution
          │ │ │ │  a
          │ │ │ │ -$

          Type a to leave the Erlang system.

          Another way to shut down the Erlang system is by entering halt/0:

          3> halt().
          │ │ │ │ +$

          Type a to leave the Erlang system.

          Another way to shut down the Erlang system is by entering halt/0:

          3> halt().
          │ │ │ │  $

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Modules and Functions │ │ │ │

          │ │ │ │

          A programming language is not much use if you only can run code from the shell. │ │ │ │ So here is a small Erlang program. Enter it into a file named tut.erl using a │ │ │ │ suitable text editor. The file name tut.erl is important, and also that it is │ │ │ │ in the same directory as the one where you started erl). If you are lucky your │ │ │ │ editor has an Erlang mode that makes it easier for you to enter and format your │ │ │ │ code nicely (see The Erlang mode for Emacs │ │ │ │ in Tools User's Guide), but you can manage perfectly well without. Here is the │ │ │ │ -code to enter:

          -module(tut).
          │ │ │ │ --export([double/1]).
          │ │ │ │ +code to enter:

          -module(tut).
          │ │ │ │ +-export([double/1]).
          │ │ │ │  
          │ │ │ │ -double(X) ->
          │ │ │ │ +double(X) ->
          │ │ │ │      2 * X.

          It is not hard to guess that this program doubles the value of numbers. The │ │ │ │ first two lines of the code are described later. Let us compile the program. │ │ │ │ -This can be done in an Erlang shell as follows, where c means compile:

          3> c(tut).
          │ │ │ │ -{ok,tut}

          The {ok,tut} means that the compilation is OK. If it says error it means │ │ │ │ +This can be done in an Erlang shell as follows, where c means compile:

          3> c(tut).
          │ │ │ │ +{ok,tut}

          The {ok,tut} means that the compilation is OK. If it says error it means │ │ │ │ that there is some mistake in the text that you entered. Additional error │ │ │ │ messages gives an idea to what is wrong so you can modify the text and then try │ │ │ │ -to compile the program again.

          Now run the program:

          4> tut:double(10).
          │ │ │ │ +to compile the program again.

          Now run the program:

          4> tut:double(10).
          │ │ │ │  20

          As expected, double of 10 is 20.

          Now let us get back to the first two lines of the code. Erlang programs are │ │ │ │ written in files. Each file contains an Erlang module. The first line of code │ │ │ │ -in the module is the module name (see Modules):

          -module(tut).

          Thus, the module is called tut. Notice the full stop . at the end of the │ │ │ │ +in the module is the module name (see Modules):

          -module(tut).

          Thus, the module is called tut. Notice the full stop . at the end of the │ │ │ │ line. The files which are used to store the module must have the same name as │ │ │ │ the module but with the extension .erl. In this case the file name is │ │ │ │ tut.erl. When using a function in another module, the syntax │ │ │ │ module_name:function_name(arguments) is used. So the following means call │ │ │ │ -function double in module tut with argument 10.

          4> tut:double(10).

          The second line says that the module tut contains a function called double, │ │ │ │ -which takes one argument (X in our example):

          -export([double/1]).

          The second line also says that this function can be called from outside the │ │ │ │ +function double in module tut with argument 10.

          4> tut:double(10).

          The second line says that the module tut contains a function called double, │ │ │ │ +which takes one argument (X in our example):

          -export([double/1]).

          The second line also says that this function can be called from outside the │ │ │ │ module tut. More about this later. Again, notice the . at the end of the │ │ │ │ line.

          Now for a more complicated example, the factorial of a number. For example, the │ │ │ │ -factorial of 4 is 4 3 2 * 1, which equals 24.

          Enter the following code in a file named tut1.erl:

          -module(tut1).
          │ │ │ │ --export([fac/1]).
          │ │ │ │ +factorial of 4 is 4  3  2 * 1, which equals 24.

          Enter the following code in a file named tut1.erl:

          -module(tut1).
          │ │ │ │ +-export([fac/1]).
          │ │ │ │  
          │ │ │ │ -fac(1) ->
          │ │ │ │ +fac(1) ->
          │ │ │ │      1;
          │ │ │ │ -fac(N) ->
          │ │ │ │ -    N * fac(N - 1).

          So this is a module, called tut1 that contains a function called fac>, which │ │ │ │ -takes one argument, N.

          The first part says that the factorial of 1 is 1.:

          fac(1) ->
          │ │ │ │ +fac(N) ->
          │ │ │ │ +    N * fac(N - 1).

          So this is a module, called tut1 that contains a function called fac>, which │ │ │ │ +takes one argument, N.

          The first part says that the factorial of 1 is 1.:

          fac(1) ->
          │ │ │ │      1;

          Notice that this part ends with a semicolon ; that indicates that there is │ │ │ │ more of the function fac> to come.

          The second part says that the factorial of N is N multiplied by the factorial of │ │ │ │ -N - 1:

          fac(N) ->
          │ │ │ │ -    N * fac(N - 1).

          Notice that this part ends with a . saying that there are no more parts of │ │ │ │ -this function.

          Compile the file:

          5> c(tut1).
          │ │ │ │ -{ok,tut1}

          And now calculate the factorial of 4.

          6> tut1:fac(4).
          │ │ │ │ +N - 1:

          fac(N) ->
          │ │ │ │ +    N * fac(N - 1).

          Notice that this part ends with a . saying that there are no more parts of │ │ │ │ +this function.

          Compile the file:

          5> c(tut1).
          │ │ │ │ +{ok,tut1}

          And now calculate the factorial of 4.

          6> tut1:fac(4).
          │ │ │ │  24

          Here the function fac> in module tut1 is called with argument 4.

          A function can have many arguments. Let us expand the module tut1 with the │ │ │ │ -function to multiply two numbers:

          -module(tut1).
          │ │ │ │ --export([fac/1, mult/2]).
          │ │ │ │ +function to multiply two numbers:

          -module(tut1).
          │ │ │ │ +-export([fac/1, mult/2]).
          │ │ │ │  
          │ │ │ │ -fac(1) ->
          │ │ │ │ +fac(1) ->
          │ │ │ │      1;
          │ │ │ │ -fac(N) ->
          │ │ │ │ -    N * fac(N - 1).
          │ │ │ │ +fac(N) ->
          │ │ │ │ +    N * fac(N - 1).
          │ │ │ │  
          │ │ │ │ -mult(X, Y) ->
          │ │ │ │ +mult(X, Y) ->
          │ │ │ │      X * Y.

          Notice that it is also required to expand the -export line with the │ │ │ │ -information that there is another function mult with two arguments.

          Compile:

          7> c(tut1).
          │ │ │ │ -{ok,tut1}

          Try out the new function mult:

          8> tut1:mult(3,4).
          │ │ │ │ +information that there is another function mult with two arguments.

          Compile:

          7> c(tut1).
          │ │ │ │ +{ok,tut1}

          Try out the new function mult:

          8> tut1:mult(3,4).
          │ │ │ │  12

          In this example the numbers are integers and the arguments in the functions in │ │ │ │ the code N, X, and Y are called variables. Variables must start with a │ │ │ │ capital letter (see Variables). Examples of │ │ │ │ variables are Number, ShoeSize, and Age.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Atoms │ │ │ │

          │ │ │ │

          Atom is another data type in Erlang. Atoms start with a small letter (see │ │ │ │ Atom), for example, charles, centimeter, and │ │ │ │ inch. Atoms are simply names, nothing else. They are not like variables, which │ │ │ │ can have a value.

          Enter the next program in a file named tut2.erl). It can be useful for │ │ │ │ -converting from inches to centimeters and conversely:

          -module(tut2).
          │ │ │ │ --export([convert/2]).
          │ │ │ │ +converting from inches to centimeters and conversely:

          -module(tut2).
          │ │ │ │ +-export([convert/2]).
          │ │ │ │  
          │ │ │ │ -convert(M, inch) ->
          │ │ │ │ +convert(M, inch) ->
          │ │ │ │      M / 2.54;
          │ │ │ │  
          │ │ │ │ -convert(N, centimeter) ->
          │ │ │ │ -    N * 2.54.

          Compile:

          9> c(tut2).
          │ │ │ │ -{ok,tut2}

          Test:

          10> tut2:convert(3, inch).
          │ │ │ │ +convert(N, centimeter) ->
          │ │ │ │ +    N * 2.54.

          Compile:

          9> c(tut2).
          │ │ │ │ +{ok,tut2}

          Test:

          10> tut2:convert(3, inch).
          │ │ │ │  1.1811023622047243
          │ │ │ │ -11> tut2:convert(7, centimeter).
          │ │ │ │ +11> tut2:convert(7, centimeter).
          │ │ │ │  17.78

          Notice the introduction of decimals (floating point numbers) without any │ │ │ │ explanation. Hopefully you can cope with that.

          Let us see what happens if something other than centimeter or inch is │ │ │ │ -entered in the convert function:

          12> tut2:convert(3, miles).
          │ │ │ │ +entered in the convert function:

          12> tut2:convert(3, miles).
          │ │ │ │  ** exception error: no function clause matching tut2:convert(3,miles) (tut2.erl, line 4)

          The two parts of the convert function are called its clauses. As shown, │ │ │ │ miles is not part of either of the clauses. The Erlang system cannot match │ │ │ │ either of the clauses so an error message function_clause is returned. The │ │ │ │ shell formats the error message nicely, but the error tuple is saved in the │ │ │ │ -shell's history list and can be output by the shell command v/1:

          13> v(12).
          │ │ │ │ -{'EXIT',{function_clause,[{tut2,convert,
          │ │ │ │ -                                [3,miles],
          │ │ │ │ -                                [{file,"tut2.erl"},{line,4}]},
          │ │ │ │ -                          {erl_eval,do_apply,6,
          │ │ │ │ -                                    [{file,"erl_eval.erl"},{line,677}]},
          │ │ │ │ -                          {shell,exprs,7,[{file,"shell.erl"},{line,687}]},
          │ │ │ │ -                          {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]},
          │ │ │ │ -                          {shell,eval_loop,3,
          │ │ │ │ -                                 [{file,"shell.erl"},{line,627}]}]}}

          │ │ │ │ +shell's history list and can be output by the shell command v/1:

          13> v(12).
          │ │ │ │ +{'EXIT',{function_clause,[{tut2,convert,
          │ │ │ │ +                                [3,miles],
          │ │ │ │ +                                [{file,"tut2.erl"},{line,4}]},
          │ │ │ │ +                          {erl_eval,do_apply,6,
          │ │ │ │ +                                    [{file,"erl_eval.erl"},{line,677}]},
          │ │ │ │ +                          {shell,exprs,7,[{file,"shell.erl"},{line,687}]},
          │ │ │ │ +                          {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]},
          │ │ │ │ +                          {shell,eval_loop,3,
          │ │ │ │ +                                 [{file,"shell.erl"},{line,627}]}]}}

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Tuples │ │ │ │

          │ │ │ │ -

          Now the tut2 program is hardly good programming style. Consider:

          tut2:convert(3, inch).

          Does this mean that 3 is in inches? Or does it mean that 3 is in centimeters and │ │ │ │ +

          Now the tut2 program is hardly good programming style. Consider:

          tut2:convert(3, inch).

          Does this mean that 3 is in inches? Or does it mean that 3 is in centimeters and │ │ │ │ is to be converted to inches? Erlang has a way to group things together to make │ │ │ │ things more understandable. These are called tuples and are surrounded by │ │ │ │ curly brackets, { and }.

          So, {inch,3} denotes 3 inches and {centimeter,5} denotes 5 centimeters. Now │ │ │ │ let us write a new program that converts centimeters to inches and conversely. │ │ │ │ -Enter the following code in a file called tut3.erl):

          -module(tut3).
          │ │ │ │ --export([convert_length/1]).
          │ │ │ │ +Enter the following code in a file called tut3.erl):

          -module(tut3).
          │ │ │ │ +-export([convert_length/1]).
          │ │ │ │  
          │ │ │ │ -convert_length({centimeter, X}) ->
          │ │ │ │ -    {inch, X / 2.54};
          │ │ │ │ -convert_length({inch, Y}) ->
          │ │ │ │ -    {centimeter, Y * 2.54}.

          Compile and test:

          14> c(tut3).
          │ │ │ │ -{ok,tut3}
          │ │ │ │ -15> tut3:convert_length({inch, 5}).
          │ │ │ │ -{centimeter,12.7}
          │ │ │ │ -16> tut3:convert_length(tut3:convert_length({inch, 5})).
          │ │ │ │ -{inch,5.0}

          Notice on line 16 that 5 inches is converted to centimeters and back again and │ │ │ │ +convert_length({centimeter, X}) -> │ │ │ │ + {inch, X / 2.54}; │ │ │ │ +convert_length({inch, Y}) -> │ │ │ │ + {centimeter, Y * 2.54}.

          Compile and test:

          14> c(tut3).
          │ │ │ │ +{ok,tut3}
          │ │ │ │ +15> tut3:convert_length({inch, 5}).
          │ │ │ │ +{centimeter,12.7}
          │ │ │ │ +16> tut3:convert_length(tut3:convert_length({inch, 5})).
          │ │ │ │ +{inch,5.0}

          Notice on line 16 that 5 inches is converted to centimeters and back again and │ │ │ │ reassuringly get back to the original value. That is, the argument to a function │ │ │ │ can be the result of another function. Consider how line 16 (above) works. The │ │ │ │ argument given to the function {inch,5} is first matched against the first │ │ │ │ head clause of convert_length, that is, convert_length({centimeter,X}). It │ │ │ │ can be seen that {centimeter,X} does not match {inch,5} (the head is the bit │ │ │ │ before the ->). This having failed, let us try the head of the next clause │ │ │ │ that is, convert_length({inch,Y}). This matches, and Y gets the value 5.

          Tuples can have more than two parts, in fact as many parts as you want, and │ │ │ │ contain any valid Erlang term. For example, to represent the temperature of │ │ │ │ -various cities of the world:

          {moscow, {c, -10}}
          │ │ │ │ -{cape_town, {f, 70}}
          │ │ │ │ -{paris, {f, 28}}

          Tuples have a fixed number of items in them. Each item in a tuple is called an │ │ │ │ +various cities of the world:

          {moscow, {c, -10}}
          │ │ │ │ +{cape_town, {f, 70}}
          │ │ │ │ +{paris, {f, 28}}

          Tuples have a fixed number of items in them. Each item in a tuple is called an │ │ │ │ element. In the tuple {moscow,{c,-10}}, element 1 is moscow and element 2 │ │ │ │ is {c,-10}. Here c represents Celsius and f Fahrenheit.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Lists │ │ │ │

          │ │ │ │

          Whereas tuples group things together, it is also needed to represent lists of │ │ │ │ things. Lists in Erlang are surrounded by square brackets, [ and ]. For │ │ │ │ -example, a list of the temperatures of various cities in the world can be:

          [{moscow, {c, -10}}, {cape_town, {f, 70}}, {stockholm, {c, -4}},
          │ │ │ │ - {paris, {f, 28}}, {london, {f, 36}}]

          Notice that this list was so long that it did not fit on one line. This does not │ │ │ │ +example, a list of the temperatures of various cities in the world can be:

          [{moscow, {c, -10}}, {cape_town, {f, 70}}, {stockholm, {c, -4}},
          │ │ │ │ + {paris, {f, 28}}, {london, {f, 36}}]

          Notice that this list was so long that it did not fit on one line. This does not │ │ │ │ matter, Erlang allows line breaks at all "sensible places" but not, for example, │ │ │ │ in the middle of atoms, integers, and others.

          A useful way of looking at parts of lists, is by using |. This is best │ │ │ │ -explained by an example using the shell:

          17> [First |TheRest] = [1,2,3,4,5].
          │ │ │ │ -[1,2,3,4,5]
          │ │ │ │ +explained by an example using the shell:

          17> [First |TheRest] = [1,2,3,4,5].
          │ │ │ │ +[1,2,3,4,5]
          │ │ │ │  18> First.
          │ │ │ │  1
          │ │ │ │  19> TheRest.
          │ │ │ │ -[2,3,4,5]

          To separate the first elements of the list from the rest of the list, | is │ │ │ │ -used. First has got value 1 and TheRest has got the value [2,3,4,5].

          Another example:

          20> [E1, E2 | R] = [1,2,3,4,5,6,7].
          │ │ │ │ -[1,2,3,4,5,6,7]
          │ │ │ │ +[2,3,4,5]

          To separate the first elements of the list from the rest of the list, | is │ │ │ │ +used. First has got value 1 and TheRest has got the value [2,3,4,5].

          Another example:

          20> [E1, E2 | R] = [1,2,3,4,5,6,7].
          │ │ │ │ +[1,2,3,4,5,6,7]
          │ │ │ │  21> E1.
          │ │ │ │  1
          │ │ │ │  22> E2.
          │ │ │ │  2
          │ │ │ │  23> R.
          │ │ │ │ -[3,4,5,6,7]

          Here you see the use of | to get the first two elements from the list. If you │ │ │ │ +[3,4,5,6,7]

          Here you see the use of | to get the first two elements from the list. If you │ │ │ │ try to get more elements from the list than there are elements in the list, an │ │ │ │ error is returned. Notice also the special case of the list with no elements, │ │ │ │ -[]:

          24> [A, B | C] = [1, 2].
          │ │ │ │ -[1,2]
          │ │ │ │ +[]:

          24> [A, B | C] = [1, 2].
          │ │ │ │ +[1,2]
          │ │ │ │  25> A.
          │ │ │ │  1
          │ │ │ │  26> B.
          │ │ │ │  2
          │ │ │ │  27> C.
          │ │ │ │ -[]

          In the previous examples, new variable names are used, instead of reusing the │ │ │ │ +[]

          In the previous examples, new variable names are used, instead of reusing the │ │ │ │ old ones: First, TheRest, E1, E2, R, A, B, and C. The reason for │ │ │ │ this is that a variable can only be given a value once in its context (scope). │ │ │ │ More about this later.

          The following example shows how to find the length of a list. Enter the │ │ │ │ -following code in a file named tut4.erl:

          -module(tut4).
          │ │ │ │ +following code in a file named tut4.erl:

          -module(tut4).
          │ │ │ │  
          │ │ │ │ --export([list_length/1]).
          │ │ │ │ +-export([list_length/1]).
          │ │ │ │  
          │ │ │ │ -list_length([]) ->
          │ │ │ │ +list_length([]) ->
          │ │ │ │      0;
          │ │ │ │ -list_length([First | Rest]) ->
          │ │ │ │ -    1 + list_length(Rest).

          Compile and test:

          28> c(tut4).
          │ │ │ │ -{ok,tut4}
          │ │ │ │ -29> tut4:list_length([1,2,3,4,5,6,7]).
          │ │ │ │ -7

          Explanation:

          list_length([]) ->
          │ │ │ │ -    0;

          The length of an empty list is obviously 0.

          list_length([First | Rest]) ->
          │ │ │ │ -    1 + list_length(Rest).

          The length of a list with the first element First and the remaining elements │ │ │ │ +list_length([First | Rest]) -> │ │ │ │ + 1 + list_length(Rest).

          Compile and test:

          28> c(tut4).
          │ │ │ │ +{ok,tut4}
          │ │ │ │ +29> tut4:list_length([1,2,3,4,5,6,7]).
          │ │ │ │ +7

          Explanation:

          list_length([]) ->
          │ │ │ │ +    0;

          The length of an empty list is obviously 0.

          list_length([First | Rest]) ->
          │ │ │ │ +    1 + list_length(Rest).

          The length of a list with the first element First and the remaining elements │ │ │ │ Rest is 1 + the length of Rest.

          (Advanced readers only: This is not tail recursive, there is a better way to │ │ │ │ write this function.)

          In general, tuples are used where "records" or "structs" are used in other │ │ │ │ languages. Also, lists are used when representing things with varying sizes, │ │ │ │ that is, where linked lists are used in other languages.

          Erlang does not have a string data type. Instead, strings can be represented by │ │ │ │ lists of Unicode characters. This implies for example that the list [97,98,99] │ │ │ │ is equivalent to "abc". The Erlang shell is "clever" and guesses what list you │ │ │ │ -mean and outputs it in what it thinks is the most appropriate form, for example:

          30> [97,98,99].
          │ │ │ │ +mean and outputs it in what it thinks is the most appropriate form, for example:

          30> [97,98,99].
          │ │ │ │  "abc"

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Maps │ │ │ │

          │ │ │ │

          Maps are a set of key to value associations. These associations are encapsulated │ │ │ │ -with #{ and }. To create an association from "key" to value 42:

          > #{ "key" => 42 }.
          │ │ │ │ -#{"key" => 42}

          Let us jump straight into the deep end with an example using some interesting │ │ │ │ +with #{ and }. To create an association from "key" to value 42:

          > #{ "key" => 42 }.
          │ │ │ │ +#{"key" => 42}

          Let us jump straight into the deep end with an example using some interesting │ │ │ │ features.

          The following example shows how to calculate alpha blending using maps to │ │ │ │ -reference color and alpha channels. Enter the code in a file named color.erl):

          -module(color).
          │ │ │ │ +reference color and alpha channels. Enter the code in a file named color.erl):

          -module(color).
          │ │ │ │  
          │ │ │ │ --export([new/4, blend/2]).
          │ │ │ │ +-export([new/4, blend/2]).
          │ │ │ │  
          │ │ │ │ --define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).
          │ │ │ │ +-define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).
          │ │ │ │  
          │ │ │ │ -new(R,G,B,A) when ?is_channel(R), ?is_channel(G),
          │ │ │ │ -                  ?is_channel(B), ?is_channel(A) ->
          │ │ │ │ -    #{red => R, green => G, blue => B, alpha => A}.
          │ │ │ │ -
          │ │ │ │ -blend(Src,Dst) ->
          │ │ │ │ -    blend(Src,Dst,alpha(Src,Dst)).
          │ │ │ │ -
          │ │ │ │ -blend(Src,Dst,Alpha) when Alpha > 0.0 ->
          │ │ │ │ -    Dst#{
          │ │ │ │ -        red   := red(Src,Dst) / Alpha,
          │ │ │ │ -        green := green(Src,Dst) / Alpha,
          │ │ │ │ -        blue  := blue(Src,Dst) / Alpha,
          │ │ │ │ +new(R,G,B,A) when ?is_channel(R), ?is_channel(G),
          │ │ │ │ +                  ?is_channel(B), ?is_channel(A) ->
          │ │ │ │ +    #{red => R, green => G, blue => B, alpha => A}.
          │ │ │ │ +
          │ │ │ │ +blend(Src,Dst) ->
          │ │ │ │ +    blend(Src,Dst,alpha(Src,Dst)).
          │ │ │ │ +
          │ │ │ │ +blend(Src,Dst,Alpha) when Alpha > 0.0 ->
          │ │ │ │ +    Dst#{
          │ │ │ │ +        red   := red(Src,Dst) / Alpha,
          │ │ │ │ +        green := green(Src,Dst) / Alpha,
          │ │ │ │ +        blue  := blue(Src,Dst) / Alpha,
          │ │ │ │          alpha := Alpha
          │ │ │ │ -    };
          │ │ │ │ -blend(_,Dst,_) ->
          │ │ │ │ -    Dst#{
          │ │ │ │ +    };
          │ │ │ │ +blend(_,Dst,_) ->
          │ │ │ │ +    Dst#{
          │ │ │ │          red   := 0.0,
          │ │ │ │          green := 0.0,
          │ │ │ │          blue  := 0.0,
          │ │ │ │          alpha := 0.0
          │ │ │ │ -    }.
          │ │ │ │ +    }.
          │ │ │ │  
          │ │ │ │ -alpha(#{alpha := SA}, #{alpha := DA}) ->
          │ │ │ │ -    SA + DA*(1.0 - SA).
          │ │ │ │ +alpha(#{alpha := SA}, #{alpha := DA}) ->
          │ │ │ │ +    SA + DA*(1.0 - SA).
          │ │ │ │  
          │ │ │ │ -red(#{red := SV, alpha := SA}, #{red := DV, alpha := DA}) ->
          │ │ │ │ -    SV*SA + DV*DA*(1.0 - SA).
          │ │ │ │ -green(#{green := SV, alpha := SA}, #{green := DV, alpha := DA}) ->
          │ │ │ │ -    SV*SA + DV*DA*(1.0 - SA).
          │ │ │ │ -blue(#{blue := SV, alpha := SA}, #{blue := DV, alpha := DA}) ->
          │ │ │ │ -    SV*SA + DV*DA*(1.0 - SA).

          Compile and test:

          > c(color).
          │ │ │ │ -{ok,color}
          │ │ │ │ -> C1 = color:new(0.3,0.4,0.5,1.0).
          │ │ │ │ -#{alpha => 1.0,blue => 0.5,green => 0.4,red => 0.3}
          │ │ │ │ -> C2 = color:new(1.0,0.8,0.1,0.3).
          │ │ │ │ -#{alpha => 0.3,blue => 0.1,green => 0.8,red => 1.0}
          │ │ │ │ -> color:blend(C1,C2).
          │ │ │ │ -#{alpha => 1.0,blue => 0.5,green => 0.4,red => 0.3}
          │ │ │ │ -> color:blend(C2,C1).
          │ │ │ │ -#{alpha => 1.0,blue => 0.38,green => 0.52,red => 0.51}

          This example warrants some explanation:

          -define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).

          First a macro is_channel is defined to help with the guard tests. This is only │ │ │ │ +red(#{red := SV, alpha := SA}, #{red := DV, alpha := DA}) -> │ │ │ │ + SV*SA + DV*DA*(1.0 - SA). │ │ │ │ +green(#{green := SV, alpha := SA}, #{green := DV, alpha := DA}) -> │ │ │ │ + SV*SA + DV*DA*(1.0 - SA). │ │ │ │ +blue(#{blue := SV, alpha := SA}, #{blue := DV, alpha := DA}) -> │ │ │ │ + SV*SA + DV*DA*(1.0 - SA).

          Compile and test:

          > c(color).
          │ │ │ │ +{ok,color}
          │ │ │ │ +> C1 = color:new(0.3,0.4,0.5,1.0).
          │ │ │ │ +#{alpha => 1.0,blue => 0.5,green => 0.4,red => 0.3}
          │ │ │ │ +> C2 = color:new(1.0,0.8,0.1,0.3).
          │ │ │ │ +#{alpha => 0.3,blue => 0.1,green => 0.8,red => 1.0}
          │ │ │ │ +> color:blend(C1,C2).
          │ │ │ │ +#{alpha => 1.0,blue => 0.5,green => 0.4,red => 0.3}
          │ │ │ │ +> color:blend(C2,C1).
          │ │ │ │ +#{alpha => 1.0,blue => 0.38,green => 0.52,red => 0.51}

          This example warrants some explanation:

          -define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).

          First a macro is_channel is defined to help with the guard tests. This is only │ │ │ │ here for convenience and to reduce syntax cluttering. For more information about │ │ │ │ -macros, see The Preprocessor.

          new(R,G,B,A) when ?is_channel(R), ?is_channel(G),
          │ │ │ │ -                  ?is_channel(B), ?is_channel(A) ->
          │ │ │ │ -    #{red => R, green => G, blue => B, alpha => A}.

          The function new/4 creates a new map term and lets the keys red, green, │ │ │ │ +macros, see The Preprocessor.

          new(R,G,B,A) when ?is_channel(R), ?is_channel(G),
          │ │ │ │ +                  ?is_channel(B), ?is_channel(A) ->
          │ │ │ │ +    #{red => R, green => G, blue => B, alpha => A}.

          The function new/4 creates a new map term and lets the keys red, green, │ │ │ │ blue, and alpha be associated with an initial value. In this case, only │ │ │ │ float values between and including 0.0 and 1.0 are allowed, as ensured by the │ │ │ │ ?is_channel/1 macro for each argument. Only the => operator is allowed when │ │ │ │ creating a new map.

          By calling blend/2 on any color term created by new/4, the resulting color │ │ │ │ -can be calculated as determined by the two map terms.

          The first thing blend/2 does is to calculate the resulting alpha channel:

          alpha(#{alpha := SA}, #{alpha := DA}) ->
          │ │ │ │ -    SA + DA*(1.0 - SA).

          The value associated with key alpha is fetched for both arguments using the │ │ │ │ +can be calculated as determined by the two map terms.

          The first thing blend/2 does is to calculate the resulting alpha channel:

          alpha(#{alpha := SA}, #{alpha := DA}) ->
          │ │ │ │ +    SA + DA*(1.0 - SA).

          The value associated with key alpha is fetched for both arguments using the │ │ │ │ := operator. The other keys in the map are ignored, only the key alpha is │ │ │ │ -required and checked for.

          This is also the case for functions red/2, blue/2, and green/2.

          red(#{red := SV, alpha := SA}, #{red := DV, alpha := DA}) ->
          │ │ │ │ -    SV*SA + DV*DA*(1.0 - SA).

          The difference here is that a check is made for two keys in each map argument. │ │ │ │ -The other keys are ignored.

          Finally, let us return the resulting color in blend/3:

          blend(Src,Dst,Alpha) when Alpha > 0.0 ->
          │ │ │ │ -    Dst#{
          │ │ │ │ -        red   := red(Src,Dst) / Alpha,
          │ │ │ │ -        green := green(Src,Dst) / Alpha,
          │ │ │ │ -        blue  := blue(Src,Dst) / Alpha,
          │ │ │ │ +required and checked for.

          This is also the case for functions red/2, blue/2, and green/2.

          red(#{red := SV, alpha := SA}, #{red := DV, alpha := DA}) ->
          │ │ │ │ +    SV*SA + DV*DA*(1.0 - SA).

          The difference here is that a check is made for two keys in each map argument. │ │ │ │ +The other keys are ignored.

          Finally, let us return the resulting color in blend/3:

          blend(Src,Dst,Alpha) when Alpha > 0.0 ->
          │ │ │ │ +    Dst#{
          │ │ │ │ +        red   := red(Src,Dst) / Alpha,
          │ │ │ │ +        green := green(Src,Dst) / Alpha,
          │ │ │ │ +        blue  := blue(Src,Dst) / Alpha,
          │ │ │ │          alpha := Alpha
          │ │ │ │ -    };

          The Dst map is updated with new channel values. The syntax for updating an │ │ │ │ + };

          The Dst map is updated with new channel values. The syntax for updating an │ │ │ │ existing key with a new value is with the := operator.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Standard Modules and Manual Pages │ │ │ │

          │ │ │ │

          Erlang has many standard modules to help you do things. For example, the module │ │ │ │ @@ -347,24 +347,24 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Writing Output to a Terminal │ │ │ │ │ │ │ │

          It is nice to be able to do formatted output in examples, so the next example │ │ │ │ shows a simple way to use the io:format/2 function. Like all other exported │ │ │ │ -functions, you can test the io:format/2 function in the shell:

          31> io:format("hello world~n", []).
          │ │ │ │ +functions, you can test the io:format/2 function in the shell:

          31> io:format("hello world~n", []).
          │ │ │ │  hello world
          │ │ │ │  ok
          │ │ │ │ -32> io:format("this outputs one Erlang term: ~w~n", [hello]).
          │ │ │ │ +32> io:format("this outputs one Erlang term: ~w~n", [hello]).
          │ │ │ │  this outputs one Erlang term: hello
          │ │ │ │  ok
          │ │ │ │ -33> io:format("this outputs two Erlang terms: ~w~w~n", [hello, world]).
          │ │ │ │ +33> io:format("this outputs two Erlang terms: ~w~w~n", [hello, world]).
          │ │ │ │  this outputs two Erlang terms: helloworld
          │ │ │ │  ok
          │ │ │ │ -34> io:format("this outputs two Erlang terms: ~w ~w~n", [hello, world]).
          │ │ │ │ +34> io:format("this outputs two Erlang terms: ~w ~w~n", [hello, world]).
          │ │ │ │  this outputs two Erlang terms: hello world
          │ │ │ │  ok

          The function io:format/2 (that is, format with two arguments) takes two lists. │ │ │ │ The first one is nearly always a list written between " ". This list is printed │ │ │ │ out as it is, except that each ~w is replaced by a term taken in order from the │ │ │ │ second list. Each ~n is replaced by a new line. The io:format/2 function │ │ │ │ itself returns the atom ok if everything goes as planned. Like other functions │ │ │ │ in Erlang, it crashes if an error occurs. This is not a fault in Erlang, it is a │ │ │ │ @@ -378,34 +378,34 @@ │ │ │ │ A Larger Example │ │ │ │ │ │ │ │

          Now for a larger example to consolidate what you have learnt so far. Assume that │ │ │ │ you have a list of temperature readings from a number of cities in the world. │ │ │ │ Some of them are in Celsius and some in Fahrenheit (as in the previous list). │ │ │ │ First let us convert them all to Celsius, then let us print the data neatly.

          %% This module is in file tut5.erl
          │ │ │ │  
          │ │ │ │ --module(tut5).
          │ │ │ │ --export([format_temps/1]).
          │ │ │ │ +-module(tut5).
          │ │ │ │ +-export([format_temps/1]).
          │ │ │ │  
          │ │ │ │  %% Only this function is exported
          │ │ │ │ -format_temps([])->                        % No output for an empty list
          │ │ │ │ +format_temps([])->                        % No output for an empty list
          │ │ │ │      ok;
          │ │ │ │ -format_temps([City | Rest]) ->
          │ │ │ │ -    print_temp(convert_to_celsius(City)),
          │ │ │ │ -    format_temps(Rest).
          │ │ │ │ -
          │ │ │ │ -convert_to_celsius({Name, {c, Temp}}) ->  % No conversion needed
          │ │ │ │ -    {Name, {c, Temp}};
          │ │ │ │ -convert_to_celsius({Name, {f, Temp}}) ->  % Do the conversion
          │ │ │ │ -    {Name, {c, (Temp - 32) * 5 / 9}}.
          │ │ │ │ -
          │ │ │ │ -print_temp({Name, {c, Temp}}) ->
          │ │ │ │ -    io:format("~-15w ~w c~n", [Name, Temp]).
          35> c(tut5).
          │ │ │ │ -{ok,tut5}
          │ │ │ │ -36> tut5:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ +format_temps([City | Rest]) ->
          │ │ │ │ +    print_temp(convert_to_celsius(City)),
          │ │ │ │ +    format_temps(Rest).
          │ │ │ │ +
          │ │ │ │ +convert_to_celsius({Name, {c, Temp}}) ->  % No conversion needed
          │ │ │ │ +    {Name, {c, Temp}};
          │ │ │ │ +convert_to_celsius({Name, {f, Temp}}) ->  % Do the conversion
          │ │ │ │ +    {Name, {c, (Temp - 32) * 5 / 9}}.
          │ │ │ │ +
          │ │ │ │ +print_temp({Name, {c, Temp}}) ->
          │ │ │ │ +    io:format("~-15w ~w c~n", [Name, Temp]).
          35> c(tut5).
          │ │ │ │ +{ok,tut5}
          │ │ │ │ +36> tut5:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │  moscow          -10 c
          │ │ │ │  cape_town       21.11111111111111 c
          │ │ │ │  stockholm       -4 c
          │ │ │ │  paris           -2.2222222222222223 c
          │ │ │ │  london          2.2222222222222223 c
          │ │ │ │  ok

          Before looking at how this program works, notice that a few comments are added │ │ │ │ to the code. A comment starts with a %-character and goes on to the end of the │ │ │ │ @@ -433,28 +433,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Matching, Guards, and Scope of Variables │ │ │ │ │ │ │ │

          It can be useful to find the maximum and minimum temperature in lists like this. │ │ │ │ Before extending the program to do this, let us look at functions for finding │ │ │ │ -the maximum value of the elements in a list:

          -module(tut6).
          │ │ │ │ --export([list_max/1]).
          │ │ │ │ +the maximum value of the elements in a list:

          -module(tut6).
          │ │ │ │ +-export([list_max/1]).
          │ │ │ │  
          │ │ │ │ -list_max([Head|Rest]) ->
          │ │ │ │ -   list_max(Rest, Head).
          │ │ │ │ +list_max([Head|Rest]) ->
          │ │ │ │ +   list_max(Rest, Head).
          │ │ │ │  
          │ │ │ │ -list_max([], Res) ->
          │ │ │ │ +list_max([], Res) ->
          │ │ │ │      Res;
          │ │ │ │ -list_max([Head|Rest], Result_so_far) when Head > Result_so_far ->
          │ │ │ │ -    list_max(Rest, Head);
          │ │ │ │ -list_max([Head|Rest], Result_so_far)  ->
          │ │ │ │ -    list_max(Rest, Result_so_far).
          37> c(tut6).
          │ │ │ │ -{ok,tut6}
          │ │ │ │ -38> tut6:list_max([1,2,3,4,5,7,4,3,2,1]).
          │ │ │ │ +list_max([Head|Rest], Result_so_far) when Head > Result_so_far ->
          │ │ │ │ +    list_max(Rest, Head);
          │ │ │ │ +list_max([Head|Rest], Result_so_far)  ->
          │ │ │ │ +    list_max(Rest, Result_so_far).
          37> c(tut6).
          │ │ │ │ +{ok,tut6}
          │ │ │ │ +38> tut6:list_max([1,2,3,4,5,7,4,3,2,1]).
          │ │ │ │  7

          First notice that two functions have the same name, list_max. However, each of │ │ │ │ these takes a different number of arguments (parameters). In Erlang these are │ │ │ │ regarded as completely different functions. Where you need to distinguish │ │ │ │ between these functions, you write Name/Arity, where Name is the function name │ │ │ │ and Arity is the number of arguments, in this case list_max/1 and │ │ │ │ list_max/2.

          In this example you walk through a list "carrying" a value, in this case │ │ │ │ Result_so_far. list_max/1 simply assumes that the max value of the list is │ │ │ │ @@ -483,180 +483,180 @@ │ │ │ │ 5 │ │ │ │ 40> M = 6. │ │ │ │ ** exception error: no match of right hand side value 6 │ │ │ │ 41> M = M + 1. │ │ │ │ ** exception error: no match of right hand side value 6 │ │ │ │ 42> N = M + 1. │ │ │ │ 6

          The use of the match operator is particularly useful for pulling apart Erlang │ │ │ │ -terms and creating new ones.

          43> {X, Y} = {paris, {f, 28}}.
          │ │ │ │ -{paris,{f,28}}
          │ │ │ │ +terms and creating new ones.

          43> {X, Y} = {paris, {f, 28}}.
          │ │ │ │ +{paris,{f,28}}
          │ │ │ │  44> X.
          │ │ │ │  paris
          │ │ │ │  45> Y.
          │ │ │ │ -{f,28}

          Here X gets the value paris and Y the value {f,28}.

          If you try to do the same again with another city, an error is returned:

          46> {X, Y} = {london, {f, 36}}.
          │ │ │ │ +{f,28}

          Here X gets the value paris and Y the value {f,28}.

          If you try to do the same again with another city, an error is returned:

          46> {X, Y} = {london, {f, 36}}.
          │ │ │ │  ** exception error: no match of right hand side value {london,{f,36}}

          Variables can also be used to improve the readability of programs. For example, │ │ │ │ -in function list_max/2 above, you can write:

          list_max([Head|Rest], Result_so_far) when Head > Result_so_far ->
          │ │ │ │ +in function list_max/2 above, you can write:

          list_max([Head|Rest], Result_so_far) when Head > Result_so_far ->
          │ │ │ │      New_result_far = Head,
          │ │ │ │ -    list_max(Rest, New_result_far);

          This is possibly a little clearer.

          │ │ │ │ + list_max(Rest, New_result_far);

          This is possibly a little clearer.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ More About Lists │ │ │ │

          │ │ │ │ -

          Remember that the | operator can be used to get the head of a list:

          47> [M1|T1] = [paris, london, rome].
          │ │ │ │ -[paris,london,rome]
          │ │ │ │ +

          Remember that the | operator can be used to get the head of a list:

          47> [M1|T1] = [paris, london, rome].
          │ │ │ │ +[paris,london,rome]
          │ │ │ │  48> M1.
          │ │ │ │  paris
          │ │ │ │  49> T1.
          │ │ │ │ -[london,rome]

          The | operator can also be used to add a head to a list:

          50> L1 = [madrid | T1].
          │ │ │ │ -[madrid,london,rome]
          │ │ │ │ +[london,rome]

          The | operator can also be used to add a head to a list:

          50> L1 = [madrid | T1].
          │ │ │ │ +[madrid,london,rome]
          │ │ │ │  51> L1.
          │ │ │ │ -[madrid,london,rome]

          Now an example of this when working with lists - reversing the order of a list:

          -module(tut8).
          │ │ │ │ +[madrid,london,rome]

          Now an example of this when working with lists - reversing the order of a list:

          -module(tut8).
          │ │ │ │  
          │ │ │ │ --export([reverse/1]).
          │ │ │ │ +-export([reverse/1]).
          │ │ │ │  
          │ │ │ │ -reverse(List) ->
          │ │ │ │ -    reverse(List, []).
          │ │ │ │ +reverse(List) ->
          │ │ │ │ +    reverse(List, []).
          │ │ │ │  
          │ │ │ │ -reverse([Head | Rest], Reversed_List) ->
          │ │ │ │ -    reverse(Rest, [Head | Reversed_List]);
          │ │ │ │ -reverse([], Reversed_List) ->
          │ │ │ │ -    Reversed_List.
          52> c(tut8).
          │ │ │ │ -{ok,tut8}
          │ │ │ │ -53> tut8:reverse([1,2,3]).
          │ │ │ │ -[3,2,1]

          Consider how Reversed_List is built. It starts as [], then successively the │ │ │ │ +reverse([Head | Rest], Reversed_List) -> │ │ │ │ + reverse(Rest, [Head | Reversed_List]); │ │ │ │ +reverse([], Reversed_List) -> │ │ │ │ + Reversed_List.

          52> c(tut8).
          │ │ │ │ +{ok,tut8}
          │ │ │ │ +53> tut8:reverse([1,2,3]).
          │ │ │ │ +[3,2,1]

          Consider how Reversed_List is built. It starts as [], then successively the │ │ │ │ heads are taken off of the list to be reversed and added to the the │ │ │ │ -Reversed_List, as shown in the following:

          reverse([1|2,3], []) =>
          │ │ │ │ -    reverse([2,3], [1|[]])
          │ │ │ │ +Reversed_List, as shown in the following:

          reverse([1|2,3], []) =>
          │ │ │ │ +    reverse([2,3], [1|[]])
          │ │ │ │  
          │ │ │ │ -reverse([2|3], [1]) =>
          │ │ │ │ -    reverse([3], [2|[1])
          │ │ │ │ +reverse([2|3], [1]) =>
          │ │ │ │ +    reverse([3], [2|[1])
          │ │ │ │  
          │ │ │ │ -reverse([3|[]], [2,1]) =>
          │ │ │ │ -    reverse([], [3|[2,1]])
          │ │ │ │ +reverse([3|[]], [2,1]) =>
          │ │ │ │ +    reverse([], [3|[2,1]])
          │ │ │ │  
          │ │ │ │ -reverse([], [3,2,1]) =>
          │ │ │ │ -    [3,2,1]

          The module lists contains many functions for manipulating lists, for example, │ │ │ │ +reverse([], [3,2,1]) => │ │ │ │ + [3,2,1]

          The module lists contains many functions for manipulating lists, for example, │ │ │ │ for reversing them. So before writing a list-manipulating function it is a good │ │ │ │ idea to check if one not already is written for you (see the lists manual │ │ │ │ page in STDLIB).

          Now let us get back to the cities and temperatures, but take a more structured │ │ │ │ -approach this time. First let us convert the whole list to Celsius as follows:

          -module(tut7).
          │ │ │ │ --export([format_temps/1]).
          │ │ │ │ +approach this time. First let us convert the whole list to Celsius as follows:

          -module(tut7).
          │ │ │ │ +-export([format_temps/1]).
          │ │ │ │  
          │ │ │ │ -format_temps(List_of_cities) ->
          │ │ │ │ -    convert_list_to_c(List_of_cities).
          │ │ │ │ +format_temps(List_of_cities) ->
          │ │ │ │ +    convert_list_to_c(List_of_cities).
          │ │ │ │  
          │ │ │ │ -convert_list_to_c([{Name, {f, F}} | Rest]) ->
          │ │ │ │ -    Converted_City = {Name, {c, (F -32)* 5 / 9}},
          │ │ │ │ -    [Converted_City | convert_list_to_c(Rest)];
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c([City | Rest]) ->
          │ │ │ │ -    [City | convert_list_to_c(Rest)];
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c([]) ->
          │ │ │ │ -    [].

          Test the function:

          54> c(tut7).
          │ │ │ │ -{ok, tut7}.
          │ │ │ │ -55> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ -[{moscow,{c,-10}},
          │ │ │ │ - {cape_town,{c,21.11111111111111}},
          │ │ │ │ - {stockholm,{c,-4}},
          │ │ │ │ - {paris,{c,-2.2222222222222223}},
          │ │ │ │ - {london,{c,2.2222222222222223}}]

          Explanation:

          format_temps(List_of_cities) ->
          │ │ │ │ -    convert_list_to_c(List_of_cities).

          Here format_temps/1 calls convert_list_to_c/1. convert_list_to_c/1 takes │ │ │ │ +convert_list_to_c([{Name, {f, F}} | Rest]) -> │ │ │ │ + Converted_City = {Name, {c, (F -32)* 5 / 9}}, │ │ │ │ + [Converted_City | convert_list_to_c(Rest)]; │ │ │ │ + │ │ │ │ +convert_list_to_c([City | Rest]) -> │ │ │ │ + [City | convert_list_to_c(Rest)]; │ │ │ │ + │ │ │ │ +convert_list_to_c([]) -> │ │ │ │ + [].

          Test the function:

          54> c(tut7).
          │ │ │ │ +{ok, tut7}.
          │ │ │ │ +55> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ +[{moscow,{c,-10}},
          │ │ │ │ + {cape_town,{c,21.11111111111111}},
          │ │ │ │ + {stockholm,{c,-4}},
          │ │ │ │ + {paris,{c,-2.2222222222222223}},
          │ │ │ │ + {london,{c,2.2222222222222223}}]

          Explanation:

          format_temps(List_of_cities) ->
          │ │ │ │ +    convert_list_to_c(List_of_cities).

          Here format_temps/1 calls convert_list_to_c/1. convert_list_to_c/1 takes │ │ │ │ off the head of the List_of_cities, converts it to Celsius if needed. The | │ │ │ │ -operator is used to add the (maybe) converted to the converted rest of the list:

          [Converted_City | convert_list_to_c(Rest)];

          or:

          [City | convert_list_to_c(Rest)];

          This is done until the end of the list is reached, that is, the list is empty:

          convert_list_to_c([]) ->
          │ │ │ │ -    [].

          Now when the list is converted, a function to print it is added:

          -module(tut7).
          │ │ │ │ --export([format_temps/1]).
          │ │ │ │ -
          │ │ │ │ -format_temps(List_of_cities) ->
          │ │ │ │ -    Converted_List = convert_list_to_c(List_of_cities),
          │ │ │ │ -    print_temp(Converted_List).
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c([{Name, {f, F}} | Rest]) ->
          │ │ │ │ -    Converted_City = {Name, {c, (F -32)* 5 / 9}},
          │ │ │ │ -    [Converted_City | convert_list_to_c(Rest)];
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c([City | Rest]) ->
          │ │ │ │ -    [City | convert_list_to_c(Rest)];
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c([]) ->
          │ │ │ │ -    [].
          │ │ │ │ -
          │ │ │ │ -print_temp([{Name, {c, Temp}} | Rest]) ->
          │ │ │ │ -    io:format("~-15w ~w c~n", [Name, Temp]),
          │ │ │ │ -    print_temp(Rest);
          │ │ │ │ -print_temp([]) ->
          │ │ │ │ -    ok.
          56> c(tut7).
          │ │ │ │ -{ok,tut7}
          │ │ │ │ -57> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ +operator is used to add the (maybe) converted to the converted rest of the list:

          [Converted_City | convert_list_to_c(Rest)];

          or:

          [City | convert_list_to_c(Rest)];

          This is done until the end of the list is reached, that is, the list is empty:

          convert_list_to_c([]) ->
          │ │ │ │ +    [].

          Now when the list is converted, a function to print it is added:

          -module(tut7).
          │ │ │ │ +-export([format_temps/1]).
          │ │ │ │ +
          │ │ │ │ +format_temps(List_of_cities) ->
          │ │ │ │ +    Converted_List = convert_list_to_c(List_of_cities),
          │ │ │ │ +    print_temp(Converted_List).
          │ │ │ │ +
          │ │ │ │ +convert_list_to_c([{Name, {f, F}} | Rest]) ->
          │ │ │ │ +    Converted_City = {Name, {c, (F -32)* 5 / 9}},
          │ │ │ │ +    [Converted_City | convert_list_to_c(Rest)];
          │ │ │ │ +
          │ │ │ │ +convert_list_to_c([City | Rest]) ->
          │ │ │ │ +    [City | convert_list_to_c(Rest)];
          │ │ │ │ +
          │ │ │ │ +convert_list_to_c([]) ->
          │ │ │ │ +    [].
          │ │ │ │ +
          │ │ │ │ +print_temp([{Name, {c, Temp}} | Rest]) ->
          │ │ │ │ +    io:format("~-15w ~w c~n", [Name, Temp]),
          │ │ │ │ +    print_temp(Rest);
          │ │ │ │ +print_temp([]) ->
          │ │ │ │ +    ok.
          56> c(tut7).
          │ │ │ │ +{ok,tut7}
          │ │ │ │ +57> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │  moscow          -10 c
          │ │ │ │  cape_town       21.11111111111111 c
          │ │ │ │  stockholm       -4 c
          │ │ │ │  paris           -2.2222222222222223 c
          │ │ │ │  london          2.2222222222222223 c
          │ │ │ │  ok

          Now a function has to be added to find the cities with the maximum and minimum │ │ │ │ temperatures. The following program is not the most efficient way of doing this │ │ │ │ as you walk through the list of cities four times. But it is better to first │ │ │ │ strive for clarity and correctness and to make programs efficient only if │ │ │ │ -needed.

          -module(tut7).
          │ │ │ │ --export([format_temps/1]).
          │ │ │ │ +needed.

          -module(tut7).
          │ │ │ │ +-export([format_temps/1]).
          │ │ │ │  
          │ │ │ │ -format_temps(List_of_cities) ->
          │ │ │ │ -    Converted_List = convert_list_to_c(List_of_cities),
          │ │ │ │ -    print_temp(Converted_List),
          │ │ │ │ -    {Max_city, Min_city} = find_max_and_min(Converted_List),
          │ │ │ │ -    print_max_and_min(Max_city, Min_city).
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c([{Name, {f, Temp}} | Rest]) ->
          │ │ │ │ -    Converted_City = {Name, {c, (Temp -32)* 5 / 9}},
          │ │ │ │ -    [Converted_City | convert_list_to_c(Rest)];
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c([City | Rest]) ->
          │ │ │ │ -    [City | convert_list_to_c(Rest)];
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c([]) ->
          │ │ │ │ -    [].
          │ │ │ │ -
          │ │ │ │ -print_temp([{Name, {c, Temp}} | Rest]) ->
          │ │ │ │ -    io:format("~-15w ~w c~n", [Name, Temp]),
          │ │ │ │ -    print_temp(Rest);
          │ │ │ │ -print_temp([]) ->
          │ │ │ │ +format_temps(List_of_cities) ->
          │ │ │ │ +    Converted_List = convert_list_to_c(List_of_cities),
          │ │ │ │ +    print_temp(Converted_List),
          │ │ │ │ +    {Max_city, Min_city} = find_max_and_min(Converted_List),
          │ │ │ │ +    print_max_and_min(Max_city, Min_city).
          │ │ │ │ +
          │ │ │ │ +convert_list_to_c([{Name, {f, Temp}} | Rest]) ->
          │ │ │ │ +    Converted_City = {Name, {c, (Temp -32)* 5 / 9}},
          │ │ │ │ +    [Converted_City | convert_list_to_c(Rest)];
          │ │ │ │ +
          │ │ │ │ +convert_list_to_c([City | Rest]) ->
          │ │ │ │ +    [City | convert_list_to_c(Rest)];
          │ │ │ │ +
          │ │ │ │ +convert_list_to_c([]) ->
          │ │ │ │ +    [].
          │ │ │ │ +
          │ │ │ │ +print_temp([{Name, {c, Temp}} | Rest]) ->
          │ │ │ │ +    io:format("~-15w ~w c~n", [Name, Temp]),
          │ │ │ │ +    print_temp(Rest);
          │ │ │ │ +print_temp([]) ->
          │ │ │ │      ok.
          │ │ │ │  
          │ │ │ │ -find_max_and_min([City | Rest]) ->
          │ │ │ │ -    find_max_and_min(Rest, City, City).
          │ │ │ │ +find_max_and_min([City | Rest]) ->
          │ │ │ │ +    find_max_and_min(Rest, City, City).
          │ │ │ │  
          │ │ │ │ -find_max_and_min([{Name, {c, Temp}} | Rest],
          │ │ │ │ -         {Max_Name, {c, Max_Temp}},
          │ │ │ │ -         {Min_Name, {c, Min_Temp}}) ->
          │ │ │ │ +find_max_and_min([{Name, {c, Temp}} | Rest],
          │ │ │ │ +         {Max_Name, {c, Max_Temp}},
          │ │ │ │ +         {Min_Name, {c, Min_Temp}}) ->
          │ │ │ │      if
          │ │ │ │          Temp > Max_Temp ->
          │ │ │ │ -            Max_City = {Name, {c, Temp}};           % Change
          │ │ │ │ +            Max_City = {Name, {c, Temp}};           % Change
          │ │ │ │          true ->
          │ │ │ │ -            Max_City = {Max_Name, {c, Max_Temp}} % Unchanged
          │ │ │ │ +            Max_City = {Max_Name, {c, Max_Temp}} % Unchanged
          │ │ │ │      end,
          │ │ │ │      if
          │ │ │ │           Temp < Min_Temp ->
          │ │ │ │ -            Min_City = {Name, {c, Temp}};           % Change
          │ │ │ │ +            Min_City = {Name, {c, Temp}};           % Change
          │ │ │ │          true ->
          │ │ │ │ -            Min_City = {Min_Name, {c, Min_Temp}} % Unchanged
          │ │ │ │ +            Min_City = {Min_Name, {c, Min_Temp}} % Unchanged
          │ │ │ │      end,
          │ │ │ │ -    find_max_and_min(Rest, Max_City, Min_City);
          │ │ │ │ +    find_max_and_min(Rest, Max_City, Min_City);
          │ │ │ │  
          │ │ │ │ -find_max_and_min([], Max_City, Min_City) ->
          │ │ │ │ -    {Max_City, Min_City}.
          │ │ │ │ +find_max_and_min([], Max_City, Min_City) ->
          │ │ │ │ +    {Max_City, Min_City}.
          │ │ │ │  
          │ │ │ │ -print_max_and_min({Max_name, {c, Max_temp}}, {Min_name, {c, Min_temp}}) ->
          │ │ │ │ -    io:format("Max temperature was ~w c in ~w~n", [Max_temp, Max_name]),
          │ │ │ │ -    io:format("Min temperature was ~w c in ~w~n", [Min_temp, Min_name]).
          58> c(tut7).
          │ │ │ │ -{ok, tut7}
          │ │ │ │ -59> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ +print_max_and_min({Max_name, {c, Max_temp}}, {Min_name, {c, Min_temp}}) ->
          │ │ │ │ +    io:format("Max temperature was ~w c in ~w~n", [Max_temp, Max_name]),
          │ │ │ │ +    io:format("Min temperature was ~w c in ~w~n", [Min_temp, Min_name]).
          58> c(tut7).
          │ │ │ │ +{ok, tut7}
          │ │ │ │ +59> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │  moscow          -10 c
          │ │ │ │  cape_town       21.11111111111111 c
          │ │ │ │  stockholm       -4 c
          │ │ │ │  paris           -2.2222222222222223 c
          │ │ │ │  london          2.2222222222222223 c
          │ │ │ │  Max temperature was 21.11111111111111 c in cape_town
          │ │ │ │  Min temperature was -10 c in moscow
          │ │ │ │ @@ -678,88 +678,88 @@
          │ │ │ │          Action 4
          │ │ │ │  end

          Notice that there is no ; before end. Conditions do the same as guards, that │ │ │ │ is, tests that succeed or fail. Erlang starts at the top and tests until it │ │ │ │ finds a condition that succeeds. Then it evaluates (performs) the action │ │ │ │ following the condition and ignores all other conditions and actions before the │ │ │ │ end. If no condition matches, a run-time failure occurs. A condition that │ │ │ │ always succeeds is the atom true. This is often used last in an if, meaning, │ │ │ │ -do the action following the true if all other conditions have failed.

          The following is a short program to show the workings of if.

          -module(tut9).
          │ │ │ │ --export([test_if/2]).
          │ │ │ │ +do the action following the true if all other conditions have failed.

          The following is a short program to show the workings of if.

          -module(tut9).
          │ │ │ │ +-export([test_if/2]).
          │ │ │ │  
          │ │ │ │ -test_if(A, B) ->
          │ │ │ │ +test_if(A, B) ->
          │ │ │ │      if
          │ │ │ │          A == 5 ->
          │ │ │ │ -            io:format("A == 5~n", []),
          │ │ │ │ +            io:format("A == 5~n", []),
          │ │ │ │              a_equals_5;
          │ │ │ │          B == 6 ->
          │ │ │ │ -            io:format("B == 6~n", []),
          │ │ │ │ +            io:format("B == 6~n", []),
          │ │ │ │              b_equals_6;
          │ │ │ │          A == 2, B == 3 ->                      %That is A equals 2 and B equals 3
          │ │ │ │ -            io:format("A == 2, B == 3~n", []),
          │ │ │ │ +            io:format("A == 2, B == 3~n", []),
          │ │ │ │              a_equals_2_b_equals_3;
          │ │ │ │          A == 1 ; B == 7 ->                     %That is A equals 1 or B equals 7
          │ │ │ │ -            io:format("A == 1 ; B == 7~n", []),
          │ │ │ │ +            io:format("A == 1 ; B == 7~n", []),
          │ │ │ │              a_equals_1_or_b_equals_7
          │ │ │ │ -    end.

          Testing this program gives:

          60> c(tut9).
          │ │ │ │ -{ok,tut9}
          │ │ │ │ -61> tut9:test_if(5,33).
          │ │ │ │ +    end.

          Testing this program gives:

          60> c(tut9).
          │ │ │ │ +{ok,tut9}
          │ │ │ │ +61> tut9:test_if(5,33).
          │ │ │ │  A == 5
          │ │ │ │  a_equals_5
          │ │ │ │ -62> tut9:test_if(33,6).
          │ │ │ │ +62> tut9:test_if(33,6).
          │ │ │ │  B == 6
          │ │ │ │  b_equals_6
          │ │ │ │ -63> tut9:test_if(2, 3).
          │ │ │ │ +63> tut9:test_if(2, 3).
          │ │ │ │  A == 2, B == 3
          │ │ │ │  a_equals_2_b_equals_3
          │ │ │ │ -64> tut9:test_if(1, 33).
          │ │ │ │ +64> tut9:test_if(1, 33).
          │ │ │ │  A == 1 ; B == 7
          │ │ │ │  a_equals_1_or_b_equals_7
          │ │ │ │ -65> tut9:test_if(33, 7).
          │ │ │ │ +65> tut9:test_if(33, 7).
          │ │ │ │  A == 1 ; B == 7
          │ │ │ │  a_equals_1_or_b_equals_7
          │ │ │ │ -66> tut9:test_if(33, 33).
          │ │ │ │ +66> tut9:test_if(33, 33).
          │ │ │ │  ** exception error: no true branch found when evaluating an if expression
          │ │ │ │       in function  tut9:test_if/2 (tut9.erl, line 5)

          Notice that tut9:test_if(33,33) does not cause any condition to succeed. This │ │ │ │ leads to the run time error if_clause, here nicely formatted by the shell. See │ │ │ │ Guard Sequences for details of the many guard tests │ │ │ │ available.

          case is another construct in Erlang. Recall that the convert_length function │ │ │ │ -was written as:

          convert_length({centimeter, X}) ->
          │ │ │ │ -    {inch, X / 2.54};
          │ │ │ │ -convert_length({inch, Y}) ->
          │ │ │ │ -    {centimeter, Y * 2.54}.

          The same program can also be written as:

          -module(tut10).
          │ │ │ │ --export([convert_length/1]).
          │ │ │ │ +was written as:

          convert_length({centimeter, X}) ->
          │ │ │ │ +    {inch, X / 2.54};
          │ │ │ │ +convert_length({inch, Y}) ->
          │ │ │ │ +    {centimeter, Y * 2.54}.

          The same program can also be written as:

          -module(tut10).
          │ │ │ │ +-export([convert_length/1]).
          │ │ │ │  
          │ │ │ │ -convert_length(Length) ->
          │ │ │ │ +convert_length(Length) ->
          │ │ │ │      case Length of
          │ │ │ │ -        {centimeter, X} ->
          │ │ │ │ -            {inch, X / 2.54};
          │ │ │ │ -        {inch, Y} ->
          │ │ │ │ -            {centimeter, Y * 2.54}
          │ │ │ │ -    end.
          67> c(tut10).
          │ │ │ │ -{ok,tut10}
          │ │ │ │ -68> tut10:convert_length({inch, 6}).
          │ │ │ │ -{centimeter,15.24}
          │ │ │ │ -69> tut10:convert_length({centimeter, 2.5}).
          │ │ │ │ -{inch,0.984251968503937}

          Both case and if have return values, that is, in the above example case │ │ │ │ + {centimeter, X} -> │ │ │ │ + {inch, X / 2.54}; │ │ │ │ + {inch, Y} -> │ │ │ │ + {centimeter, Y * 2.54} │ │ │ │ + end.

          67> c(tut10).
          │ │ │ │ +{ok,tut10}
          │ │ │ │ +68> tut10:convert_length({inch, 6}).
          │ │ │ │ +{centimeter,15.24}
          │ │ │ │ +69> tut10:convert_length({centimeter, 2.5}).
          │ │ │ │ +{inch,0.984251968503937}

          Both case and if have return values, that is, in the above example case │ │ │ │ returned either {inch,X/2.54} or {centimeter,Y*2.54}. The behaviour of │ │ │ │ case can also be modified by using guards. The following example clarifies │ │ │ │ this. It tells us the length of a month, given the year. The year must be known, │ │ │ │ -since February has 29 days in a leap year.

          -module(tut11).
          │ │ │ │ --export([month_length/2]).
          │ │ │ │ +since February has 29 days in a leap year.

          -module(tut11).
          │ │ │ │ +-export([month_length/2]).
          │ │ │ │  
          │ │ │ │ -month_length(Year, Month) ->
          │ │ │ │ +month_length(Year, Month) ->
          │ │ │ │      %% All years divisible by 400 are leap
          │ │ │ │      %% Years divisible by 100 are not leap (except the 400 rule above)
          │ │ │ │      %% Years divisible by 4 are leap (except the 100 rule above)
          │ │ │ │      Leap = if
          │ │ │ │ -        trunc(Year / 400) * 400 == Year ->
          │ │ │ │ +        trunc(Year / 400) * 400 == Year ->
          │ │ │ │              leap;
          │ │ │ │ -        trunc(Year / 100) * 100 == Year ->
          │ │ │ │ +        trunc(Year / 100) * 100 == Year ->
          │ │ │ │              not_leap;
          │ │ │ │ -        trunc(Year / 4) * 4 == Year ->
          │ │ │ │ +        trunc(Year / 4) * 4 == Year ->
          │ │ │ │              leap;
          │ │ │ │          true ->
          │ │ │ │              not_leap
          │ │ │ │      end,
          │ │ │ │      case Month of
          │ │ │ │          sep -> 30;
          │ │ │ │          apr -> 30;
          │ │ │ │ @@ -770,151 +770,151 @@
          │ │ │ │          jan -> 31;
          │ │ │ │          mar -> 31;
          │ │ │ │          may -> 31;
          │ │ │ │          jul -> 31;
          │ │ │ │          aug -> 31;
          │ │ │ │          oct -> 31;
          │ │ │ │          dec -> 31
          │ │ │ │ -    end.
          70> c(tut11).
          │ │ │ │ -{ok,tut11}
          │ │ │ │ -71> tut11:month_length(2004, feb).
          │ │ │ │ +    end.
          70> c(tut11).
          │ │ │ │ +{ok,tut11}
          │ │ │ │ +71> tut11:month_length(2004, feb).
          │ │ │ │  29
          │ │ │ │ -72> tut11:month_length(2003, feb).
          │ │ │ │ +72> tut11:month_length(2003, feb).
          │ │ │ │  28
          │ │ │ │ -73> tut11:month_length(1947, aug).
          │ │ │ │ +73> tut11:month_length(1947, aug).
          │ │ │ │  31

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Built-In Functions (BIFs) │ │ │ │

          │ │ │ │

          BIFs are functions that for some reason are built-in to the Erlang virtual │ │ │ │ machine. BIFs often implement functionality that is impossible or is too │ │ │ │ inefficient to implement in Erlang. Some BIFs can be called using the function │ │ │ │ name only but they are by default belonging to the erlang module. For example, │ │ │ │ the call to the BIF trunc below is equivalent to a call to erlang:trunc.

          As shown, first it is checked if a year is leap. If a year is divisible by 400, │ │ │ │ it is a leap year. To determine this, first divide the year by 400 and use the │ │ │ │ BIF trunc (more about this later) to cut off any decimals. Then multiply by │ │ │ │ 400 again and see if the same value is returned again. For example, year 2004:

          2004 / 400 = 5.01
          │ │ │ │ -trunc(5.01) = 5
          │ │ │ │ +trunc(5.01) = 5
          │ │ │ │  5 * 400 = 2000

          2000 is not the same as 2004, so 2004 is not divisible by 400. Year 2000:

          2000 / 400 = 5.0
          │ │ │ │ -trunc(5.0) = 5
          │ │ │ │ +trunc(5.0) = 5
          │ │ │ │  5 * 400 = 2000

          That is, a leap year. The next two trunc-tests evaluate if the year is │ │ │ │ divisible by 100 or 4 in the same way. The first if returns leap or │ │ │ │ not_leap, which lands up in the variable Leap. This variable is used in the │ │ │ │ guard for feb in the following case that tells us how long the month is.

          This example showed the use of trunc. It is easier to use the Erlang operator │ │ │ │ rem that gives the remainder after division, for example:

          74> 2004 rem 400.
          │ │ │ │ -4

          So instead of writing:

          trunc(Year / 400) * 400 == Year ->
          │ │ │ │ +4

          So instead of writing:

          trunc(Year / 400) * 400 == Year ->
          │ │ │ │      leap;

          it can be written:

          Year rem 400 == 0 ->
          │ │ │ │      leap;

          There are many other BIFs such as trunc. Only a few BIFs can be used in │ │ │ │ guards, and you cannot use functions you have defined yourself in guards. (see │ │ │ │ Guard Sequences) (For advanced readers: This is to │ │ │ │ ensure that guards do not have side effects.) Let us play with a few of these │ │ │ │ -functions in the shell:

          75> trunc(5.6).
          │ │ │ │ +functions in the shell:

          75> trunc(5.6).
          │ │ │ │  5
          │ │ │ │ -76> round(5.6).
          │ │ │ │ +76> round(5.6).
          │ │ │ │  6
          │ │ │ │ -77> length([a,b,c,d]).
          │ │ │ │ +77> length([a,b,c,d]).
          │ │ │ │  4
          │ │ │ │ -78> float(5).
          │ │ │ │ +78> float(5).
          │ │ │ │  5.0
          │ │ │ │ -79> is_atom(hello).
          │ │ │ │ +79> is_atom(hello).
          │ │ │ │  true
          │ │ │ │ -80> is_atom("hello").
          │ │ │ │ +80> is_atom("hello").
          │ │ │ │  false
          │ │ │ │ -81> is_tuple({paris, {c, 30}}).
          │ │ │ │ +81> is_tuple({paris, {c, 30}}).
          │ │ │ │  true
          │ │ │ │ -82> is_tuple([paris, {c, 30}]).
          │ │ │ │ +82> is_tuple([paris, {c, 30}]).
          │ │ │ │  false

          All of these can be used in guards. Now for some BIFs that cannot be used in │ │ │ │ -guards:

          83> atom_to_list(hello).
          │ │ │ │ +guards:

          83> atom_to_list(hello).
          │ │ │ │  "hello"
          │ │ │ │ -84> list_to_atom("goodbye").
          │ │ │ │ +84> list_to_atom("goodbye").
          │ │ │ │  goodbye
          │ │ │ │ -85> integer_to_list(22).
          │ │ │ │ +85> integer_to_list(22).
          │ │ │ │  "22"

          These three BIFs do conversions that would be difficult (or impossible) to do in │ │ │ │ Erlang.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Higher-Order Functions (Funs) │ │ │ │

          │ │ │ │

          Erlang, like most modern functional programming languages, has higher-order │ │ │ │ -functions. Here is an example using the shell:

          86> Xf = fun(X) -> X * 2 end.
          │ │ │ │ +functions. Here is an example using the shell:

          86> Xf = fun(X) -> X * 2 end.
          │ │ │ │  #Fun<erl_eval.5.123085357>
          │ │ │ │ -87> Xf(5).
          │ │ │ │ +87> Xf(5).
          │ │ │ │  10

          Here is defined a function that doubles the value of a number and assigned this │ │ │ │ function to a variable. Thus Xf(5) returns value 10. Two useful functions when │ │ │ │ -working with lists are foreach and map, which are defined as follows:

          foreach(Fun, [First|Rest]) ->
          │ │ │ │ -    Fun(First),
          │ │ │ │ -    foreach(Fun, Rest);
          │ │ │ │ -foreach(Fun, []) ->
          │ │ │ │ +working with lists are foreach and map, which are defined as follows:

          foreach(Fun, [First|Rest]) ->
          │ │ │ │ +    Fun(First),
          │ │ │ │ +    foreach(Fun, Rest);
          │ │ │ │ +foreach(Fun, []) ->
          │ │ │ │      ok.
          │ │ │ │  
          │ │ │ │ -map(Fun, [First|Rest]) ->
          │ │ │ │ -    [Fun(First)|map(Fun,Rest)];
          │ │ │ │ -map(Fun, []) ->
          │ │ │ │ -    [].

          These two functions are provided in the standard module lists. foreach takes │ │ │ │ +map(Fun, [First|Rest]) -> │ │ │ │ + [Fun(First)|map(Fun,Rest)]; │ │ │ │ +map(Fun, []) -> │ │ │ │ + [].

          These two functions are provided in the standard module lists. foreach takes │ │ │ │ a list and applies a fun to every element in the list. map creates a new list │ │ │ │ by applying a fun to every element in a list. Going back to the shell, map is │ │ │ │ -used and a fun to add 3 to every element of a list:

          88> Add_3 = fun(X) -> X + 3 end.
          │ │ │ │ +used and a fun to add 3 to every element of a list:

          88> Add_3 = fun(X) -> X + 3 end.
          │ │ │ │  #Fun<erl_eval.5.123085357>
          │ │ │ │ -89> lists:map(Add_3, [1,2,3]).
          │ │ │ │ -[4,5,6]

          Let us (again) print the temperatures in a list of cities:

          90> Print_City = fun({City, {X, Temp}}) -> io:format("~-15w ~w ~w~n",
          │ │ │ │ -[City, X, Temp]) end.
          │ │ │ │ +89> lists:map(Add_3, [1,2,3]).
          │ │ │ │ +[4,5,6]

          Let us (again) print the temperatures in a list of cities:

          90> Print_City = fun({City, {X, Temp}}) -> io:format("~-15w ~w ~w~n",
          │ │ │ │ +[City, X, Temp]) end.
          │ │ │ │  #Fun<erl_eval.5.123085357>
          │ │ │ │ -91> lists:foreach(Print_City, [{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ +91> lists:foreach(Print_City, [{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │  moscow          c -10
          │ │ │ │  cape_town       f 70
          │ │ │ │  stockholm       c -4
          │ │ │ │  paris           f 28
          │ │ │ │  london          f 36
          │ │ │ │  ok

          Let us now define a fun that can be used to go through a list of cities and │ │ │ │ -temperatures and transform them all to Celsius.

          -module(tut13).
          │ │ │ │ +temperatures and transform them all to Celsius.

          -module(tut13).
          │ │ │ │  
          │ │ │ │ --export([convert_list_to_c/1]).
          │ │ │ │ +-export([convert_list_to_c/1]).
          │ │ │ │  
          │ │ │ │ -convert_to_c({Name, {f, Temp}}) ->
          │ │ │ │ -    {Name, {c, trunc((Temp - 32) * 5 / 9)}};
          │ │ │ │ -convert_to_c({Name, {c, Temp}}) ->
          │ │ │ │ -    {Name, {c, Temp}}.
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c(List) ->
          │ │ │ │ -    lists:map(fun convert_to_c/1, List).
          92> tut13:convert_list_to_c([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ -[{moscow,{c,-10}},
          │ │ │ │ - {cape_town,{c,21}},
          │ │ │ │ - {stockholm,{c,-4}},
          │ │ │ │ - {paris,{c,-2}},
          │ │ │ │ - {london,{c,2}}]

          The convert_to_c function is the same as before, but here it is used as a fun:

          lists:map(fun convert_to_c/1, List)

          When a function defined elsewhere is used as a fun, it can be referred to as │ │ │ │ +convert_to_c({Name, {f, Temp}}) -> │ │ │ │ + {Name, {c, trunc((Temp - 32) * 5 / 9)}}; │ │ │ │ +convert_to_c({Name, {c, Temp}}) -> │ │ │ │ + {Name, {c, Temp}}. │ │ │ │ + │ │ │ │ +convert_list_to_c(List) -> │ │ │ │ + lists:map(fun convert_to_c/1, List).

          92> tut13:convert_list_to_c([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ +[{moscow,{c,-10}},
          │ │ │ │ + {cape_town,{c,21}},
          │ │ │ │ + {stockholm,{c,-4}},
          │ │ │ │ + {paris,{c,-2}},
          │ │ │ │ + {london,{c,2}}]

          The convert_to_c function is the same as before, but here it is used as a fun:

          lists:map(fun convert_to_c/1, List)

          When a function defined elsewhere is used as a fun, it can be referred to as │ │ │ │ Function/Arity (remember that Arity = number of arguments). So in the │ │ │ │ map-call lists:map(fun convert_to_c/1, List) is written. As shown, │ │ │ │ convert_list_to_c becomes much shorter and easier to understand.

          The standard module lists also contains a function sort(Fun, List) where │ │ │ │ Fun is a fun with two arguments. This fun returns true if the first argument │ │ │ │ is less than the second argument, or else false. Sorting is added to the │ │ │ │ -convert_list_to_c:

          -module(tut13).
          │ │ │ │ +convert_list_to_c:

          -module(tut13).
          │ │ │ │  
          │ │ │ │ --export([convert_list_to_c/1]).
          │ │ │ │ +-export([convert_list_to_c/1]).
          │ │ │ │  
          │ │ │ │ -convert_to_c({Name, {f, Temp}}) ->
          │ │ │ │ -    {Name, {c, trunc((Temp - 32) * 5 / 9)}};
          │ │ │ │ -convert_to_c({Name, {c, Temp}}) ->
          │ │ │ │ -    {Name, {c, Temp}}.
          │ │ │ │ -
          │ │ │ │ -convert_list_to_c(List) ->
          │ │ │ │ -    New_list = lists:map(fun convert_to_c/1, List),
          │ │ │ │ -    lists:sort(fun({_, {c, Temp1}}, {_, {c, Temp2}}) ->
          │ │ │ │ -                       Temp1 < Temp2 end, New_list).
          93> c(tut13).
          │ │ │ │ -{ok,tut13}
          │ │ │ │ -94> tut13:convert_list_to_c([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ -[{moscow,{c,-10}},
          │ │ │ │ - {stockholm,{c,-4}},
          │ │ │ │ - {paris,{c,-2}},
          │ │ │ │ - {london,{c,2}},
          │ │ │ │ - {cape_town,{c,21}}]

          In sort the fun is used:

          fun({_, {c, Temp1}}, {_, {c, Temp2}}) -> Temp1 < Temp2 end,

          Here the concept of an anonymous variable _ is introduced. This is simply │ │ │ │ +convert_to_c({Name, {f, Temp}}) -> │ │ │ │ + {Name, {c, trunc((Temp - 32) * 5 / 9)}}; │ │ │ │ +convert_to_c({Name, {c, Temp}}) -> │ │ │ │ + {Name, {c, Temp}}. │ │ │ │ + │ │ │ │ +convert_list_to_c(List) -> │ │ │ │ + New_list = lists:map(fun convert_to_c/1, List), │ │ │ │ + lists:sort(fun({_, {c, Temp1}}, {_, {c, Temp2}}) -> │ │ │ │ + Temp1 < Temp2 end, New_list).

          93> c(tut13).
          │ │ │ │ +{ok,tut13}
          │ │ │ │ +94> tut13:convert_list_to_c([{moscow, {c, -10}}, {cape_town, {f, 70}},
          │ │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
          │ │ │ │ +[{moscow,{c,-10}},
          │ │ │ │ + {stockholm,{c,-4}},
          │ │ │ │ + {paris,{c,-2}},
          │ │ │ │ + {london,{c,2}},
          │ │ │ │ + {cape_town,{c,21}}]

          In sort the fun is used:

          fun({_, {c, Temp1}}, {_, {c, Temp2}}) -> Temp1 < Temp2 end,

          Here the concept of an anonymous variable _ is introduced. This is simply │ │ │ │ shorthand for a variable that gets a value, but the value is ignored. This can │ │ │ │ be used anywhere suitable, not just in funs. Temp1 < Temp2 returns true if │ │ │ │ Temp1 is less than Temp2.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/robustness.xhtml │ │ │ │ @@ -33,68 +33,68 @@ │ │ │ │ │ │ │ │

          Before improving the messenger program, let us look at some general principles, │ │ │ │ using the ping pong program as an example. Recall that when "ping" finishes, it │ │ │ │ tells "pong" that it has done so by sending the atom finished as a message to │ │ │ │ "pong" so that "pong" can also finish. Another way to let "pong" finish is to │ │ │ │ make "pong" exit if it does not receive a message from ping within a certain │ │ │ │ time. This can be done by adding a time-out to pong as shown in the │ │ │ │ -following example:

          -module(tut19).
          │ │ │ │ +following example:

          -module(tut19).
          │ │ │ │  
          │ │ │ │ --export([start_ping/1, start_pong/0,  ping/2, pong/0]).
          │ │ │ │ +-export([start_ping/1, start_pong/0,  ping/2, pong/0]).
          │ │ │ │  
          │ │ │ │ -ping(0, Pong_Node) ->
          │ │ │ │ -    io:format("ping finished~n", []);
          │ │ │ │ +ping(0, Pong_Node) ->
          │ │ │ │ +    io:format("ping finished~n", []);
          │ │ │ │  
          │ │ │ │ -ping(N, Pong_Node) ->
          │ │ │ │ -    {pong, Pong_Node} ! {ping, self()},
          │ │ │ │ +ping(N, Pong_Node) ->
          │ │ │ │ +    {pong, Pong_Node} ! {ping, self()},
          │ │ │ │      receive
          │ │ │ │          pong ->
          │ │ │ │ -            io:format("Ping received pong~n", [])
          │ │ │ │ +            io:format("Ping received pong~n", [])
          │ │ │ │      end,
          │ │ │ │ -    ping(N - 1, Pong_Node).
          │ │ │ │ +    ping(N - 1, Pong_Node).
          │ │ │ │  
          │ │ │ │ -pong() ->
          │ │ │ │ +pong() ->
          │ │ │ │      receive
          │ │ │ │ -        {ping, Ping_PID} ->
          │ │ │ │ -            io:format("Pong received ping~n", []),
          │ │ │ │ +        {ping, Ping_PID} ->
          │ │ │ │ +            io:format("Pong received ping~n", []),
          │ │ │ │              Ping_PID ! pong,
          │ │ │ │ -            pong()
          │ │ │ │ +            pong()
          │ │ │ │      after 5000 ->
          │ │ │ │ -            io:format("Pong timed out~n", [])
          │ │ │ │ +            io:format("Pong timed out~n", [])
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │ -start_pong() ->
          │ │ │ │ -    register(pong, spawn(tut19, pong, [])).
          │ │ │ │ +start_pong() ->
          │ │ │ │ +    register(pong, spawn(tut19, pong, [])).
          │ │ │ │  
          │ │ │ │ -start_ping(Pong_Node) ->
          │ │ │ │ -    spawn(tut19, ping, [3, Pong_Node]).

          After this is compiled and the file tut19.beam is copied to the necessary │ │ │ │ +start_ping(Pong_Node) -> │ │ │ │ + spawn(tut19, ping, [3, Pong_Node]).

          After this is compiled and the file tut19.beam is copied to the necessary │ │ │ │ directories, the following is seen on (pong@kosken):

          (pong@kosken)1> tut19:start_pong().
          │ │ │ │  true
          │ │ │ │  Pong received ping
          │ │ │ │  Pong received ping
          │ │ │ │  Pong received ping
          │ │ │ │  Pong timed out

          And the following is seen on (ping@gollum):

          (ping@gollum)1> tut19:start_ping(pong@kosken).
          │ │ │ │  <0.36.0>
          │ │ │ │  Ping received pong
          │ │ │ │  Ping received pong
          │ │ │ │  Ping received pong
          │ │ │ │ -ping finished

          The time-out is set in:

          pong() ->
          │ │ │ │ +ping finished

          The time-out is set in:

          pong() ->
          │ │ │ │      receive
          │ │ │ │ -        {ping, Ping_PID} ->
          │ │ │ │ -            io:format("Pong received ping~n", []),
          │ │ │ │ +        {ping, Ping_PID} ->
          │ │ │ │ +            io:format("Pong received ping~n", []),
          │ │ │ │              Ping_PID ! pong,
          │ │ │ │ -            pong()
          │ │ │ │ +            pong()
          │ │ │ │      after 5000 ->
          │ │ │ │ -            io:format("Pong timed out~n", [])
          │ │ │ │ +            io:format("Pong timed out~n", [])
          │ │ │ │      end.

          The time-out (after 5000) is started when receive is entered. The time-out │ │ │ │ is canceled if {ping,Ping_PID} is received. If {ping,Ping_PID} is not │ │ │ │ received, the actions following the time-out are done after 5000 milliseconds. │ │ │ │ after must be last in the receive, that is, preceded by all other message │ │ │ │ reception specifications in the receive. It is also possible to call a │ │ │ │ -function that returned an integer for the time-out:

          after pong_timeout() ->

          In general, there are better ways than using time-outs to supervise parts of a │ │ │ │ +function that returned an integer for the time-out:

          after pong_timeout() ->

          In general, there are better ways than using time-outs to supervise parts of a │ │ │ │ distributed Erlang system. Time-outs are usually appropriate to supervise │ │ │ │ external events, for example, if you have expected a message from some external │ │ │ │ system within a specified time. For example, a time-out can be used to log a │ │ │ │ user out of the messenger system if they have not accessed it for, say, ten │ │ │ │ minutes.

          │ │ │ │ │ │ │ │ │ │ │ │ @@ -114,96 +114,96 @@ │ │ │ │ something called a signal to all the processes it has links to.

          The signal carries information about the pid it was sent from and the exit │ │ │ │ reason.

          The default behaviour of a process that receives a normal exit is to ignore the │ │ │ │ signal.

          The default behaviour in the two other cases (that is, abnormal exit) above is │ │ │ │ to:

          • Bypass all messages to the receiving process.
          • Kill the receiving process.
          • Propagate the same error signal to the links of the killed process.

          In this way you can connect all processes in a transaction together using links. │ │ │ │ If one of the processes exits abnormally, all the processes in the transaction │ │ │ │ are killed. As it is often wanted to create a process and link to it at the same │ │ │ │ time, there is a special BIF, spawn_link that does the │ │ │ │ -same as spawn, but also creates a link to the spawned process.

          Now an example of the ping pong example using links to terminate "pong":

          -module(tut20).
          │ │ │ │ +same as spawn, but also creates a link to the spawned process.

          Now an example of the ping pong example using links to terminate "pong":

          -module(tut20).
          │ │ │ │  
          │ │ │ │ --export([start/1,  ping/2, pong/0]).
          │ │ │ │ +-export([start/1,  ping/2, pong/0]).
          │ │ │ │  
          │ │ │ │ -ping(N, Pong_Pid) ->
          │ │ │ │ -    link(Pong_Pid),
          │ │ │ │ -    ping1(N, Pong_Pid).
          │ │ │ │ +ping(N, Pong_Pid) ->
          │ │ │ │ +    link(Pong_Pid),
          │ │ │ │ +    ping1(N, Pong_Pid).
          │ │ │ │  
          │ │ │ │ -ping1(0, _) ->
          │ │ │ │ -    exit(ping);
          │ │ │ │ +ping1(0, _) ->
          │ │ │ │ +    exit(ping);
          │ │ │ │  
          │ │ │ │ -ping1(N, Pong_Pid) ->
          │ │ │ │ -    Pong_Pid ! {ping, self()},
          │ │ │ │ +ping1(N, Pong_Pid) ->
          │ │ │ │ +    Pong_Pid ! {ping, self()},
          │ │ │ │      receive
          │ │ │ │          pong ->
          │ │ │ │ -            io:format("Ping received pong~n", [])
          │ │ │ │ +            io:format("Ping received pong~n", [])
          │ │ │ │      end,
          │ │ │ │ -    ping1(N - 1, Pong_Pid).
          │ │ │ │ +    ping1(N - 1, Pong_Pid).
          │ │ │ │  
          │ │ │ │ -pong() ->
          │ │ │ │ +pong() ->
          │ │ │ │      receive
          │ │ │ │ -        {ping, Ping_PID} ->
          │ │ │ │ -            io:format("Pong received ping~n", []),
          │ │ │ │ +        {ping, Ping_PID} ->
          │ │ │ │ +            io:format("Pong received ping~n", []),
          │ │ │ │              Ping_PID ! pong,
          │ │ │ │ -            pong()
          │ │ │ │ +            pong()
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │ -start(Ping_Node) ->
          │ │ │ │ -    PongPID = spawn(tut20, pong, []),
          │ │ │ │ -    spawn(Ping_Node, tut20, ping, [3, PongPID]).
          (s1@bill)3> tut20:start(s2@kosken).
          │ │ │ │ +start(Ping_Node) ->
          │ │ │ │ +    PongPID = spawn(tut20, pong, []),
          │ │ │ │ +    spawn(Ping_Node, tut20, ping, [3, PongPID]).
          (s1@bill)3> tut20:start(s2@kosken).
          │ │ │ │  Pong received ping
          │ │ │ │  <3820.41.0>
          │ │ │ │  Ping received pong
          │ │ │ │  Pong received ping
          │ │ │ │  Ping received pong
          │ │ │ │  Pong received ping
          │ │ │ │  Ping received pong

          This is a slight modification of the ping pong program where both processes are │ │ │ │ spawned from the same start/1 function, and the "ping" process can be spawned │ │ │ │ on a separate node. Notice the use of the link BIF. "Ping" calls │ │ │ │ exit(ping) when it finishes and this causes an exit signal to be │ │ │ │ sent to "pong", which also terminates.

          It is possible to modify the default behaviour of a process so that it does not │ │ │ │ get killed when it receives abnormal exit signals. Instead, all signals are │ │ │ │ turned into normal messages on the format {'EXIT',FromPID,Reason} and added to │ │ │ │ -the end of the receiving process' message queue. This behaviour is set by:

          process_flag(trap_exit, true)

          There are several other process flags, see erlang(3). │ │ │ │ +the end of the receiving process' message queue. This behaviour is set by:

          process_flag(trap_exit, true)

          There are several other process flags, see erlang(3). │ │ │ │ Changing the default behaviour of a process in this way is usually not done in │ │ │ │ standard user programs, but is left to the supervisory programs in OTP. However, │ │ │ │ -the ping pong program is modified to illustrate exit trapping.

          -module(tut21).
          │ │ │ │ +the ping pong program is modified to illustrate exit trapping.

          -module(tut21).
          │ │ │ │  
          │ │ │ │ --export([start/1,  ping/2, pong/0]).
          │ │ │ │ +-export([start/1,  ping/2, pong/0]).
          │ │ │ │  
          │ │ │ │ -ping(N, Pong_Pid) ->
          │ │ │ │ -    link(Pong_Pid),
          │ │ │ │ -    ping1(N, Pong_Pid).
          │ │ │ │ +ping(N, Pong_Pid) ->
          │ │ │ │ +    link(Pong_Pid),
          │ │ │ │ +    ping1(N, Pong_Pid).
          │ │ │ │  
          │ │ │ │ -ping1(0, _) ->
          │ │ │ │ -    exit(ping);
          │ │ │ │ +ping1(0, _) ->
          │ │ │ │ +    exit(ping);
          │ │ │ │  
          │ │ │ │ -ping1(N, Pong_Pid) ->
          │ │ │ │ -    Pong_Pid ! {ping, self()},
          │ │ │ │ +ping1(N, Pong_Pid) ->
          │ │ │ │ +    Pong_Pid ! {ping, self()},
          │ │ │ │      receive
          │ │ │ │          pong ->
          │ │ │ │ -            io:format("Ping received pong~n", [])
          │ │ │ │ +            io:format("Ping received pong~n", [])
          │ │ │ │      end,
          │ │ │ │ -    ping1(N - 1, Pong_Pid).
          │ │ │ │ +    ping1(N - 1, Pong_Pid).
          │ │ │ │  
          │ │ │ │ -pong() ->
          │ │ │ │ -    process_flag(trap_exit, true),
          │ │ │ │ -    pong1().
          │ │ │ │ +pong() ->
          │ │ │ │ +    process_flag(trap_exit, true),
          │ │ │ │ +    pong1().
          │ │ │ │  
          │ │ │ │ -pong1() ->
          │ │ │ │ +pong1() ->
          │ │ │ │      receive
          │ │ │ │ -        {ping, Ping_PID} ->
          │ │ │ │ -            io:format("Pong received ping~n", []),
          │ │ │ │ +        {ping, Ping_PID} ->
          │ │ │ │ +            io:format("Pong received ping~n", []),
          │ │ │ │              Ping_PID ! pong,
          │ │ │ │ -            pong1();
          │ │ │ │ -        {'EXIT', From, Reason} ->
          │ │ │ │ -            io:format("pong exiting, got ~p~n", [{'EXIT', From, Reason}])
          │ │ │ │ +            pong1();
          │ │ │ │ +        {'EXIT', From, Reason} ->
          │ │ │ │ +            io:format("pong exiting, got ~p~n", [{'EXIT', From, Reason}])
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │ -start(Ping_Node) ->
          │ │ │ │ -    PongPID = spawn(tut21, pong, []),
          │ │ │ │ -    spawn(Ping_Node, tut21, ping, [3, PongPID]).
          (s1@bill)1> tut21:start(s2@gollum).
          │ │ │ │ +start(Ping_Node) ->
          │ │ │ │ +    PongPID = spawn(tut21, pong, []),
          │ │ │ │ +    spawn(Ping_Node, tut21, ping, [3, PongPID]).
          (s1@bill)1> tut21:start(s2@gollum).
          │ │ │ │  <3820.39.0>
          │ │ │ │  Pong received ping
          │ │ │ │  Ping received pong
          │ │ │ │  Pong received ping
          │ │ │ │  Ping received pong
          │ │ │ │  Pong received ping
          │ │ │ │  Ping received pong
          │ │ │ │ @@ -256,135 +256,135 @@
          │ │ │ │  %%% Started: messenger:client(Server_Node, Name)
          │ │ │ │  %%% To client: logoff
          │ │ │ │  %%% To client: {message_to, ToName, Message}
          │ │ │ │  %%%
          │ │ │ │  %%% Configuration: change the server_node() function to return the
          │ │ │ │  %%% name of the node where the messenger server runs
          │ │ │ │  
          │ │ │ │ --module(messenger).
          │ │ │ │ --export([start_server/0, server/0,
          │ │ │ │ -         logon/1, logoff/0, message/2, client/2]).
          │ │ │ │ +-module(messenger).
          │ │ │ │ +-export([start_server/0, server/0,
          │ │ │ │ +         logon/1, logoff/0, message/2, client/2]).
          │ │ │ │  
          │ │ │ │  %%% Change the function below to return the name of the node where the
          │ │ │ │  %%% messenger server runs
          │ │ │ │ -server_node() ->
          │ │ │ │ +server_node() ->
          │ │ │ │      messenger@super.
          │ │ │ │  
          │ │ │ │  %%% This is the server process for the "messenger"
          │ │ │ │  %%% the user list has the format [{ClientPid1, Name1},{ClientPid22, Name2},...]
          │ │ │ │ -server() ->
          │ │ │ │ -    process_flag(trap_exit, true),
          │ │ │ │ -    server([]).
          │ │ │ │ +server() ->
          │ │ │ │ +    process_flag(trap_exit, true),
          │ │ │ │ +    server([]).
          │ │ │ │  
          │ │ │ │ -server(User_List) ->
          │ │ │ │ +server(User_List) ->
          │ │ │ │      receive
          │ │ │ │ -        {From, logon, Name} ->
          │ │ │ │ -            New_User_List = server_logon(From, Name, User_List),
          │ │ │ │ -            server(New_User_List);
          │ │ │ │ -        {'EXIT', From, _} ->
          │ │ │ │ -            New_User_List = server_logoff(From, User_List),
          │ │ │ │ -            server(New_User_List);
          │ │ │ │ -        {From, message_to, To, Message} ->
          │ │ │ │ -            server_transfer(From, To, Message, User_List),
          │ │ │ │ -            io:format("list is now: ~p~n", [User_List]),
          │ │ │ │ -            server(User_List)
          │ │ │ │ +        {From, logon, Name} ->
          │ │ │ │ +            New_User_List = server_logon(From, Name, User_List),
          │ │ │ │ +            server(New_User_List);
          │ │ │ │ +        {'EXIT', From, _} ->
          │ │ │ │ +            New_User_List = server_logoff(From, User_List),
          │ │ │ │ +            server(New_User_List);
          │ │ │ │ +        {From, message_to, To, Message} ->
          │ │ │ │ +            server_transfer(From, To, Message, User_List),
          │ │ │ │ +            io:format("list is now: ~p~n", [User_List]),
          │ │ │ │ +            server(User_List)
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │  %%% Start the server
          │ │ │ │ -start_server() ->
          │ │ │ │ -    register(messenger, spawn(messenger, server, [])).
          │ │ │ │ +start_server() ->
          │ │ │ │ +    register(messenger, spawn(messenger, server, [])).
          │ │ │ │  
          │ │ │ │  %%% Server adds a new user to the user list
          │ │ │ │ -server_logon(From, Name, User_List) ->
          │ │ │ │ +server_logon(From, Name, User_List) ->
          │ │ │ │      %% check if logged on anywhere else
          │ │ │ │ -    case lists:keymember(Name, 2, User_List) of
          │ │ │ │ +    case lists:keymember(Name, 2, User_List) of
          │ │ │ │          true ->
          │ │ │ │ -            From ! {messenger, stop, user_exists_at_other_node},  %reject logon
          │ │ │ │ +            From ! {messenger, stop, user_exists_at_other_node},  %reject logon
          │ │ │ │              User_List;
          │ │ │ │          false ->
          │ │ │ │ -            From ! {messenger, logged_on},
          │ │ │ │ -            link(From),
          │ │ │ │ -            [{From, Name} | User_List]        %add user to the list
          │ │ │ │ +            From ! {messenger, logged_on},
          │ │ │ │ +            link(From),
          │ │ │ │ +            [{From, Name} | User_List]        %add user to the list
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │  %%% Server deletes a user from the user list
          │ │ │ │ -server_logoff(From, User_List) ->
          │ │ │ │ -    lists:keydelete(From, 1, User_List).
          │ │ │ │ +server_logoff(From, User_List) ->
          │ │ │ │ +    lists:keydelete(From, 1, User_List).
          │ │ │ │  
          │ │ │ │  
          │ │ │ │  %%% Server transfers a message between user
          │ │ │ │ -server_transfer(From, To, Message, User_List) ->
          │ │ │ │ +server_transfer(From, To, Message, User_List) ->
          │ │ │ │      %% check that the user is logged on and who he is
          │ │ │ │ -    case lists:keysearch(From, 1, User_List) of
          │ │ │ │ +    case lists:keysearch(From, 1, User_List) of
          │ │ │ │          false ->
          │ │ │ │ -            From ! {messenger, stop, you_are_not_logged_on};
          │ │ │ │ -        {value, {_, Name}} ->
          │ │ │ │ -            server_transfer(From, Name, To, Message, User_List)
          │ │ │ │ +            From ! {messenger, stop, you_are_not_logged_on};
          │ │ │ │ +        {value, {_, Name}} ->
          │ │ │ │ +            server_transfer(From, Name, To, Message, User_List)
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │  %%% If the user exists, send the message
          │ │ │ │ -server_transfer(From, Name, To, Message, User_List) ->
          │ │ │ │ +server_transfer(From, Name, To, Message, User_List) ->
          │ │ │ │      %% Find the receiver and send the message
          │ │ │ │ -    case lists:keysearch(To, 2, User_List) of
          │ │ │ │ +    case lists:keysearch(To, 2, User_List) of
          │ │ │ │          false ->
          │ │ │ │ -            From ! {messenger, receiver_not_found};
          │ │ │ │ -        {value, {ToPid, To}} ->
          │ │ │ │ -            ToPid ! {message_from, Name, Message},
          │ │ │ │ -            From ! {messenger, sent}
          │ │ │ │ +            From ! {messenger, receiver_not_found};
          │ │ │ │ +        {value, {ToPid, To}} ->
          │ │ │ │ +            ToPid ! {message_from, Name, Message},
          │ │ │ │ +            From ! {messenger, sent}
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │  %%% User Commands
          │ │ │ │ -logon(Name) ->
          │ │ │ │ -    case whereis(mess_client) of
          │ │ │ │ +logon(Name) ->
          │ │ │ │ +    case whereis(mess_client) of
          │ │ │ │          undefined ->
          │ │ │ │ -            register(mess_client,
          │ │ │ │ -                     spawn(messenger, client, [server_node(), Name]));
          │ │ │ │ +            register(mess_client,
          │ │ │ │ +                     spawn(messenger, client, [server_node(), Name]));
          │ │ │ │          _ -> already_logged_on
          │ │ │ │      end.
          │ │ │ │  
          │ │ │ │ -logoff() ->
          │ │ │ │ +logoff() ->
          │ │ │ │      mess_client ! logoff.
          │ │ │ │  
          │ │ │ │ -message(ToName, Message) ->
          │ │ │ │ -    case whereis(mess_client) of % Test if the client is running
          │ │ │ │ +message(ToName, Message) ->
          │ │ │ │ +    case whereis(mess_client) of % Test if the client is running
          │ │ │ │          undefined ->
          │ │ │ │              not_logged_on;
          │ │ │ │ -        _ -> mess_client ! {message_to, ToName, Message},
          │ │ │ │ +        _ -> mess_client ! {message_to, ToName, Message},
          │ │ │ │               ok
          │ │ │ │  end.
          │ │ │ │  
          │ │ │ │  %%% The client process which runs on each user node
          │ │ │ │ -client(Server_Node, Name) ->
          │ │ │ │ -    {messenger, Server_Node} ! {self(), logon, Name},
          │ │ │ │ -    await_result(),
          │ │ │ │ -    client(Server_Node).
          │ │ │ │ +client(Server_Node, Name) ->
          │ │ │ │ +    {messenger, Server_Node} ! {self(), logon, Name},
          │ │ │ │ +    await_result(),
          │ │ │ │ +    client(Server_Node).
          │ │ │ │  
          │ │ │ │ -client(Server_Node) ->
          │ │ │ │ +client(Server_Node) ->
          │ │ │ │      receive
          │ │ │ │          logoff ->
          │ │ │ │ -            exit(normal);
          │ │ │ │ -        {message_to, ToName, Message} ->
          │ │ │ │ -            {messenger, Server_Node} ! {self(), message_to, ToName, Message},
          │ │ │ │ -            await_result();
          │ │ │ │ -        {message_from, FromName, Message} ->
          │ │ │ │ -            io:format("Message from ~p: ~p~n", [FromName, Message])
          │ │ │ │ +            exit(normal);
          │ │ │ │ +        {message_to, ToName, Message} ->
          │ │ │ │ +            {messenger, Server_Node} ! {self(), message_to, ToName, Message},
          │ │ │ │ +            await_result();
          │ │ │ │ +        {message_from, FromName, Message} ->
          │ │ │ │ +            io:format("Message from ~p: ~p~n", [FromName, Message])
          │ │ │ │      end,
          │ │ │ │ -    client(Server_Node).
          │ │ │ │ +    client(Server_Node).
          │ │ │ │  
          │ │ │ │  %%% wait for a response from the server
          │ │ │ │ -await_result() ->
          │ │ │ │ +await_result() ->
          │ │ │ │      receive
          │ │ │ │ -        {messenger, stop, Why} -> % Stop the client
          │ │ │ │ -            io:format("~p~n", [Why]),
          │ │ │ │ -            exit(normal);
          │ │ │ │ -        {messenger, What} ->  % Normal response
          │ │ │ │ -            io:format("~p~n", [What])
          │ │ │ │ +        {messenger, stop, Why} -> % Stop the client
          │ │ │ │ +            io:format("~p~n", [Why]),
          │ │ │ │ +            exit(normal);
          │ │ │ │ +        {messenger, What} ->  % Normal response
          │ │ │ │ +            io:format("~p~n", [What])
          │ │ │ │      after 5000 ->
          │ │ │ │ -            io:format("No response from server~n", []),
          │ │ │ │ -            exit(timeout)
          │ │ │ │ +            io:format("No response from server~n", []),
          │ │ │ │ +            exit(timeout)
          │ │ │ │      end.

          The following changes are added:

          The messenger server traps exits. If it receives an exit signal, │ │ │ │ {'EXIT',From,Reason}, this means that a client process has terminated or is │ │ │ │ unreachable for one of the following reasons:

          • The user has logged off (the "logoff" message is removed).
          • The network connection to the client is broken.
          • The node on which the client process resides has gone down.
          • The client processes has done some illegal operation.

          If an exit signal is received as above, the tuple {From,Name} is deleted from │ │ │ │ the servers User_List using the server_logoff function. If the node on which │ │ │ │ the server runs goes down, an exit signal (automatically generated by the │ │ │ │ system) is sent to all of the client processes: │ │ │ │ {'EXIT',MessengerPID,noconnection} causing all the client processes to │ │ │ ├── OEBPS/release_structure.xhtml │ │ │ │ @@ -41,37 +41,37 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Release Resource File │ │ │ │

          │ │ │ │

          To define a release, create a release resource file, or in short a .rel │ │ │ │ file. In the file, specify the name and version of the release, which ERTS │ │ │ │ -version it is based on, and which applications it consists of:

          {release, {Name,Vsn}, {erts, EVsn},
          │ │ │ │ - [{Application1, AppVsn1},
          │ │ │ │ +version it is based on, and which applications it consists of:

          {release, {Name,Vsn}, {erts, EVsn},
          │ │ │ │ + [{Application1, AppVsn1},
          │ │ │ │     ...
          │ │ │ │ -  {ApplicationN, AppVsnN}]}.

          Name, Vsn, EVsn, and AppVsn are strings.

          The file must be named Rel.rel, where Rel is a unique name.

          Each Application (atom) and AppVsn is the name and version of an application │ │ │ │ + {ApplicationN, AppVsnN}]}.

          Name, Vsn, EVsn, and AppVsn are strings.

          The file must be named Rel.rel, where Rel is a unique name.

          Each Application (atom) and AppVsn is the name and version of an application │ │ │ │ included in the release. The minimal release based on Erlang/OTP consists of the │ │ │ │ Kernel and STDLIB applications, so these applications must be included in the │ │ │ │ list.

          If the release is to be upgraded, it must also include the SASL application.

          Here is an example showing the .app file for a release of ch_app from │ │ │ │ -the Applications section:

          {application, ch_app,
          │ │ │ │ - [{description, "Channel allocator"},
          │ │ │ │ -  {vsn, "1"},
          │ │ │ │ -  {modules, [ch_app, ch_sup, ch3]},
          │ │ │ │ -  {registered, [ch3]},
          │ │ │ │ -  {applications, [kernel, stdlib, sasl]},
          │ │ │ │ -  {mod, {ch_app,[]}}
          │ │ │ │ - ]}.

          The .rel file must also contain kernel, stdlib, and sasl, as these │ │ │ │ -applications are required by ch_app. The file is called ch_rel-1.rel:

          {release,
          │ │ │ │ - {"ch_rel", "A"},
          │ │ │ │ - {erts, "14.2.5"},
          │ │ │ │ - [{kernel, "9.2.4"},
          │ │ │ │ -  {stdlib, "5.2.3"},
          │ │ │ │ -  {sasl, "4.2.1"},
          │ │ │ │ -  {ch_app, "1"}]
          │ │ │ │ -}.

          │ │ │ │ +the Applications section:

          {application, ch_app,
          │ │ │ │ + [{description, "Channel allocator"},
          │ │ │ │ +  {vsn, "1"},
          │ │ │ │ +  {modules, [ch_app, ch_sup, ch3]},
          │ │ │ │ +  {registered, [ch3]},
          │ │ │ │ +  {applications, [kernel, stdlib, sasl]},
          │ │ │ │ +  {mod, {ch_app,[]}}
          │ │ │ │ + ]}.

          The .rel file must also contain kernel, stdlib, and sasl, as these │ │ │ │ +applications are required by ch_app. The file is called ch_rel-1.rel:

          {release,
          │ │ │ │ + {"ch_rel", "A"},
          │ │ │ │ + {erts, "14.2.5"},
          │ │ │ │ + [{kernel, "9.2.4"},
          │ │ │ │ +  {stdlib, "5.2.3"},
          │ │ │ │ +  {sasl, "4.2.1"},
          │ │ │ │ +  {ch_app, "1"}]
          │ │ │ │ +}.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Generating Boot Scripts │ │ │ │

          │ │ │ │

          systools in the SASL application includes tools to build and check │ │ │ │ releases. The functions read the .rel and .app files and perform │ │ │ │ @@ -95,17 +95,17 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Creating a Release Package │ │ │ │ │ │ │ │

          The systools:make_tar/1,2 function takes a │ │ │ │ .rel file as input and creates a zipped tar file with the code for │ │ │ │ -the specified applications, a release package:

          1> systools:make_script("ch_rel-1").
          │ │ │ │ +the specified applications, a release package:

          1> systools:make_script("ch_rel-1").
          │ │ │ │  ok
          │ │ │ │ -2> systools:make_tar("ch_rel-1").
          │ │ │ │ +2> systools:make_tar("ch_rel-1").
          │ │ │ │  ok

          The release package by default contains:

          • The .app files
          • The .rel file
          • The object code for all applications, structured according to the │ │ │ │ application directory structure
          • The binary boot script renamed to start.boot
          % tar tf ch_rel-1.tar
          │ │ │ │  lib/kernel-9.2.4/ebin/kernel.app
          │ │ │ │  lib/kernel-9.2.4/ebin/application.beam
          │ │ │ │  ...
          │ │ │ │  lib/stdlib-5.2.3/ebin/stdlib.app
          │ │ │ │  lib/stdlib-5.2.3/ebin/argparse.beam
          │ │ │ ├── OEBPS/release_handling.xhtml
          │ │ │ │ @@ -128,38 +128,38 @@
          │ │ │ │    update
          │ │ │ │  
          │ │ │ │  

          If a more complex change has been made, for example, a change to the format of │ │ │ │ the internal state of a gen_server, simple code replacement is not sufficient. │ │ │ │ Instead, it is necessary to:

          • Suspend the processes using the module (to avoid that they try to handle any │ │ │ │ requests before the code replacement is completed).
          • Ask them to transform the internal state format and switch to the new version │ │ │ │ of the module.
          • Remove the old version.
          • Resume the processes.

          This is called synchronized code replacement and for this the following │ │ │ │ -instructions are used:

          {update, Module, {advanced, Extra}}
          │ │ │ │ -{update, Module, supervisor}

          update with argument {advanced,Extra} is used when changing the internal │ │ │ │ +instructions are used:

          {update, Module, {advanced, Extra}}
          │ │ │ │ +{update, Module, supervisor}

          update with argument {advanced,Extra} is used when changing the internal │ │ │ │ state of a behaviour as described above. It causes behaviour processes to call │ │ │ │ the callback function code_change/3, passing the term Extra and some other │ │ │ │ information as arguments. See the manual pages for the respective behaviours and │ │ │ │ Appup Cookbook.

          update with argument supervisor is used when changing the start │ │ │ │ specification of a supervisor. See Appup Cookbook.

          When a module is to be updated, the release handler finds which processes that │ │ │ │ are using the module by traversing the supervision tree of each running │ │ │ │ -application and checking all the child specifications:

          {Id, StartFunc, Restart, Shutdown, Type, Modules}

          A process uses a module if the name is listed in Modules in the child │ │ │ │ +application and checking all the child specifications:

          {Id, StartFunc, Restart, Shutdown, Type, Modules}

          A process uses a module if the name is listed in Modules in the child │ │ │ │ specification for the process.

          If Modules=dynamic, which is the case for event managers, the event manager │ │ │ │ process informs the release handler about the list of currently installed event │ │ │ │ handlers (gen_event), and it is checked if the module name is in this list │ │ │ │ instead.

          The release handler suspends, asks for code change, and resumes processes by │ │ │ │ calling the functions sys:suspend/1,2, sys:change_code/4,5, and │ │ │ │ sys:resume/1,2, respectively.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ add_module and delete_module │ │ │ │

          │ │ │ │ -

          If a new module is introduced, the following instruction is used:

          {add_module, Module}

          This instruction loads module Module. When running Erlang in │ │ │ │ +

          If a new module is introduced, the following instruction is used:

          {add_module, Module}

          This instruction loads module Module. When running Erlang in │ │ │ │ embedded mode it is necessary to use this this instruction. It is not │ │ │ │ strictly required when running Erlang in interactive mode, since the │ │ │ │ -code server automatically searches for and loads unloaded modules.

          The opposite of add_module is delete_module, which unloads a module:

          {delete_module, Module}

          Any process, in any application, with Module as residence module, is │ │ │ │ +code server automatically searches for and loads unloaded modules.

          The opposite of add_module is delete_module, which unloads a module:

          {delete_module, Module}

          Any process, in any application, with Module as residence module, is │ │ │ │ killed when the instruction is evaluated. Therefore, the user must │ │ │ │ ensure that all such processes are terminated before deleting module │ │ │ │ Module to avoid a situation with failing supervisor restarts.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Application Instructions │ │ │ │ @@ -246,60 +246,60 @@ │ │ │ │ .app file.

        • Each UpFromVsn is a previous version of the application to upgrade from.
        • Each DownToVsn is a previous version of the application to downgrade to.
        • Each Instructions is a list of release handling instructions.

        UpFromVsn and DownToVsn can also be specified as regular expressions. For │ │ │ │ more information about the syntax and contents of the .appup file, see │ │ │ │ appup in SASL.

        Appup Cookbook includes examples of .appup files for │ │ │ │ typical upgrade/downgrade cases.

        Example: Consider the release ch_rel-1 from │ │ │ │ Releases. Assume you want to add a function │ │ │ │ available/0 to server ch3, which returns the number of available channels │ │ │ │ (when trying out the example, make the change in a copy of the original │ │ │ │ -directory, to ensure that the first version is still available):

        -module(ch3).
        │ │ │ │ --behaviour(gen_server).
        │ │ │ │ +directory, to ensure that the first version is still available):

        -module(ch3).
        │ │ │ │ +-behaviour(gen_server).
        │ │ │ │  
        │ │ │ │ --export([start_link/0]).
        │ │ │ │ --export([alloc/0, free/1]).
        │ │ │ │ --export([available/0]).
        │ │ │ │ --export([init/1, handle_call/3, handle_cast/2]).
        │ │ │ │ +-export([start_link/0]).
        │ │ │ │ +-export([alloc/0, free/1]).
        │ │ │ │ +-export([available/0]).
        │ │ │ │ +-export([init/1, handle_call/3, handle_cast/2]).
        │ │ │ │  
        │ │ │ │ -start_link() ->
        │ │ │ │ -    gen_server:start_link({local, ch3}, ch3, [], []).
        │ │ │ │ +start_link() ->
        │ │ │ │ +    gen_server:start_link({local, ch3}, ch3, [], []).
        │ │ │ │  
        │ │ │ │ -alloc() ->
        │ │ │ │ -    gen_server:call(ch3, alloc).
        │ │ │ │ +alloc() ->
        │ │ │ │ +    gen_server:call(ch3, alloc).
        │ │ │ │  
        │ │ │ │ -free(Ch) ->
        │ │ │ │ -    gen_server:cast(ch3, {free, Ch}).
        │ │ │ │ +free(Ch) ->
        │ │ │ │ +    gen_server:cast(ch3, {free, Ch}).
        │ │ │ │  
        │ │ │ │ -available() ->
        │ │ │ │ -    gen_server:call(ch3, available).
        │ │ │ │ +available() ->
        │ │ │ │ +    gen_server:call(ch3, available).
        │ │ │ │  
        │ │ │ │ -init(_Args) ->
        │ │ │ │ -    {ok, channels()}.
        │ │ │ │ +init(_Args) ->
        │ │ │ │ +    {ok, channels()}.
        │ │ │ │  
        │ │ │ │ -handle_call(alloc, _From, Chs) ->
        │ │ │ │ -    {Ch, Chs2} = alloc(Chs),
        │ │ │ │ -    {reply, Ch, Chs2};
        │ │ │ │ -handle_call(available, _From, Chs) ->
        │ │ │ │ -    N = available(Chs),
        │ │ │ │ -    {reply, N, Chs}.
        │ │ │ │ +handle_call(alloc, _From, Chs) ->
        │ │ │ │ +    {Ch, Chs2} = alloc(Chs),
        │ │ │ │ +    {reply, Ch, Chs2};
        │ │ │ │ +handle_call(available, _From, Chs) ->
        │ │ │ │ +    N = available(Chs),
        │ │ │ │ +    {reply, N, Chs}.
        │ │ │ │  
        │ │ │ │ -handle_cast({free, Ch}, Chs) ->
        │ │ │ │ -    Chs2 = free(Ch, Chs),
        │ │ │ │ -    {noreply, Chs2}.

        A new version of the ch_app.app file must now be created, where the version is │ │ │ │ -updated:

        {application, ch_app,
        │ │ │ │ - [{description, "Channel allocator"},
        │ │ │ │ -  {vsn, "2"},
        │ │ │ │ -  {modules, [ch_app, ch_sup, ch3]},
        │ │ │ │ -  {registered, [ch3]},
        │ │ │ │ -  {applications, [kernel, stdlib, sasl]},
        │ │ │ │ -  {mod, {ch_app,[]}}
        │ │ │ │ - ]}.

        To upgrade ch_app from "1" to "2" (and to downgrade from "2" to "1"), │ │ │ │ +handle_cast({free, Ch}, Chs) -> │ │ │ │ + Chs2 = free(Ch, Chs), │ │ │ │ + {noreply, Chs2}.

        A new version of the ch_app.app file must now be created, where the version is │ │ │ │ +updated:

        {application, ch_app,
        │ │ │ │ + [{description, "Channel allocator"},
        │ │ │ │ +  {vsn, "2"},
        │ │ │ │ +  {modules, [ch_app, ch_sup, ch3]},
        │ │ │ │ +  {registered, [ch3]},
        │ │ │ │ +  {applications, [kernel, stdlib, sasl]},
        │ │ │ │ +  {mod, {ch_app,[]}}
        │ │ │ │ + ]}.

        To upgrade ch_app from "1" to "2" (and to downgrade from "2" to "1"), │ │ │ │ you only need to load the new (old) version of the ch3 callback module. Create │ │ │ │ -the application upgrade file ch_app.appup in the ebin directory:

        {"2",
        │ │ │ │ - [{"1", [{load_module, ch3}]}],
        │ │ │ │ - [{"1", [{load_module, ch3}]}]
        │ │ │ │ -}.

        │ │ │ │ +the application upgrade file ch_app.appup in the ebin directory:

        {"2",
        │ │ │ │ + [{"1", [{load_module, ch3}]}],
        │ │ │ │ + [{"1", [{load_module, ch3}]}]
        │ │ │ │ +}.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Release Upgrade File │ │ │ │

        │ │ │ │

        To define how to upgrade/downgrade between the new version and previous versions │ │ │ │ of a release, a release upgrade file, or in short .relup file, is to be │ │ │ │ @@ -310,22 +310,22 @@ │ │ │ │ are to be added and deleted, and which applications that must be upgraded and/or │ │ │ │ downgraded. The instructions for this are fetched from the .appup files and │ │ │ │ transformed into a single list of low-level instructions in the right order.

        If the relup file is relatively simple, it can be created manually. It is only │ │ │ │ to contain low-level instructions.

        For details about the syntax and contents of the release upgrade file, see │ │ │ │ relup in SASL.

        Example, continued from the previous section: You have a new version "2" of │ │ │ │ ch_app and an .appup file. A new version of the .rel file is also needed. │ │ │ │ This time the file is called ch_rel-2.rel and the release version string is │ │ │ │ -changed from "A" to "B":

        {release,
        │ │ │ │ - {"ch_rel", "B"},
        │ │ │ │ - {erts, "14.2.5"},
        │ │ │ │ - [{kernel, "9.2.4"},
        │ │ │ │ -  {stdlib, "5.2.3"},
        │ │ │ │ -  {sasl, "4.2.1"},
        │ │ │ │ -  {ch_app, "2"}]
        │ │ │ │ -}.

        Now the relup file can be generated:

        1> systools:make_relup("ch_rel-2", ["ch_rel-1"], ["ch_rel-1"]).
        │ │ │ │ +changed from "A" to "B":

        {release,
        │ │ │ │ + {"ch_rel", "B"},
        │ │ │ │ + {erts, "14.2.5"},
        │ │ │ │ + [{kernel, "9.2.4"},
        │ │ │ │ +  {stdlib, "5.2.3"},
        │ │ │ │ +  {sasl, "4.2.1"},
        │ │ │ │ +  {ch_app, "2"}]
        │ │ │ │ +}.

        Now the relup file can be generated:

        1> systools:make_relup("ch_rel-2", ["ch_rel-1"], ["ch_rel-1"]).
        │ │ │ │  ok

        This generates a relup file with instructions for how to upgrade from version │ │ │ │ "A" ("ch_rel-1") to version "B" ("ch_rel-2") and how to downgrade from version │ │ │ │ "B" to version "A".

        Both the old and new versions of the .app and .rel files must be in the code │ │ │ │ path, as well as the .appup and (new) .beam files. The code path can be │ │ │ │ extended by using the option path:

        1> systools:make_relup("ch_rel-2", ["ch_rel-1"], ["ch_rel-1"],
        │ │ │ │  [{path,["../ch_rel-1",
        │ │ │ │  "../ch_rel-1/lib/ch_app-1/ebin"]}]).
        │ │ │ │ @@ -338,25 +338,25 @@
        │ │ │ │  

        When you have made a new version of a release, a release package can be created │ │ │ │ with this new version and transferred to the target environment.

        To install the new version of the release in runtime, the release │ │ │ │ handler is used. This is a process belonging to the SASL application, │ │ │ │ which handles unpacking, installation, and removal of release │ │ │ │ packages. The release_handler module communicates with this process.

        Assuming there is an operational target system with installation root directory │ │ │ │ $ROOT, the release package with the new version of the release is to be copied │ │ │ │ to $ROOT/releases.

        First, unpack the release package. The files are then extracted from the │ │ │ │ -package:

        release_handler:unpack_release(ReleaseName) => {ok, Vsn}
        • ReleaseName is the name of the release package except the .tar.gz │ │ │ │ +package:

          release_handler:unpack_release(ReleaseName) => {ok, Vsn}
          • ReleaseName is the name of the release package except the .tar.gz │ │ │ │ extension.
          • Vsn is the version of the unpacked release, as defined in its .rel file.

          A directory $ROOT/lib/releases/Vsn is created, where the .rel file, the boot │ │ │ │ script start.boot, the system configuration file sys.config, and relup are │ │ │ │ placed. For applications with new version numbers, the application directories │ │ │ │ are placed under $ROOT/lib. Unchanged applications are not affected.

          An unpacked release can be installed. The release handler then evaluates the │ │ │ │ -instructions in relup, step by step:

          release_handler:install_release(Vsn) => {ok, FromVsn, []}

          If an error occurs during the installation, the system is rebooted using the old │ │ │ │ +instructions in relup, step by step:

          release_handler:install_release(Vsn) => {ok, FromVsn, []}

          If an error occurs during the installation, the system is rebooted using the old │ │ │ │ version of the release. If installation succeeds, the system is afterwards using │ │ │ │ the new version of the release, but if anything happens and the system is │ │ │ │ rebooted, it starts using the previous version again.

          To be made the default version, the newly installed release must be made │ │ │ │ permanent, which means the previous version becomes old:

          release_handler:make_permanent(Vsn) => ok

          The system keeps information about which versions are old and permanent in the │ │ │ │ -files $ROOT/releases/RELEASES and $ROOT/releases/start_erl.data.

          To downgrade from Vsn to FromVsn, install_release must be called again:

          release_handler:install_release(FromVsn) => {ok, Vsn, []}

          An installed, but not permanent, release can be removed. Information about the │ │ │ │ +files $ROOT/releases/RELEASES and $ROOT/releases/start_erl.data.

          To downgrade from Vsn to FromVsn, install_release must be called again:

          release_handler:install_release(FromVsn) => {ok, Vsn, []}

          An installed, but not permanent, release can be removed. Information about the │ │ │ │ release is then deleted from $ROOT/releases/RELEASES and the release-specific │ │ │ │ code, that is, the new application directories and the $ROOT/releases/Vsn │ │ │ │ directory, are removed.

          release_handler:remove_release(Vsn) => ok

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Example (continued from the previous sections) │ │ │ │ @@ -367,17 +367,17 @@ │ │ │ │ is needed, the file is to contain the empty list:

          [].

          Step 2) Start the system as a simple target system. In reality, it is to be │ │ │ │ started as an embedded system. However, using erl with the correct boot script │ │ │ │ and config file is enough for illustration purposes:

          % cd $ROOT
          │ │ │ │  % bin/erl -boot $ROOT/releases/A/start -config $ROOT/releases/A/sys
          │ │ │ │  ...

          $ROOT is the installation directory of the target system.

          Step 3) In another Erlang shell, generate start scripts and create a release │ │ │ │ package for the new version "B". Remember to include (a possible updated) │ │ │ │ sys.config and the relup file. For more information, see │ │ │ │ -Release Upgrade File.

          1> systools:make_script("ch_rel-2").
          │ │ │ │ +Release Upgrade File.

          1> systools:make_script("ch_rel-2").
          │ │ │ │  ok
          │ │ │ │ -2> systools:make_tar("ch_rel-2").
          │ │ │ │ +2> systools:make_tar("ch_rel-2").
          │ │ │ │  ok

          The new release package now also contains version "2" of ch_app and the │ │ │ │ relup file:

          % tar tf ch_rel-2.tar
          │ │ │ │  lib/kernel-9.2.4/ebin/kernel.app
          │ │ │ │  lib/kernel-9.2.4/ebin/application.beam
          │ │ │ │  ...
          │ │ │ │  lib/stdlib-5.2.3/ebin/stdlib.app
          │ │ │ │  lib/stdlib-5.2.3/ebin/argparse.beam
          │ │ │ │ @@ -390,31 +390,31 @@
          │ │ │ │  lib/ch_app-2/ebin/ch_sup.beam
          │ │ │ │  lib/ch_app-2/ebin/ch3.beam
          │ │ │ │  releases/B/start.boot
          │ │ │ │  releases/B/relup
          │ │ │ │  releases/B/sys.config
          │ │ │ │  releases/B/ch_rel-2.rel
          │ │ │ │  releases/ch_rel-2.rel

          Step 4) Copy the release package ch_rel-2.tar.gz to the $ROOT/releases │ │ │ │ -directory.

          Step 5) In the running target system, unpack the release package:

          1> release_handler:unpack_release("ch_rel-2").
          │ │ │ │ -{ok,"B"}

          The new application version ch_app-2 is installed under $ROOT/lib next to │ │ │ │ +directory.

          Step 5) In the running target system, unpack the release package:

          1> release_handler:unpack_release("ch_rel-2").
          │ │ │ │ +{ok,"B"}

          The new application version ch_app-2 is installed under $ROOT/lib next to │ │ │ │ ch_app-1. The kernel, stdlib, and sasl directories are not affected, as │ │ │ │ they have not changed.

          Under $ROOT/releases, a new directory B is created, containing │ │ │ │ -ch_rel-2.rel, start.boot, sys.config, and relup.

          Step 6) Check if the function ch3:available/0 is available:

          2> ch3:available().
          │ │ │ │ +ch_rel-2.rel, start.boot, sys.config, and relup.

          Step 6) Check if the function ch3:available/0 is available:

          2> ch3:available().
          │ │ │ │  ** exception error: undefined function ch3:available/0

          Step 7) Install the new release. The instructions in $ROOT/releases/B/relup │ │ │ │ are executed one by one, resulting in the new version of ch3 being loaded. The │ │ │ │ -function ch3:available/0 is now available:

          3> release_handler:install_release("B").
          │ │ │ │ -{ok,"A",[]}
          │ │ │ │ -4> ch3:available().
          │ │ │ │ +function ch3:available/0 is now available:

          3> release_handler:install_release("B").
          │ │ │ │ +{ok,"A",[]}
          │ │ │ │ +4> ch3:available().
          │ │ │ │  3
          │ │ │ │ -5> code:which(ch3).
          │ │ │ │ +5> code:which(ch3).
          │ │ │ │  ".../lib/ch_app-2/ebin/ch3.beam"
          │ │ │ │ -6> code:which(ch_sup).
          │ │ │ │ +6> code:which(ch_sup).
          │ │ │ │  ".../lib/ch_app-1/ebin/ch_sup.beam"

          Processes in ch_app for which code have not been updated, for example, the │ │ │ │ supervisor, are still evaluating code from ch_app-1.

          Step 8) If the target system is now rebooted, it uses version "A" again. The │ │ │ │ -"B" version must be made permanent, to be used when the system is rebooted.

          7> release_handler:make_permanent("B").
          │ │ │ │ +"B" version must be made permanent, to be used when the system is rebooted.

          7> release_handler:make_permanent("B").
          │ │ │ │  ok

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Updating Application Specifications │ │ │ │

          │ │ │ │

          When a new version of a release is installed, the application specifications are │ │ │ │ @@ -423,14 +423,14 @@ │ │ │ │ boot script is generated from the same .rel file as is used to build the │ │ │ │ release package itself.

          Specifically, the application configuration parameters are automatically updated │ │ │ │ according to (in increasing priority order):

          • The data in the boot script, fetched from the new application resource file │ │ │ │ App.app
          • The new sys.config
          • Command-line arguments -App Par Val

          This means that parameter values set in the other system configuration files and │ │ │ │ values set using application:set_env/3 are disregarded.

          When an installed release is made permanent, the system process init is set to │ │ │ │ point out the new sys.config.

          After the installation, the application controller compares the old and new │ │ │ │ configuration parameters for all running applications and call the callback │ │ │ │ -function:

          Module:config_change(Changed, New, Removed)
          • Module is the application callback module as defined by the mod key in the │ │ │ │ +function:

            Module:config_change(Changed, New, Removed)
            • Module is the application callback module as defined by the mod key in the │ │ │ │ .app file.
            • Changed and New are lists of {Par,Val} for all changed and added │ │ │ │ configuration parameters, respectively.
            • Removed is a list of all parameters Par that have been removed.

            The function is optional and can be omitted when implementing an application │ │ │ │ callback module.

            │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/ref_man_records.xhtml │ │ │ │ @@ -28,17 +28,17 @@ │ │ │ │ │ │ │ │ │ │ │ │ Defining Records │ │ │ │

          │ │ │ │

          A record definition consists of the name of the record, followed by the field │ │ │ │ names of the record. Record and field names must be atoms. Each field can be │ │ │ │ given an optional default value. If no default value is supplied, undefined is │ │ │ │ -used.

          -record(Name, {Field1 [= Expr1],
          │ │ │ │ +used.

          -record(Name, {Field1 [= Expr1],
          │ │ │ │                 ...
          │ │ │ │ -               FieldN [= ExprN]}).

          The default value for a field is an arbitrary expression, except that it must │ │ │ │ + FieldN [= ExprN]}).

          The default value for a field is an arbitrary expression, except that it must │ │ │ │ not use any variables.

          A record definition can be placed anywhere among the attributes and function │ │ │ │ declarations of a module, but the definition must come before any usage of the │ │ │ │ record.

          If a record is used in several modules, it is recommended that the record │ │ │ │ definition is placed in an include file.

          Change

          Starting from Erlang/OTP 26, records can be defined in the Erlang shell │ │ │ │ using the syntax described in this section. In earlier releases, it was │ │ │ │ necessary to use the shell built-in function rd/2.

          │ │ │ │ │ │ │ │ @@ -48,32 +48,32 @@ │ │ │ │

          │ │ │ │

          The following expression creates a new Name record where the value of each │ │ │ │ field FieldI is the value of evaluating the corresponding expression ExprI:

          #Name{Field1=Expr1, ..., FieldK=ExprK}

          The fields can be in any order, not necessarily the same order as in the record │ │ │ │ definition, and fields can be omitted. Omitted fields get their respective │ │ │ │ default value instead.

          If several fields are to be assigned the same value, the following construction │ │ │ │ can be used:

          #Name{Field1=Expr1, ..., FieldK=ExprK, _=ExprL}

          Omitted fields then get the value of evaluating ExprL instead of their default │ │ │ │ values. This feature is primarily intended to be used to create patterns for ETS │ │ │ │ -and Mnesia match functions.

          Example:

          -record(person, {name, phone, address}).
          │ │ │ │ +and Mnesia match functions.

          Example:

          -record(person, {name, phone, address}).
          │ │ │ │  
          │ │ │ │ -lookup(Name, Tab) ->
          │ │ │ │ -    ets:match_object(Tab, #person{name=Name, _='_'}).

          │ │ │ │ +lookup(Name, Tab) -> │ │ │ │ + ets:match_object(Tab, #person{name=Name, _='_'}).

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Accessing Record Fields │ │ │ │

          │ │ │ │
          Expr#Name.Field

          Returns the value of the specified field. Expr is to evaluate to a Name │ │ │ │ -record.

          Example:

          -record(person, {name, phone, address}).
          │ │ │ │ +record.

          Example:

          -record(person, {name, phone, address}).
          │ │ │ │  
          │ │ │ │ -get_person_name(Person) ->
          │ │ │ │ +get_person_name(Person) ->
          │ │ │ │      Person#person.name.

          The following expression returns the position of the specified field in the │ │ │ │ -tuple representation of the record:

          #Name.Field

          Example:

          -record(person, {name, phone, address}).
          │ │ │ │ +tuple representation of the record:

          #Name.Field

          Example:

          -record(person, {name, phone, address}).
          │ │ │ │  
          │ │ │ │ -lookup(Name, List) ->
          │ │ │ │ -    lists:keyfind(Name, #person.name, List).

          │ │ │ │ +lookup(Name, List) -> │ │ │ │ + lists:keyfind(Name, #person.name, List).

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Updating Records │ │ │ │

          │ │ │ │
          Expr#Name{Field1=Expr1, ..., FieldK=ExprK}

          Expr is to evaluate to a Name record. A copy of this record is returned, │ │ │ │ with the value of each specified field FieldI changed to the value of │ │ │ │ @@ -83,48 +83,48 @@ │ │ │ │ │ │ │ │ │ │ │ │ Records in Guards │ │ │ │

        │ │ │ │

        Since record expressions are expanded to tuple expressions, creating │ │ │ │ records and accessing record fields are allowed in guards. However, │ │ │ │ all subexpressions (for initializing fields), must be valid guard │ │ │ │ -expressions as well.

        Examples:

        handle(Msg, State) when Msg =:= #msg{to=void, no=3} ->
        │ │ │ │ +expressions as well.

        Examples:

        handle(Msg, State) when Msg =:= #msg{to=void, no=3} ->
        │ │ │ │      ...
        │ │ │ │  
        │ │ │ │ -handle(Msg, State) when State#state.running =:= true ->
        │ │ │ │ -    ...

        There is also a type test BIF is_record(Term, RecordTag).

        Example:

        is_person(P) when is_record(P, person) ->
        │ │ │ │ +handle(Msg, State) when State#state.running =:= true ->
        │ │ │ │ +    ...

        There is also a type test BIF is_record(Term, RecordTag).

        Example:

        is_person(P) when is_record(P, person) ->
        │ │ │ │      true;
        │ │ │ │ -is_person(_P) ->
        │ │ │ │ +is_person(_P) ->
        │ │ │ │      false.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Records in Patterns │ │ │ │

        │ │ │ │

        A pattern that matches a certain record is created in the same way as a record │ │ │ │ is created:

        #Name{Field1=Expr1, ..., FieldK=ExprK}

        In this case, one or more of Expr1 ... ExprK can be unbound variables.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Nested Records │ │ │ │

        │ │ │ │ -

        Assume the following record definitions:

        -record(nrec0, {name = "nested0"}).
        │ │ │ │ --record(nrec1, {name = "nested1", nrec0=#nrec0{}}).
        │ │ │ │ --record(nrec2, {name = "nested2", nrec1=#nrec1{}}).
        │ │ │ │ +

        Assume the following record definitions:

        -record(nrec0, {name = "nested0"}).
        │ │ │ │ +-record(nrec1, {name = "nested1", nrec0=#nrec0{}}).
        │ │ │ │ +-record(nrec2, {name = "nested2", nrec1=#nrec1{}}).
        │ │ │ │  
        │ │ │ │ -N2 = #nrec2{},

        Accessing or updating nested records can be written without parentheses:

        "nested0" = N2#nrec2.nrec1#nrec1.nrec0#nrec0.name,
        │ │ │ │ +N2 = #nrec2{},

        Accessing or updating nested records can be written without parentheses:

        "nested0" = N2#nrec2.nrec1#nrec1.nrec0#nrec0.name,
        │ │ │ │      N0n = N2#nrec2.nrec1#nrec1.nrec0#nrec0{name = "nested0a"},

        which is equivalent to:

        "nested0" = ((N2#nrec2.nrec1)#nrec1.nrec0)#nrec0.name,
        │ │ │ │  N0n = ((N2#nrec2.nrec1)#nrec1.nrec0)#nrec0{name = "nested0a"},

        Change

        Before Erlang/OTP R14, parentheses were necessary when accessing or updating │ │ │ │ nested records.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Internal Representation of Records │ │ │ │

        │ │ │ │

        Record expressions are translated to tuple expressions during compilation. A │ │ │ │ -record defined as:

        -record(Name, {Field1, ..., FieldN}).

        is internally represented by the tuple:

        {Name, Value1, ..., ValueN}

        Here each ValueI is the default value for FieldI.

        To each module using records, a pseudo function is added during compilation to │ │ │ │ -obtain information about records:

        record_info(fields, Record) -> [Field]
        │ │ │ │ -record_info(size, Record) -> Size

        Size is the size of the tuple representation, that is, one more than the │ │ │ │ +record defined as:

        -record(Name, {Field1, ..., FieldN}).

        is internally represented by the tuple:

        {Name, Value1, ..., ValueN}

        Here each ValueI is the default value for FieldI.

        To each module using records, a pseudo function is added during compilation to │ │ │ │ +obtain information about records:

        record_info(fields, Record) -> [Field]
        │ │ │ │ +record_info(size, Record) -> Size

        Size is the size of the tuple representation, that is, one more than the │ │ │ │ number of fields.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/ref_man_processes.xhtml │ │ │ │ @@ -30,18 +30,18 @@ │ │ │ │ (grow and shrink dynamically) with small memory footprint, fast to create and │ │ │ │ terminate, and the scheduling overhead is low.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Process Creation │ │ │ │

        │ │ │ │ -

        A process is created by calling spawn():

        spawn(Module, Name, Args) -> pid()
        │ │ │ │ -  Module = Name = atom()
        │ │ │ │ -  Args = [Arg1,...,ArgN]
        │ │ │ │ -    ArgI = term()

        spawn() creates a new process and returns the pid.

        The new process starts executing in Module:Name(Arg1,...,ArgN) where the │ │ │ │ +

        A process is created by calling spawn():

        spawn(Module, Name, Args) -> pid()
        │ │ │ │ +  Module = Name = atom()
        │ │ │ │ +  Args = [Arg1,...,ArgN]
        │ │ │ │ +    ArgI = term()

        spawn() creates a new process and returns the pid.

        The new process starts executing in Module:Name(Arg1,...,ArgN) where the │ │ │ │ arguments are the elements of the (possible empty) Args argument list.

        There exist a number of different spawn BIFs:

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Registered Processes │ │ │ │

        │ │ │ │

        Besides addressing a process by using its pid, there are also BIFs for │ │ │ ├── OEBPS/ref_man_functions.xhtml │ │ │ │ @@ -25,51 +25,51 @@ │ │ │ │ │ │ │ │ │ │ │ │ Function Declaration Syntax │ │ │ │ │ │ │ │

        A function declaration is a sequence of function clauses separated by │ │ │ │ semicolons, and terminated by a period (.).

        A function clause consists of a clause head and a clause body, separated by │ │ │ │ ->.

        A clause head consists of the function name, an argument list, and an optional │ │ │ │ -guard sequence beginning with the keyword when:

        Name(Pattern11,...,Pattern1N) [when GuardSeq1] ->
        │ │ │ │ +guard sequence beginning with the keyword when:

        Name(Pattern11,...,Pattern1N) [when GuardSeq1] ->
        │ │ │ │      Body1;
        │ │ │ │  ...;
        │ │ │ │ -Name(PatternK1,...,PatternKN) [when GuardSeqK] ->
        │ │ │ │ +Name(PatternK1,...,PatternKN) [when GuardSeqK] ->
        │ │ │ │      BodyK.

        The function name is an atom. Each argument is a pattern.

        The number of arguments N is the arity of the function. A function is │ │ │ │ uniquely defined by the module name, function name, and arity. That is, two │ │ │ │ functions with the same name and in the same module, but with different arities │ │ │ │ are two different functions.

        A function named f in module mod and with arity N is often denoted as │ │ │ │ mod:f/N.

        A clause body consists of a sequence of expressions separated by comma (,):

        Expr1,
        │ │ │ │  ...,
        │ │ │ │  ExprN

        Valid Erlang expressions and guard sequences are described in │ │ │ │ -Expressions.

        Example:

        fact(N) when N > 0 ->  % first clause head
        │ │ │ │ -    N * fact(N-1);     % first clause body
        │ │ │ │ +Expressions.

        Example:

        fact(N) when N > 0 ->  % first clause head
        │ │ │ │ +    N * fact(N-1);     % first clause body
        │ │ │ │  
        │ │ │ │ -fact(0) ->             % second clause head
        │ │ │ │ +fact(0) ->             % second clause head
        │ │ │ │      1.                 % second clause body

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Function Evaluation │ │ │ │

        │ │ │ │

        When a function M:F/N is called, first the code for the function is located. │ │ │ │ If the function cannot be found, an undef runtime error occurs. Notice that │ │ │ │ the function must be exported to be visible outside the module it is defined in.

        If the function is found, the function clauses are scanned sequentially until a │ │ │ │ clause is found that fulfills both of the following two conditions:

        1. The patterns in the clause head can be successfully matched against the given │ │ │ │ arguments.
        2. The guard sequence, if any, is true.

        If such a clause cannot be found, a function_clause runtime error occurs.

        If such a clause is found, the corresponding clause body is evaluated. That is, │ │ │ │ the expressions in the body are evaluated sequentially and the value of the last │ │ │ │ -expression is returned.

        Consider the function fact:

        -module(mod).
        │ │ │ │ --export([fact/1]).
        │ │ │ │ +expression is returned.

        Consider the function fact:

        -module(mod).
        │ │ │ │ +-export([fact/1]).
        │ │ │ │  
        │ │ │ │ -fact(N) when N > 0 ->
        │ │ │ │ -    N * fact(N - 1);
        │ │ │ │ -fact(0) ->
        │ │ │ │ +fact(N) when N > 0 ->
        │ │ │ │ +    N * fact(N - 1);
        │ │ │ │ +fact(0) ->
        │ │ │ │      1.

        Assume that you want to calculate the factorial for 1:

        1> mod:fact(1).

        Evaluation starts at the first clause. The pattern N is matched against │ │ │ │ argument 1. The matching succeeds and the guard (N > 0) is true, thus N is │ │ │ │ -bound to 1, and the corresponding body is evaluated:

        N * fact(N-1) => (N is bound to 1)
        │ │ │ │ -1 * fact(0)

        Now, fact(0) is called, and the function clauses are scanned │ │ │ │ +bound to 1, and the corresponding body is evaluated:

        N * fact(N-1) => (N is bound to 1)
        │ │ │ │ +1 * fact(0)

        Now, fact(0) is called, and the function clauses are scanned │ │ │ │ sequentially again. First, the pattern N is matched against 0. The │ │ │ │ matching succeeds, but the guard (N > 0) is false. Second, the │ │ │ │ pattern 0 is matched against the argument 0. The matching succeeds │ │ │ │ and the body is evaluated:

        1 * fact(0) =>
        │ │ │ │  1 * 1 =>
        │ │ │ │  1

        Evaluation has succeed and mod:fact(1) returns 1.

        If mod:fact/1 is called with a negative number as argument, no clause head │ │ │ │ matches. A function_clause runtime error occurs.

        │ │ │ │ @@ -78,17 +78,17 @@ │ │ │ │ │ │ │ │ Tail recursion │ │ │ │

        │ │ │ │

        If the last expression of a function body is a function call, a │ │ │ │ tail-recursive call is done. This is to ensure that no system │ │ │ │ resources, for example, call stack, are consumed. This means that an │ │ │ │ infinite loop using tail-recursive calls will not exhaust the call │ │ │ │ -stack and can (in principle) run forever.

        Example:

        loop(N) ->
        │ │ │ │ -    io:format("~w~n", [N]),
        │ │ │ │ -    loop(N+1).

        The earlier factorial example is a counter-example. It is not │ │ │ │ +stack and can (in principle) run forever.

        Example:

        loop(N) ->
        │ │ │ │ +    io:format("~w~n", [N]),
        │ │ │ │ +    loop(N+1).

        The earlier factorial example is a counter-example. It is not │ │ │ │ tail-recursive, since a multiplication is done on the result of the recursive │ │ │ │ call to fact(N-1).

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Built-In Functions (BIFs) │ │ │ │

        │ │ │ │ @@ -96,14 +96,14 @@ │ │ │ │ system. BIFs do things that are difficult or impossible to implement │ │ │ │ in Erlang. Most of the BIFs belong to module erlang, but there │ │ │ │ are also BIFs belonging to a few other modules, for example lists │ │ │ │ and ets.

        The most commonly used BIFs belonging to erlang are auto-imported. They do │ │ │ │ not need to be prefixed with the module name. Which BIFs that are auto-imported │ │ │ │ is specified in the erlang module in ERTS. For example, standard-type │ │ │ │ conversion BIFs like atom_to_list and BIFs allowed in guards can be called │ │ │ │ -without specifying the module name.

        Examples:

        1> tuple_size({a,b,c}).
        │ │ │ │ +without specifying the module name.

        Examples:

        1> tuple_size({a,b,c}).
        │ │ │ │  3
        │ │ │ │ -2> atom_to_list('Erlang').
        │ │ │ │ +2> atom_to_list('Erlang').
        │ │ │ │  "Erlang"
        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/records_macros.xhtml │ │ │ │ @@ -29,40 +29,40 @@ │ │ │ │ │ │ │ │

        To illustrate this, the messenger example from the previous section is divided │ │ │ │ into the following five files:

        • mess_config.hrl

          Header file for configuration data

        • mess_interface.hrl

          Interface definitions between the client and the messenger

        • user_interface.erl

          Functions for the user interface

        • mess_client.erl

          Functions for the client side of the messenger

        • mess_server.erl

          Functions for the server side of the messenger

        While doing this, the message passing interface between the shell, the client, │ │ │ │ and the server is cleaned up and is defined using records. Also, macros are │ │ │ │ introduced:

        %%%----FILE mess_config.hrl----
        │ │ │ │  
        │ │ │ │  %%% Configure the location of the server node,
        │ │ │ │ --define(server_node, messenger@super).
        │ │ │ │ +-define(server_node, messenger@super).
        │ │ │ │  
        │ │ │ │  %%%----END FILE----
        %%%----FILE mess_interface.hrl----
        │ │ │ │  
        │ │ │ │  %%% Message interface between client and server and client shell for
        │ │ │ │  %%% messenger program
        │ │ │ │  
        │ │ │ │  %%%Messages from Client to server received in server/1 function.
        │ │ │ │ --record(logon,{client_pid, username}).
        │ │ │ │ --record(message,{client_pid, to_name, message}).
        │ │ │ │ +-record(logon,{client_pid, username}).
        │ │ │ │ +-record(message,{client_pid, to_name, message}).
        │ │ │ │  %%% {'EXIT', ClientPid, Reason}  (client terminated or unreachable.
        │ │ │ │  
        │ │ │ │  %%% Messages from Server to Client, received in await_result/0 function
        │ │ │ │ --record(abort_client,{message}).
        │ │ │ │ +-record(abort_client,{message}).
        │ │ │ │  %%% Messages are: user_exists_at_other_node,
        │ │ │ │  %%%               you_are_not_logged_on
        │ │ │ │ --record(server_reply,{message}).
        │ │ │ │ +-record(server_reply,{message}).
        │ │ │ │  %%% Messages are: logged_on
        │ │ │ │  %%%               receiver_not_found
        │ │ │ │  %%%               sent  (Message has been sent (no guarantee)
        │ │ │ │  %%% Messages from Server to Client received in client/1 function
        │ │ │ │ --record(message_from,{from_name, message}).
        │ │ │ │ +-record(message_from,{from_name, message}).
        │ │ │ │  
        │ │ │ │  %%% Messages from shell to Client received in client/1 function
        │ │ │ │  %%% spawn(mess_client, client, [server_node(), Name])
        │ │ │ │ --record(message_to,{to_name, message}).
        │ │ │ │ +-record(message_to,{to_name, message}).
        │ │ │ │  %%% logoff
        │ │ │ │  
        │ │ │ │  %%%----END FILE----
        %%%----FILE user_interface.erl----
        │ │ │ │  
        │ │ │ │  %%% User interface to the messenger program
        │ │ │ │  %%% login(Name)
        │ │ │ │  %%%     One user at a time can log in from each Erlang node in the
        │ │ │ │ @@ -75,177 +75,177 @@
        │ │ │ │  %%%     Logs off anybody at that node
        │ │ │ │  
        │ │ │ │  %%% message(ToName, Message)
        │ │ │ │  %%%     sends Message to ToName. Error messages if the user of this
        │ │ │ │  %%%     function is not logged on or if ToName is not logged on at
        │ │ │ │  %%%     any node.
        │ │ │ │  
        │ │ │ │ --module(user_interface).
        │ │ │ │ --export([logon/1, logoff/0, message/2]).
        │ │ │ │ --include("mess_interface.hrl").
        │ │ │ │ --include("mess_config.hrl").
        │ │ │ │ +-module(user_interface).
        │ │ │ │ +-export([logon/1, logoff/0, message/2]).
        │ │ │ │ +-include("mess_interface.hrl").
        │ │ │ │ +-include("mess_config.hrl").
        │ │ │ │  
        │ │ │ │ -logon(Name) ->
        │ │ │ │ -    case whereis(mess_client) of
        │ │ │ │ +logon(Name) ->
        │ │ │ │ +    case whereis(mess_client) of
        │ │ │ │          undefined ->
        │ │ │ │ -            register(mess_client,
        │ │ │ │ -                     spawn(mess_client, client, [?server_node, Name]));
        │ │ │ │ +            register(mess_client,
        │ │ │ │ +                     spawn(mess_client, client, [?server_node, Name]));
        │ │ │ │          _ -> already_logged_on
        │ │ │ │      end.
        │ │ │ │  
        │ │ │ │ -logoff() ->
        │ │ │ │ +logoff() ->
        │ │ │ │      mess_client ! logoff.
        │ │ │ │  
        │ │ │ │ -message(ToName, Message) ->
        │ │ │ │ -    case whereis(mess_client) of % Test if the client is running
        │ │ │ │ +message(ToName, Message) ->
        │ │ │ │ +    case whereis(mess_client) of % Test if the client is running
        │ │ │ │          undefined ->
        │ │ │ │              not_logged_on;
        │ │ │ │ -        _ -> mess_client ! #message_to{to_name=ToName, message=Message},
        │ │ │ │ +        _ -> mess_client ! #message_to{to_name=ToName, message=Message},
        │ │ │ │               ok
        │ │ │ │  end.
        │ │ │ │  
        │ │ │ │  %%%----END FILE----
        %%%----FILE mess_client.erl----
        │ │ │ │  
        │ │ │ │  %%% The client process which runs on each user node
        │ │ │ │  
        │ │ │ │ --module(mess_client).
        │ │ │ │ --export([client/2]).
        │ │ │ │ --include("mess_interface.hrl").
        │ │ │ │ -
        │ │ │ │ -client(Server_Node, Name) ->
        │ │ │ │ -    {messenger, Server_Node} ! #logon{client_pid=self(), username=Name},
        │ │ │ │ -    await_result(),
        │ │ │ │ -    client(Server_Node).
        │ │ │ │ +-module(mess_client).
        │ │ │ │ +-export([client/2]).
        │ │ │ │ +-include("mess_interface.hrl").
        │ │ │ │ +
        │ │ │ │ +client(Server_Node, Name) ->
        │ │ │ │ +    {messenger, Server_Node} ! #logon{client_pid=self(), username=Name},
        │ │ │ │ +    await_result(),
        │ │ │ │ +    client(Server_Node).
        │ │ │ │  
        │ │ │ │ -client(Server_Node) ->
        │ │ │ │ +client(Server_Node) ->
        │ │ │ │      receive
        │ │ │ │          logoff ->
        │ │ │ │ -            exit(normal);
        │ │ │ │ -        #message_to{to_name=ToName, message=Message} ->
        │ │ │ │ -            {messenger, Server_Node} !
        │ │ │ │ -                #message{client_pid=self(), to_name=ToName, message=Message},
        │ │ │ │ -            await_result();
        │ │ │ │ -        {message_from, FromName, Message} ->
        │ │ │ │ -            io:format("Message from ~p: ~p~n", [FromName, Message])
        │ │ │ │ +            exit(normal);
        │ │ │ │ +        #message_to{to_name=ToName, message=Message} ->
        │ │ │ │ +            {messenger, Server_Node} !
        │ │ │ │ +                #message{client_pid=self(), to_name=ToName, message=Message},
        │ │ │ │ +            await_result();
        │ │ │ │ +        {message_from, FromName, Message} ->
        │ │ │ │ +            io:format("Message from ~p: ~p~n", [FromName, Message])
        │ │ │ │      end,
        │ │ │ │ -    client(Server_Node).
        │ │ │ │ +    client(Server_Node).
        │ │ │ │  
        │ │ │ │  %%% wait for a response from the server
        │ │ │ │ -await_result() ->
        │ │ │ │ +await_result() ->
        │ │ │ │      receive
        │ │ │ │ -        #abort_client{message=Why} ->
        │ │ │ │ -            io:format("~p~n", [Why]),
        │ │ │ │ -            exit(normal);
        │ │ │ │ -        #server_reply{message=What} ->
        │ │ │ │ -            io:format("~p~n", [What])
        │ │ │ │ +        #abort_client{message=Why} ->
        │ │ │ │ +            io:format("~p~n", [Why]),
        │ │ │ │ +            exit(normal);
        │ │ │ │ +        #server_reply{message=What} ->
        │ │ │ │ +            io:format("~p~n", [What])
        │ │ │ │      after 5000 ->
        │ │ │ │ -            io:format("No response from server~n", []),
        │ │ │ │ -            exit(timeout)
        │ │ │ │ +            io:format("No response from server~n", []),
        │ │ │ │ +            exit(timeout)
        │ │ │ │      end.
        │ │ │ │  
        │ │ │ │  %%%----END FILE---
        %%%----FILE mess_server.erl----
        │ │ │ │  
        │ │ │ │  %%% This is the server process of the messenger service
        │ │ │ │  
        │ │ │ │ --module(mess_server).
        │ │ │ │ --export([start_server/0, server/0]).
        │ │ │ │ --include("mess_interface.hrl").
        │ │ │ │ -
        │ │ │ │ -server() ->
        │ │ │ │ -    process_flag(trap_exit, true),
        │ │ │ │ -    server([]).
        │ │ │ │ +-module(mess_server).
        │ │ │ │ +-export([start_server/0, server/0]).
        │ │ │ │ +-include("mess_interface.hrl").
        │ │ │ │ +
        │ │ │ │ +server() ->
        │ │ │ │ +    process_flag(trap_exit, true),
        │ │ │ │ +    server([]).
        │ │ │ │  
        │ │ │ │  %%% the user list has the format [{ClientPid1, Name1},{ClientPid22, Name2},...]
        │ │ │ │ -server(User_List) ->
        │ │ │ │ -    io:format("User list = ~p~n", [User_List]),
        │ │ │ │ +server(User_List) ->
        │ │ │ │ +    io:format("User list = ~p~n", [User_List]),
        │ │ │ │      receive
        │ │ │ │ -        #logon{client_pid=From, username=Name} ->
        │ │ │ │ -            New_User_List = server_logon(From, Name, User_List),
        │ │ │ │ -            server(New_User_List);
        │ │ │ │ -        {'EXIT', From, _} ->
        │ │ │ │ -            New_User_List = server_logoff(From, User_List),
        │ │ │ │ -            server(New_User_List);
        │ │ │ │ -        #message{client_pid=From, to_name=To, message=Message} ->
        │ │ │ │ -            server_transfer(From, To, Message, User_List),
        │ │ │ │ -            server(User_List)
        │ │ │ │ +        #logon{client_pid=From, username=Name} ->
        │ │ │ │ +            New_User_List = server_logon(From, Name, User_List),
        │ │ │ │ +            server(New_User_List);
        │ │ │ │ +        {'EXIT', From, _} ->
        │ │ │ │ +            New_User_List = server_logoff(From, User_List),
        │ │ │ │ +            server(New_User_List);
        │ │ │ │ +        #message{client_pid=From, to_name=To, message=Message} ->
        │ │ │ │ +            server_transfer(From, To, Message, User_List),
        │ │ │ │ +            server(User_List)
        │ │ │ │      end.
        │ │ │ │  
        │ │ │ │  %%% Start the server
        │ │ │ │ -start_server() ->
        │ │ │ │ -    register(messenger, spawn(?MODULE, server, [])).
        │ │ │ │ +start_server() ->
        │ │ │ │ +    register(messenger, spawn(?MODULE, server, [])).
        │ │ │ │  
        │ │ │ │  %%% Server adds a new user to the user list
        │ │ │ │ -server_logon(From, Name, User_List) ->
        │ │ │ │ +server_logon(From, Name, User_List) ->
        │ │ │ │      %% check if logged on anywhere else
        │ │ │ │ -    case lists:keymember(Name, 2, User_List) of
        │ │ │ │ +    case lists:keymember(Name, 2, User_List) of
        │ │ │ │          true ->
        │ │ │ │ -            From ! #abort_client{message=user_exists_at_other_node},
        │ │ │ │ +            From ! #abort_client{message=user_exists_at_other_node},
        │ │ │ │              User_List;
        │ │ │ │          false ->
        │ │ │ │ -            From ! #server_reply{message=logged_on},
        │ │ │ │ -            link(From),
        │ │ │ │ -            [{From, Name} | User_List]        %add user to the list
        │ │ │ │ +            From ! #server_reply{message=logged_on},
        │ │ │ │ +            link(From),
        │ │ │ │ +            [{From, Name} | User_List]        %add user to the list
        │ │ │ │      end.
        │ │ │ │  
        │ │ │ │  %%% Server deletes a user from the user list
        │ │ │ │ -server_logoff(From, User_List) ->
        │ │ │ │ -    lists:keydelete(From, 1, User_List).
        │ │ │ │ +server_logoff(From, User_List) ->
        │ │ │ │ +    lists:keydelete(From, 1, User_List).
        │ │ │ │  
        │ │ │ │  %%% Server transfers a message between user
        │ │ │ │ -server_transfer(From, To, Message, User_List) ->
        │ │ │ │ +server_transfer(From, To, Message, User_List) ->
        │ │ │ │      %% check that the user is logged on and who he is
        │ │ │ │ -    case lists:keysearch(From, 1, User_List) of
        │ │ │ │ +    case lists:keysearch(From, 1, User_List) of
        │ │ │ │          false ->
        │ │ │ │ -            From ! #abort_client{message=you_are_not_logged_on};
        │ │ │ │ -        {value, {_, Name}} ->
        │ │ │ │ -            server_transfer(From, Name, To, Message, User_List)
        │ │ │ │ +            From ! #abort_client{message=you_are_not_logged_on};
        │ │ │ │ +        {value, {_, Name}} ->
        │ │ │ │ +            server_transfer(From, Name, To, Message, User_List)
        │ │ │ │      end.
        │ │ │ │  %%% If the user exists, send the message
        │ │ │ │ -server_transfer(From, Name, To, Message, User_List) ->
        │ │ │ │ +server_transfer(From, Name, To, Message, User_List) ->
        │ │ │ │      %% Find the receiver and send the message
        │ │ │ │ -    case lists:keysearch(To, 2, User_List) of
        │ │ │ │ +    case lists:keysearch(To, 2, User_List) of
        │ │ │ │          false ->
        │ │ │ │ -            From ! #server_reply{message=receiver_not_found};
        │ │ │ │ -        {value, {ToPid, To}} ->
        │ │ │ │ -            ToPid ! #message_from{from_name=Name, message=Message},
        │ │ │ │ -            From !  #server_reply{message=sent}
        │ │ │ │ +            From ! #server_reply{message=receiver_not_found};
        │ │ │ │ +        {value, {ToPid, To}} ->
        │ │ │ │ +            ToPid ! #message_from{from_name=Name, message=Message},
        │ │ │ │ +            From !  #server_reply{message=sent}
        │ │ │ │      end.
        │ │ │ │  
        │ │ │ │  %%%----END FILE---

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Header Files │ │ │ │

        │ │ │ │

        As shown above, some files have extension .hrl. These are header files that │ │ │ │ -are included in the .erl files by:

        -include("File_Name").

        for example:

        -include("mess_interface.hrl").

        In the case above the file is fetched from the same directory as all the other │ │ │ │ +are included in the .erl files by:

        -include("File_Name").

        for example:

        -include("mess_interface.hrl").

        In the case above the file is fetched from the same directory as all the other │ │ │ │ files in the messenger example. (manual).

        .hrl files can contain any valid Erlang code but are most often used for record │ │ │ │ and macro definitions.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Records │ │ │ │

        │ │ │ │ -

        A record is defined as:

        -record(name_of_record,{field_name1, field_name2, field_name3, ......}).

        For example:

        -record(message_to,{to_name, message}).

        This is equivalent to:

        {message_to, To_Name, Message}

        Creating a record is best illustrated by an example:

        #message_to{message="hello", to_name=fred)

        This creates:

        {message_to, fred, "hello"}

        Notice that you do not have to worry about the order you assign values to the │ │ │ │ +

        A record is defined as:

        -record(name_of_record,{field_name1, field_name2, field_name3, ......}).

        For example:

        -record(message_to,{to_name, message}).

        This is equivalent to:

        {message_to, To_Name, Message}

        Creating a record is best illustrated by an example:

        #message_to{message="hello", to_name=fred)

        This creates:

        {message_to, fred, "hello"}

        Notice that you do not have to worry about the order you assign values to the │ │ │ │ various parts of the records when you create it. The advantage of using records │ │ │ │ is that by placing their definitions in header files you can conveniently define │ │ │ │ interfaces that are easy to change. For example, if you want to add a new field │ │ │ │ to the record, you only have to change the code where the new field is used and │ │ │ │ not at every place the record is referred to. If you leave out a field when │ │ │ │ creating a record, it gets the value of the atom undefined. (manual)

        Pattern matching with records is very similar to creating records. For example, │ │ │ │ -inside a case or receive:

        #message_to{to_name=ToName, message=Message} ->

        This is the same as:

        {message_to, ToName, Message}

        │ │ │ │ +inside a case or receive:

        #message_to{to_name=ToName, message=Message} ->

        This is the same as:

        {message_to, ToName, Message}

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Macros │ │ │ │

        │ │ │ │

        Another thing that has been added to the messenger is a macro. The file │ │ │ │ mess_config.hrl contains the definition:

        %%% Configure the location of the server node,
        │ │ │ │ --define(server_node, messenger@super).

        This file is included in mess_server.erl:

        -include("mess_config.hrl").

        Every occurrence of ?server_node in mess_server.erl is now replaced by │ │ │ │ -messenger@super.

        A macro is also used when spawning the server process:

        spawn(?MODULE, server, [])

        This is a standard macro (that is, defined by the system, not by the user). │ │ │ │ +-define(server_node, messenger@super).

        This file is included in mess_server.erl:

        -include("mess_config.hrl").

        Every occurrence of ?server_node in mess_server.erl is now replaced by │ │ │ │ +messenger@super.

        A macro is also used when spawning the server process:

        spawn(?MODULE, server, [])

        This is a standard macro (that is, defined by the system, not by the user). │ │ │ │ ?MODULE is always replaced by the name of the current module (that is, the │ │ │ │ -module definition near the start of the file). There are more advanced ways │ │ │ │ of using macros with, for example, parameters.

        The three Erlang (.erl) files in the messenger example are individually │ │ │ │ compiled into object code file (.beam). The Erlang system loads and links │ │ │ │ these files into the system when they are referred to during execution of the │ │ │ │ code. In this case, they are simply put in our current working directory (that │ │ │ │ is, the place you have done "cd" to). There are ways of putting the .beam │ │ │ ├── OEBPS/prog_ex_records.xhtml │ │ │ │ @@ -27,105 +27,105 @@ │ │ │ │ Records and Tuples │ │ │ │ │ │ │ │

        The main advantage of using records rather than tuples is that fields in a │ │ │ │ record are accessed by name, whereas fields in a tuple are accessed by position. │ │ │ │ To illustrate these differences, suppose that you want to represent a person │ │ │ │ with the tuple {Name, Address, Phone}.

        To write functions that manipulate this data, remember the following:

        • The Name field is the first element of the tuple.
        • The Address field is the second element.
        • The Phone field is the third element.

        For example, to extract data from a variable P that contains such a tuple, you │ │ │ │ can write the following code and then use pattern matching to extract the │ │ │ │ -relevant fields:

        Name = element(1, P),
        │ │ │ │ -Address = element(2, P),
        │ │ │ │ +relevant fields:

        Name = element(1, P),
        │ │ │ │ +Address = element(2, P),
        │ │ │ │  ...

        Such code is difficult to read and understand, and errors occur if the numbering │ │ │ │ of the elements in the tuple is wrong. If the data representation of the fields │ │ │ │ is changed, by re-ordering, adding, or removing fields, all references to the │ │ │ │ person tuple must be checked and possibly modified.

        Records allow references to the fields by name, instead of by position. In the │ │ │ │ -following example, a record instead of a tuple is used to store the data:

        -record(person, {name, phone, address}).

        This enables references to the fields of the record by name. For example, if P │ │ │ │ +following example, a record instead of a tuple is used to store the data:

        -record(person, {name, phone, address}).

        This enables references to the fields of the record by name. For example, if P │ │ │ │ is a variable whose value is a person record, the following code access the │ │ │ │ name and address fields of the records:

        Name = P#person.name,
        │ │ │ │  Address = P#person.address,
        │ │ │ │ -...

        Internally, records are represented using tagged tuples:

        {person, Name, Phone, Address}

        │ │ │ │ +...

        Internally, records are represented using tagged tuples:

        {person, Name, Phone, Address}

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Defining a Record │ │ │ │

        │ │ │ │

        This following definition of a person is used in several examples in this │ │ │ │ section. Three fields are included, name, phone, and address. The default │ │ │ │ values for name and phone is "" and [], respectively. The default value for │ │ │ │ address is the atom undefined, since no default value is supplied for this │ │ │ │ -field:

        -record(person, {name = "", phone = [], address}).

        The record must be defined in the shell to enable use of the record syntax in │ │ │ │ -the examples:

        > rd(person, {name = "", phone = [], address}).
        │ │ │ │ +field:

        -record(person, {name = "", phone = [], address}).

        The record must be defined in the shell to enable use of the record syntax in │ │ │ │ +the examples:

        > rd(person, {name = "", phone = [], address}).
        │ │ │ │  person

        This is because record definitions are only available at compile time, not at │ │ │ │ runtime. For details on records in the shell, see the shell manual page in │ │ │ │ STDLIB.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Creating a Record │ │ │ │

        │ │ │ │ -

        A new person record is created as follows:

        > #person{phone=[0,8,2,3,4,3,1,2], name="Robert"}.
        │ │ │ │ -#person{name = "Robert",phone = [0,8,2,3,4,3,1,2],address = undefined}

        As the address field was omitted, its default value is used.

        From Erlang 5.1/OTP R8B, a value to all fields in a record can be set with the │ │ │ │ -special field _. _ means "all fields not explicitly specified".

        Example:

        > #person{name = "Jakob", _ = '_'}.
        │ │ │ │ -#person{name = "Jakob",phone = '_',address = '_'}

        It is primarily intended to be used in ets:match/2 and │ │ │ │ +

        A new person record is created as follows:

        > #person{phone=[0,8,2,3,4,3,1,2], name="Robert"}.
        │ │ │ │ +#person{name = "Robert",phone = [0,8,2,3,4,3,1,2],address = undefined}

        As the address field was omitted, its default value is used.

        From Erlang 5.1/OTP R8B, a value to all fields in a record can be set with the │ │ │ │ +special field _. _ means "all fields not explicitly specified".

        Example:

        > #person{name = "Jakob", _ = '_'}.
        │ │ │ │ +#person{name = "Jakob",phone = '_',address = '_'}

        It is primarily intended to be used in ets:match/2 and │ │ │ │ mnesia:match_object/3, to set record fields to the atom '_'. (This is a │ │ │ │ wildcard in ets:match/2.)

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Accessing a Record Field │ │ │ │

        │ │ │ │ -

        The following example shows how to access a record field:

        > P = #person{name = "Joe", phone = [0,8,2,3,4,3,1,2]}.
        │ │ │ │ -#person{name = "Joe",phone = [0,8,2,3,4,3,1,2],address = undefined}
        │ │ │ │ +

        The following example shows how to access a record field:

        > P = #person{name = "Joe", phone = [0,8,2,3,4,3,1,2]}.
        │ │ │ │ +#person{name = "Joe",phone = [0,8,2,3,4,3,1,2],address = undefined}
        │ │ │ │  > P#person.name.
        │ │ │ │  "Joe"

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Updating a Record │ │ │ │

        │ │ │ │ -

        The following example shows how to update a record:

        > P1 = #person{name="Joe", phone=[1,2,3], address="A street"}.
        │ │ │ │ -#person{name = "Joe",phone = [1,2,3],address = "A street"}
        │ │ │ │ -> P2 = P1#person{name="Robert"}.
        │ │ │ │ -#person{name = "Robert",phone = [1,2,3],address = "A street"}

        │ │ │ │ +

        The following example shows how to update a record:

        > P1 = #person{name="Joe", phone=[1,2,3], address="A street"}.
        │ │ │ │ +#person{name = "Joe",phone = [1,2,3],address = "A street"}
        │ │ │ │ +> P2 = P1#person{name="Robert"}.
        │ │ │ │ +#person{name = "Robert",phone = [1,2,3],address = "A street"}

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Type Testing │ │ │ │

        │ │ │ │

        The following example shows that the guard succeeds if P is record of type │ │ │ │ -person:

        foo(P) when is_record(P, person) -> a_person;
        │ │ │ │ -foo(_) -> not_a_person.

        │ │ │ │ +person:

        foo(P) when is_record(P, person) -> a_person;
        │ │ │ │ +foo(_) -> not_a_person.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Pattern Matching │ │ │ │

        │ │ │ │

        Matching can be used in combination with records, as shown in the following │ │ │ │ -example:

        > P3 = #person{name="Joe", phone=[0,0,7], address="A street"}.
        │ │ │ │ -#person{name = "Joe",phone = [0,0,7],address = "A street"}
        │ │ │ │ -> #person{name = Name} = P3, Name.
        │ │ │ │ +example:

        > P3 = #person{name="Joe", phone=[0,0,7], address="A street"}.
        │ │ │ │ +#person{name = "Joe",phone = [0,0,7],address = "A street"}
        │ │ │ │ +> #person{name = Name} = P3, Name.
        │ │ │ │  "Joe"

        The following function takes a list of person records and searches for the │ │ │ │ -phone number of a person with a particular name:

        find_phone([#person{name=Name, phone=Phone} | _], Name) ->
        │ │ │ │ -    {found,  Phone};
        │ │ │ │ -find_phone([_| T], Name) ->
        │ │ │ │ -    find_phone(T, Name);
        │ │ │ │ -find_phone([], Name) ->
        │ │ │ │ +phone number of a person with a particular name:

        find_phone([#person{name=Name, phone=Phone} | _], Name) ->
        │ │ │ │ +    {found,  Phone};
        │ │ │ │ +find_phone([_| T], Name) ->
        │ │ │ │ +    find_phone(T, Name);
        │ │ │ │ +find_phone([], Name) ->
        │ │ │ │      not_found.

        The fields referred to in the pattern can be given in any order.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Nested Records │ │ │ │

        │ │ │ │

        The value of a field in a record can be an instance of a record. Retrieval of │ │ │ │ nested data can be done stepwise, or in a single step, as shown in the following │ │ │ │ -example:

        -record(name, {first = "Robert", last = "Ericsson"}).
        │ │ │ │ --record(person, {name = #name{}, phone}).
        │ │ │ │ +example:

        -record(name, {first = "Robert", last = "Ericsson"}).
        │ │ │ │ +-record(person, {name = #name{}, phone}).
        │ │ │ │  
        │ │ │ │ -demo() ->
        │ │ │ │ -  P = #person{name= #name{first="Robert",last="Virding"}, phone=123},
        │ │ │ │ -  First = (P#person.name)#name.first.

        Here, demo() evaluates to "Robert".

        │ │ │ │ +demo() -> │ │ │ │ + P = #person{name= #name{first="Robert",last="Virding"}, phone=123}, │ │ │ │ + First = (P#person.name)#name.first.

        Here, demo() evaluates to "Robert".

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ A Longer Example │ │ │ │

        │ │ │ │

        Comments are embedded in the following example:

        %% File: person.hrl
        │ │ │ │  
        │ │ │ │ @@ -135,44 +135,44 @@
        │ │ │ │  %%    name:  A string (default is undefined).
        │ │ │ │  %%    age:   An integer (default is undefined).
        │ │ │ │  %%    phone: A list of integers (default is []).
        │ │ │ │  %%    dict:  A dictionary containing various information
        │ │ │ │  %%           about the person.
        │ │ │ │  %%           A {Key, Value} list (default is the empty list).
        │ │ │ │  %%------------------------------------------------------------
        │ │ │ │ --record(person, {name, age, phone = [], dict = []}).
        -module(person).
        │ │ │ │ --include("person.hrl").
        │ │ │ │ --compile(export_all). % For test purposes only.
        │ │ │ │ +-record(person, {name, age, phone = [], dict = []}).
        -module(person).
        │ │ │ │ +-include("person.hrl").
        │ │ │ │ +-compile(export_all). % For test purposes only.
        │ │ │ │  
        │ │ │ │  %% This creates an instance of a person.
        │ │ │ │  %%   Note: The phone number is not supplied so the
        │ │ │ │  %%         default value [] will be used.
        │ │ │ │  
        │ │ │ │ -make_hacker_without_phone(Name, Age) ->
        │ │ │ │ -   #person{name = Name, age = Age,
        │ │ │ │ -           dict = [{computer_knowledge, excellent},
        │ │ │ │ -                   {drinks, coke}]}.
        │ │ │ │ +make_hacker_without_phone(Name, Age) ->
        │ │ │ │ +   #person{name = Name, age = Age,
        │ │ │ │ +           dict = [{computer_knowledge, excellent},
        │ │ │ │ +                   {drinks, coke}]}.
        │ │ │ │  
        │ │ │ │  %% This demonstrates matching in arguments
        │ │ │ │  
        │ │ │ │ -print(#person{name = Name, age = Age,
        │ │ │ │ -              phone = Phone, dict = Dict}) ->
        │ │ │ │ -  io:format("Name: ~s, Age: ~w, Phone: ~w ~n"
        │ │ │ │ -            "Dictionary: ~w.~n", [Name, Age, Phone, Dict]).
        │ │ │ │ +print(#person{name = Name, age = Age,
        │ │ │ │ +              phone = Phone, dict = Dict}) ->
        │ │ │ │ +  io:format("Name: ~s, Age: ~w, Phone: ~w ~n"
        │ │ │ │ +            "Dictionary: ~w.~n", [Name, Age, Phone, Dict]).
        │ │ │ │  
        │ │ │ │  %% Demonstrates type testing, selector, updating.
        │ │ │ │  
        │ │ │ │ -birthday(P) when is_record(P, person) ->
        │ │ │ │ -   P#person{age = P#person.age + 1}.
        │ │ │ │ +birthday(P) when is_record(P, person) ->
        │ │ │ │ +   P#person{age = P#person.age + 1}.
        │ │ │ │  
        │ │ │ │ -register_two_hackers() ->
        │ │ │ │ -   Hacker1 = make_hacker_without_phone("Joe", 29),
        │ │ │ │ -   OldHacker = birthday(Hacker1),
        │ │ │ │ +register_two_hackers() ->
        │ │ │ │ +   Hacker1 = make_hacker_without_phone("Joe", 29),
        │ │ │ │ +   OldHacker = birthday(Hacker1),
        │ │ │ │     % The central_register_server should have
        │ │ │ │     % an interface function for this.
        │ │ │ │ -   central_register_server ! {register_person, Hacker1},
        │ │ │ │ -   central_register_server ! {register_person,
        │ │ │ │ -             OldHacker#person{name = "Robert",
        │ │ │ │ -                              phone = [0,8,3,2,4,5,3,1]}}.
        │ │ │ │ +
        central_register_server ! {register_person, Hacker1}, │ │ │ │ + central_register_server ! {register_person, │ │ │ │ + OldHacker#person{name = "Robert", │ │ │ │ + phone = [0,8,3,2,4,5,3,1]}}.
        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/patterns.xhtml │ │ │ │ @@ -33,16 +33,16 @@ │ │ │ │ succeeds, any unbound variables in the pattern become bound. If the matching │ │ │ │ fails, an exception is raised.

        Examples:

        1> X.
        │ │ │ │  ** 1:1: variable 'X' is unbound **
        │ │ │ │  2> X = 2.
        │ │ │ │  2
        │ │ │ │  3> X + 1.
        │ │ │ │  3
        │ │ │ │ -4> {X, Y} = {1, 2}.
        │ │ │ │ +4> {X, Y} = {1, 2}.
        │ │ │ │  ** exception error: no match of right hand side value {1,2}
        │ │ │ │ -5> {X, Y} = {2, 3}.
        │ │ │ │ -{2,3}
        │ │ │ │ +5> {X, Y} = {2, 3}.
        │ │ │ │ +{2,3}
        │ │ │ │  6> Y.
        │ │ │ │  3
        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/otp-patch-apply.xhtml │ │ │ │ @@ -106,13 +106,13 @@ │ │ │ │ │ │ │ │ Sanity check │ │ │ │ │ │ │ │

        The application dependencies can be checked using the Erlang shell. │ │ │ │ Application dependencies are verified among installed applications by │ │ │ │ otp_patch_apply, but these are not necessarily those actually loaded. │ │ │ │ By calling system_information:sanity_check() one can validate │ │ │ │ -dependencies among applications actually loaded.

        1> system_information:sanity_check().
        │ │ │ │ +dependencies among applications actually loaded.

        1> system_information:sanity_check().
        │ │ │ │  ok

        Please take a look at the reference of sanity_check() for more │ │ │ │ information.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/opaques.xhtml │ │ │ │ @@ -27,24 +27,24 @@ │ │ │ │ Opaque Type Aliases │ │ │ │ │ │ │ │

        The main use case for opacity in Erlang is to hide the implementation of a data │ │ │ │ type, enabling evolving the API while minimizing the risk of breaking consumers. │ │ │ │ The runtime does not check opacity. Dialyzer provides some opacity-checking, but │ │ │ │ the rest is up to convention.

        This document explains what Erlang opacity is (and the trade-offs involved) via │ │ │ │ the example of the sets:set() data type. This type was │ │ │ │ -defined in the sets module like this:

        -opaque set(Element) :: #set{segs :: segs(Element)}.

        OTP 24 changed the definition to the following in │ │ │ │ -this commit.

        -opaque set(Element) :: #set{segs :: segs(Element)} | #{Element => ?VALUE}.

        And this change was safer and more backwards-compatible than if the type had │ │ │ │ +defined in the sets module like this:

        -opaque set(Element) :: #set{segs :: segs(Element)}.

        OTP 24 changed the definition to the following in │ │ │ │ +this commit.

        -opaque set(Element) :: #set{segs :: segs(Element)} | #{Element => ?VALUE}.

        And this change was safer and more backwards-compatible than if the type had │ │ │ │ been defined with -type instead of -opaque. Here is why: when a module │ │ │ │ defines an -opaque, the contract is that only the defining module should rely │ │ │ │ on the definition of the type: no other modules should rely on the definition.

        This means that code that pattern-matched on set as a record/tuple technically │ │ │ │ broke the contract, and opted in to being potentially broken when the definition │ │ │ │ of set() changed. Before OTP 24, this code printed ok. In OTP 24 it may │ │ │ │ -error:

        case sets:new() of
        │ │ │ │ -    Set when is_tuple(Set) ->
        │ │ │ │ -        io:format("ok")
        │ │ │ │ +error:

        case sets:new() of
        │ │ │ │ +    Set when is_tuple(Set) ->
        │ │ │ │ +        io:format("ok")
        │ │ │ │  end.

        When working with an opaque defined in another module, here are some │ │ │ │ recommendations:

        • Don't examine the underlying type using pattern-matching, guards, or functions │ │ │ │ that reveal the type, such as tuple_size/1 .
        • Instead, use functions provided by the module for working with the type. For │ │ │ │ example, sets module provides sets:new/0, sets:add_element/2, │ │ │ │ sets:is_element/2, and so on.
        • sets:set(a) is a subtype of sets:set(a | b) and not the │ │ │ │ other way around. Generally, you can rely on the property that the_opaque(T) │ │ │ │ is a subtype of the_opaque(U) when T is a subtype of U.

        When defining your own opaques, here are some recommendations:

        • Since consumers are expected to not rely on the definition of the opaque type, │ │ │ ├── OEBPS/nif.xhtml │ │ │ │ @@ -38,26 +38,26 @@ │ │ │ │ Erlang Program │ │ │ │ │ │ │ │

          Even if all functions of a module are NIFs, an Erlang module is still needed for │ │ │ │ two reasons:

          • The NIF library must be explicitly loaded by Erlang code in the same module.
          • All NIFs of a module must have an Erlang implementation as well.

          Normally these are minimal stub implementations that throw an exception. But │ │ │ │ they can also be used as fallback implementations for functions that do not have │ │ │ │ native implementations on some architectures.

          NIF libraries are loaded by calling erlang:load_nif/2, with the name of the │ │ │ │ shared library as argument. The second argument can be any term that will be │ │ │ │ -passed on to the library and used for initialization:

          -module(complex6).
          │ │ │ │ --export([foo/1, bar/1]).
          │ │ │ │ --nifs([foo/1, bar/1]).
          │ │ │ │ --on_load(init/0).
          │ │ │ │ -
          │ │ │ │ -init() ->
          │ │ │ │ -    ok = erlang:load_nif("./complex6_nif", 0).
          │ │ │ │ -
          │ │ │ │ -foo(_X) ->
          │ │ │ │ -    erlang:nif_error(nif_library_not_loaded).
          │ │ │ │ -bar(_Y) ->
          │ │ │ │ -    erlang:nif_error(nif_library_not_loaded).

          Here, the directive on_load is used to get function init to be automatically │ │ │ │ +passed on to the library and used for initialization:

          -module(complex6).
          │ │ │ │ +-export([foo/1, bar/1]).
          │ │ │ │ +-nifs([foo/1, bar/1]).
          │ │ │ │ +-on_load(init/0).
          │ │ │ │ +
          │ │ │ │ +init() ->
          │ │ │ │ +    ok = erlang:load_nif("./complex6_nif", 0).
          │ │ │ │ +
          │ │ │ │ +foo(_X) ->
          │ │ │ │ +    erlang:nif_error(nif_library_not_loaded).
          │ │ │ │ +bar(_Y) ->
          │ │ │ │ +    erlang:nif_error(nif_library_not_loaded).

          Here, the directive on_load is used to get function init to be automatically │ │ │ │ called when the module is loaded. If init returns anything other than ok, │ │ │ │ such when the loading of the NIF library fails in this example, the module is │ │ │ │ unloaded and calls to functions within it, fail.

          Loading the NIF library overrides the stub implementations and cause calls to │ │ │ │ foo and bar to be dispatched to the NIF implementations instead.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -114,22 +114,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Running the Example │ │ │ │

          │ │ │ │

          Step 1. Compile the C code:

          unix> gcc -o complex6_nif.so -fpic -shared complex.c complex6_nif.c
          │ │ │ │  windows> cl -LD -MD -Fe complex6_nif.dll complex.c complex6_nif.c

          Step 2: Start Erlang and compile the Erlang code:

          > erl
          │ │ │ │ -Erlang R13B04 (erts-5.7.5) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
          │ │ │ │ +Erlang R13B04 (erts-5.7.5) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
          │ │ │ │  
          │ │ │ │ -Eshell V5.7.5  (abort with ^G)
          │ │ │ │ -1> c(complex6).
          │ │ │ │ -{ok,complex6}

          Step 3: Run the example:

          3> complex6:foo(3).
          │ │ │ │ +Eshell V5.7.5  (abort with ^G)
          │ │ │ │ +1> c(complex6).
          │ │ │ │ +{ok,complex6}

          Step 3: Run the example:

          3> complex6:foo(3).
          │ │ │ │  4
          │ │ │ │ -4> complex6:bar(5).
          │ │ │ │ +4> complex6:bar(5).
          │ │ │ │  10
          │ │ │ │ -5> complex6:foo("not an integer").
          │ │ │ │ +5> complex6:foo("not an integer").
          │ │ │ │  ** exception error: bad argument
          │ │ │ │       in function  complex6:foo/1
          │ │ │ │          called as comlpex6:foo("not an integer")
          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/modules.xhtml │ │ │ │ @@ -23,20 +23,20 @@ │ │ │ │

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Module Syntax │ │ │ │

          │ │ │ │

          Erlang code is divided into modules. A module consists of a sequence of │ │ │ │ -attributes and function declarations, each terminated by a period (.).

          Example:

          -module(m).          % module attribute
          │ │ │ │ --export([fact/1]).   % module attribute
          │ │ │ │ +attributes and function declarations, each terminated by a period (.).

          Example:

          -module(m).          % module attribute
          │ │ │ │ +-export([fact/1]).   % module attribute
          │ │ │ │  
          │ │ │ │ -fact(N) when N>0 ->  % beginning of function declaration
          │ │ │ │ -    N * fact(N-1);   %  |
          │ │ │ │ -fact(0) ->           %  |
          │ │ │ │ +fact(N) when N>0 ->  % beginning of function declaration
          │ │ │ │ +    N * fact(N-1);   %  |
          │ │ │ │ +fact(0) ->           %  |
          │ │ │ │      1.               % end of function declaration

          For a description of function declarations, see │ │ │ │ Function Declaration Syntax.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Module Attributes │ │ │ │

          │ │ │ │ @@ -81,71 +81,71 @@ │ │ │ │ meaning.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Behaviour Module Attribute │ │ │ │

        │ │ │ │

        It is possible to specify that the module is the callback module for a │ │ │ │ -behaviour:

        -behaviour(Behaviour).

        The atom Behaviour gives the name of the behaviour, which can be a │ │ │ │ +behaviour:

        -behaviour(Behaviour).

        The atom Behaviour gives the name of the behaviour, which can be a │ │ │ │ user-defined behaviour or one of the following OTP standard behaviours:

        • gen_server
        • gen_statem
        • gen_event
        • supervisor

        The spelling behavior is also accepted.

        The callback functions of the module can be specified either directly by the │ │ │ │ -exported function behaviour_info/1:

        behaviour_info(callbacks) -> Callbacks.

        or by a -callback attribute for each callback function:

        -callback Name(Arguments) -> Result.

        Here, Arguments is a list of zero or more arguments. The -callback attribute │ │ │ │ +exported function behaviour_info/1:

        behaviour_info(callbacks) -> Callbacks.

        or by a -callback attribute for each callback function:

        -callback Name(Arguments) -> Result.

        Here, Arguments is a list of zero or more arguments. The -callback attribute │ │ │ │ is to be preferred since the extra type information can be used by tools to │ │ │ │ produce documentation or find discrepancies.

        Read more about behaviours and callback modules in │ │ │ │ OTP Design Principles.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Record Definitions │ │ │ │

        │ │ │ │ -

        The same syntax as for module attributes is used for record definitions:

        -record(Record, Fields).

        Record definitions are allowed anywhere in a module, also among the function │ │ │ │ +

        The same syntax as for module attributes is used for record definitions:

        -record(Record, Fields).

        Record definitions are allowed anywhere in a module, also among the function │ │ │ │ declarations. Read more in Records.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Preprocessor │ │ │ │

        │ │ │ │

        The same syntax as for module attributes is used by the preprocessor, which │ │ │ │ -supports file inclusion, macros, and conditional compilation:

        -include("SomeFile.hrl").
        │ │ │ │ --define(Macro, Replacement).

        Read more in Preprocessor.

        │ │ │ │ +supports file inclusion, macros, and conditional compilation:

        -include("SomeFile.hrl").
        │ │ │ │ +-define(Macro, Replacement).

        Read more in Preprocessor.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Setting File and Line │ │ │ │

        │ │ │ │

        The same syntax as for module attributes is used for changing the pre-defined │ │ │ │ -macros ?FILE and ?LINE:

        -file(File, Line).

        This attribute is used by tools, such as Yecc, to inform the compiler that the │ │ │ │ +macros ?FILE and ?LINE:

        -file(File, Line).

        This attribute is used by tools, such as Yecc, to inform the compiler that the │ │ │ │ source program is generated by another tool. It also indicates the │ │ │ │ correspondence of source files to lines of the original user-written file, from │ │ │ │ which the source program is produced.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Types and function specifications │ │ │ │

        │ │ │ │

        A similar syntax as for module attributes is used for specifying types and │ │ │ │ -function specifications:

        -type my_type() :: atom() | integer().
        │ │ │ │ --spec my_function(integer()) -> integer().

        Read more in Types and Function specifications.

        The description is based on │ │ │ │ +function specifications:

        -type my_type() :: atom() | integer().
        │ │ │ │ +-spec my_function(integer()) -> integer().

        Read more in Types and Function specifications.

        The description is based on │ │ │ │ EEP8 - Types and function specifications, │ │ │ │ which is not to be further updated.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Documentation attributes │ │ │ │

        │ │ │ │

        The module attribute -doc(Documentation) is used to provide user documentation │ │ │ │ -for a function/type/callback:

        -doc("Example documentation").
        │ │ │ │ -example() -> ok.

        The attribute should be placed just before the entity it documents.The │ │ │ │ +for a function/type/callback:

        -doc("Example documentation").
        │ │ │ │ +example() -> ok.

        The attribute should be placed just before the entity it documents.The │ │ │ │ parenthesis are optional around Documentation. The allowed values for │ │ │ │ Documentation are:

        • literal string or │ │ │ │ utf-8 encoded binary string - The string │ │ │ │ documenting the entity. Any literal string is allowed, so both │ │ │ │ triple quoted strings and │ │ │ │ sigils that translate to literal strings can be used. │ │ │ │ -The following examples are equivalent:

          -doc("Example \"docs\"").
          │ │ │ │ --doc(<<"Example \"docs\""/utf8>>).
          │ │ │ │ +The following examples are equivalent:

          -doc("Example \"docs\"").
          │ │ │ │ +-doc(<<"Example \"docs\""/utf8>>).
          │ │ │ │  -doc ~S/Example "docs"/.
          │ │ │ │  -doc """
          │ │ │ │     Example "docs"
          │ │ │ │     """
          │ │ │ │  -doc ~B|Example "docs"|.

          For clarity it is recommended to use either normal "strings" or triple │ │ │ │ quoted strings for documentation attributes.

        • {file, file:name/0 } - Read the contents of filename and use │ │ │ │ that as the documentation string.

        • false - Set the current entity as hidden, that is, it should not be │ │ │ │ @@ -158,15 +158,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ The feature directive │ │ │ │ │ │ │ │

          While not a module attribute, but rather a directive (since it might affect │ │ │ │ syntax), there is the -feature(..) directive used for enabling and disabling │ │ │ │ -features.

          The syntax is similar to that of an attribute, but has two arguments:

          -feature(FeatureName, enable | disable).

          Note that the feature directive can only appear │ │ │ │ +features.

          The syntax is similar to that of an attribute, but has two arguments:

          -feature(FeatureName, enable | disable).

          Note that the feature directive can only appear │ │ │ │ in a prefix of the module.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Comments │ │ │ │

          │ │ │ │

          Comments can be placed anywhere in a module except within strings and │ │ │ ├── OEBPS/maps.xhtml │ │ │ │ @@ -53,16 +53,16 @@ │ │ │ │ single function that constructs the map using the map syntax and always use │ │ │ │ it.

        • Always update the map using the := operator (that is, requiring that an │ │ │ │ element with that key already exists). The := operator is slightly more │ │ │ │ efficient, and it helps catching mispellings of keys.

        • Whenever possible, match multiple map elements at once.

        • Whenever possible, update multiple map elements at once.

        • Avoid default values and the maps:get/3 function. If there are default │ │ │ │ values, sharing of keys between different instances of the map will be less │ │ │ │ effective, and it is not possible to match multiple elements having default │ │ │ │ values in one go.

        • To avoid having to deal with a map that may lack some keys, maps:merge/2 can │ │ │ │ -efficiently add multiple default values. For example:

          DefaultMap = #{shoe_size => 42, editor => emacs},
          │ │ │ │ -MapWithDefaultsApplied = maps:merge(DefaultMap, OtherMap)

        │ │ │ │ +efficiently add multiple default values. For example:

        DefaultMap = #{shoe_size => 42, editor => emacs},
        │ │ │ │ +MapWithDefaultsApplied = maps:merge(DefaultMap, OtherMap)

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Using Maps as Dictionaries │ │ │ │

      │ │ │ │

      Using a map as a dictionary implies the following usage pattern:

      • Keys are usually variables not known at compile-time.
      • There can be any number of elements in the map.
      • Usually, no more than one element is looked up or updated at once.

      Given that usage pattern, the difference in performance between using the map │ │ │ │ syntax and the maps module is usually small. Therefore, which one to use is │ │ │ │ @@ -72,18 +72,18 @@ │ │ │ │ choice.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Using Maps as Sets │ │ │ │

    │ │ │ │

    Starting in OTP 24, the sets module has an option to represent sets as maps. │ │ │ │ -Examples:

    1> sets:new([{version,2}]).
    │ │ │ │ -#{}
    │ │ │ │ -2> sets:from_list([x,y,z], [{version,2}]).
    │ │ │ │ -#{x => [],y => [],z => []}

    sets backed by maps is generally the most efficient set representation, with a │ │ │ │ +Examples:

    1> sets:new([{version,2}]).
    │ │ │ │ +#{}
    │ │ │ │ +2> sets:from_list([x,y,z], [{version,2}]).
    │ │ │ │ +#{x => [],y => [],z => []}

    sets backed by maps is generally the most efficient set representation, with a │ │ │ │ few possible exceptions:

    • ordsets:intersection/2 can be more efficient than sets:intersection/2. If │ │ │ │ the intersection operation is frequently used and operations that operate on a │ │ │ │ single element in a set (such as is_element/2) are avoided, ordsets can │ │ │ │ be a better choice than sets.
    • If the intersection operation is frequently used and operations that operate │ │ │ │ on a single element in a set (such as is_element/2) must also be efficient, │ │ │ │ gb_sets can potentially be a better choice than sets.
    • If the elements of the set are integers in a fairly compact range, the set can │ │ │ │ be represented as an integer where each bit represents an element in the set. │ │ │ │ @@ -108,18 +108,18 @@ │ │ │ │ for the runtime system).

    • N - The number of elements in the map.

    • Keys - A tuple with keys of the map: {Key1,...,KeyN}. The keys are │ │ │ │ sorted.

    • Value1 - The value corresponding to the first key in the key tuple.

    • ValueN - The value corresponding to the last key in the key tuple.

    As an example, let us look at how the map #{a => foo, z => bar} is │ │ │ │ represented:

    01234
    FLATMAP2{a,z}foobar

    Table: #{a => foo, z => bar}

    Let us update the map: M#{q => baz}. The map now looks like this:

    012345
    FLATMAP3{a,q,z}foobazbar

    Table: #{a => foo, q => baz, z => bar}

    Finally, change the value of one element: M#{z := bird}. The map now looks │ │ │ │ like this:

    012345
    FLATMAP3{a,q,z}foobazbird

    Table: #{a => foo, q => baz, z => bird}

    When the value for an existing key is updated, the key tuple is not updated, │ │ │ │ allowing the key tuple to be shared with other instances of the map that have │ │ │ │ the same keys. In fact, the key tuple can be shared between all maps with the │ │ │ │ same keys with some care. To arrange that, define a function that returns a map. │ │ │ │ -For example:

    new() ->
    │ │ │ │ -    #{a => default, b => default, c => default}.

    Defined like this, the key tuple {a,b,c} will be a global literal. To ensure │ │ │ │ +For example:

    new() ->
    │ │ │ │ +    #{a => default, b => default, c => default}.

    Defined like this, the key tuple {a,b,c} will be a global literal. To ensure │ │ │ │ that the key tuple is shared when creating an instance of the map, always call │ │ │ │ -new() and modify the returned map:

        (SOME_MODULE:new())#{a := 42}.

    Using the map syntax with small maps is particularly efficient. As long as the │ │ │ │ +new() and modify the returned map:

        (SOME_MODULE:new())#{a := 42}.

    Using the map syntax with small maps is particularly efficient. As long as the │ │ │ │ keys are known at compile-time, the map is updated in one go, making the time to │ │ │ │ update a map essentially constant regardless of the number of keys updated. The │ │ │ │ same goes for matching. (When the keys are variables, one or more of the keys │ │ │ │ could be identical, so the operations need to be performed sequentially from │ │ │ │ left to right.)

    The memory size for a small map is the size of all keys and values plus 5 words. │ │ │ │ See Memory for more information about memory sizes.

    │ │ │ │ │ │ │ │ @@ -146,21 +146,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Using the Map Syntax │ │ │ │

    │ │ │ │

    Using the map syntax is usually slightly more efficient than using the │ │ │ │ corresponding function in the maps module.

    The gain in efficiency for the map syntax is more noticeable for the following │ │ │ │ -operations that can only be achieved using the map syntax:

    • Matching multiple literal keys
    • Updating multiple literal keys
    • Adding multiple literal keys to a map

    For example:

    DO

    Map = Map1#{x := X, y := Y, z := Z}

    DO NOT

    Map2 = maps:update(x, X, Map1),
    │ │ │ │ -Map3 = maps:update(y, Y, Map2),
    │ │ │ │ -Map = maps:update(z, Z, Map3)

    If the map is a small map, the first example runs roughly three times as fast.

    Note that for variable keys, the elements are updated sequentially from left to │ │ │ │ -right. For example, given the following update with variable keys:

    Map = Map1#{Key1 := X, Key2 := Y, Key3 := Z}

    the compiler rewrites it like this to ensure that the updates are applied from │ │ │ │ -left to right:

    Map2 = Map1#{Key1 := X},
    │ │ │ │ -Map3 = Map2#{Key2 := Y},
    │ │ │ │ -Map = Map3#{Key3 := Z}

    If a key is known to exist in a map, using the := operator is slightly more │ │ │ │ +operations that can only be achieved using the map syntax:

    • Matching multiple literal keys
    • Updating multiple literal keys
    • Adding multiple literal keys to a map

    For example:

    DO

    Map = Map1#{x := X, y := Y, z := Z}

    DO NOT

    Map2 = maps:update(x, X, Map1),
    │ │ │ │ +Map3 = maps:update(y, Y, Map2),
    │ │ │ │ +Map = maps:update(z, Z, Map3)

    If the map is a small map, the first example runs roughly three times as fast.

    Note that for variable keys, the elements are updated sequentially from left to │ │ │ │ +right. For example, given the following update with variable keys:

    Map = Map1#{Key1 := X, Key2 := Y, Key3 := Z}

    the compiler rewrites it like this to ensure that the updates are applied from │ │ │ │ +left to right:

    Map2 = Map1#{Key1 := X},
    │ │ │ │ +Map3 = Map2#{Key2 := Y},
    │ │ │ │ +Map = Map3#{Key3 := Z}

    If a key is known to exist in a map, using the := operator is slightly more │ │ │ │ efficient than using the => operator for a small map.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Using the Functions in the maps Module │ │ │ │

    │ │ │ │

    Here follows some notes about most of the functions in the maps module. For │ │ │ │ @@ -211,23 +211,23 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ maps:get/3 │ │ │ │ │ │ │ │

    As an optimization, the compiler will rewrite a call to maps:get/3 to Erlang │ │ │ │ code similar to the following:

    Result = case Map of
    │ │ │ │ -             #{Key := Value} -> Value;
    │ │ │ │ -             #{} -> Default
    │ │ │ │ +             #{Key := Value} -> Value;
    │ │ │ │ +             #{} -> Default
    │ │ │ │           end

    This is reasonably efficient, but if a small map is used as an alternative to │ │ │ │ using a record it is often better not to rely on default values as it prevents │ │ │ │ sharing of keys, which may in the end use more memory than what you save from │ │ │ │ not storing default values in the map.

    If default values are nevertheless required, instead of calling maps:get/3 │ │ │ │ multiple times, consider putting the default values in a map and merging that │ │ │ │ -map with the other map:

    DefaultMap = #{Key1 => Value2, Key2 => Value2, ..., KeyN => ValueN},
    │ │ │ │ -MapWithDefaultsApplied = maps:merge(DefaultMap, OtherMap)

    This helps share keys between the default map and the one you applied defaults │ │ │ │ +map with the other map:

    DefaultMap = #{Key1 => Value2, Key2 => Value2, ..., KeyN => ValueN},
    │ │ │ │ +MapWithDefaultsApplied = maps:merge(DefaultMap, OtherMap)

    This helps share keys between the default map and the one you applied defaults │ │ │ │ to, as long as the default map contains all the keys that will ever be used │ │ │ │ and not just the ones with default values. Whether this is faster than calling │ │ │ │ maps:get/3 multiple times depends on the size of the map and the number of │ │ │ │ default values.

    Change

    Before OTP 26.0 maps:get/3 was implemented by calling the function instead │ │ │ │ of rewriting it as an Erlang expression. It is now slightly faster but can no │ │ │ │ longer be traced.

    │ │ │ │ │ │ │ ├── OEBPS/macros.xhtml │ │ │ │ @@ -22,56 +22,56 @@ │ │ │ │

    │ │ │ │

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ File Inclusion │ │ │ │

    │ │ │ │ -

    A file can be included as follows:

    -include(File).
    │ │ │ │ --include_lib(File).

    File, a string, is to point out a file. The contents of this file are included │ │ │ │ +

    A file can be included as follows:

    -include(File).
    │ │ │ │ +-include_lib(File).

    File, a string, is to point out a file. The contents of this file are included │ │ │ │ as is, at the position of the directive.

    Include files are typically used for record and macro definitions that are │ │ │ │ shared by several modules. It is recommended to use the file name extension │ │ │ │ .hrl for include files.

    File can start with a path component $VAR, for some string VAR. If that is │ │ │ │ the case, the value of the environment variable VAR as returned by │ │ │ │ os:getenv(VAR) is substituted for $VAR. If os:getenv(VAR) returns false, │ │ │ │ $VAR is left as is.

    If the filename File is absolute (possibly after variable substitution), the │ │ │ │ include file with that name is included. Otherwise, the specified file is │ │ │ │ searched for in the following directories, and in this order:

    1. The current working directory
    2. The directory where the module is being compiled
    3. The directories given by the include option

    For details, see erlc in ERTS and │ │ │ │ -compile in Compiler.

    Examples:

    -include("my_records.hrl").
    │ │ │ │ --include("incdir/my_records.hrl").
    │ │ │ │ --include("/home/user/proj/my_records.hrl").
    │ │ │ │ --include("$PROJ_ROOT/my_records.hrl").

    include_lib is similar to include, but is not to point out an absolute file. │ │ │ │ +compile in Compiler.

    Examples:

    -include("my_records.hrl").
    │ │ │ │ +-include("incdir/my_records.hrl").
    │ │ │ │ +-include("/home/user/proj/my_records.hrl").
    │ │ │ │ +-include("$PROJ_ROOT/my_records.hrl").

    include_lib is similar to include, but is not to point out an absolute file. │ │ │ │ Instead, the first path component (possibly after variable substitution) is │ │ │ │ -assumed to be the name of an application.

    Example:

    -include_lib("kernel/include/file.hrl").

    The code server uses code:lib_dir(kernel) to find the directory of the current │ │ │ │ +assumed to be the name of an application.

    Example:

    -include_lib("kernel/include/file.hrl").

    The code server uses code:lib_dir(kernel) to find the directory of the current │ │ │ │ (latest) version of Kernel, and then the subdirectory include is searched for │ │ │ │ the file file.hrl.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Defining and Using Macros │ │ │ │

    │ │ │ │ -

    A macro is defined as follows:

    -define(Const, Replacement).
    │ │ │ │ --define(Func(Var1,...,VarN), Replacement).

    A macro definition can be placed anywhere among the attributes and function │ │ │ │ +

    A macro is defined as follows:

    -define(Const, Replacement).
    │ │ │ │ +-define(Func(Var1,...,VarN), Replacement).

    A macro definition can be placed anywhere among the attributes and function │ │ │ │ declarations of a module, but the definition must come before any usage of the │ │ │ │ macro.

    If a macro is used in several modules, it is recommended that the macro │ │ │ │ definition is placed in an include file.

    A macro is used as follows:

    ?Const
    │ │ │ │  ?Func(Arg1,...,ArgN)

    Macros are expanded during compilation. A simple macro ?Const is replaced with │ │ │ │ -Replacement.

    Example:

    -define(TIMEOUT, 200).
    │ │ │ │ +Replacement.

    Example:

    -define(TIMEOUT, 200).
    │ │ │ │  ...
    │ │ │ │ -call(Request) ->
    │ │ │ │ -    server:call(refserver, Request, ?TIMEOUT).

    This is expanded to:

    call(Request) ->
    │ │ │ │ -    server:call(refserver, Request, 200).

    A macro ?Func(Arg1,...,ArgN) is replaced with Replacement, where all │ │ │ │ +call(Request) -> │ │ │ │ + server:call(refserver, Request, ?TIMEOUT).

    This is expanded to:

    call(Request) ->
    │ │ │ │ +    server:call(refserver, Request, 200).

    A macro ?Func(Arg1,...,ArgN) is replaced with Replacement, where all │ │ │ │ occurrences of a variable Var from the macro definition are replaced with the │ │ │ │ -corresponding argument Arg.

    Example:

    -define(MACRO1(X, Y), {a, X, b, Y}).
    │ │ │ │ +corresponding argument Arg.

    Example:

    -define(MACRO1(X, Y), {a, X, b, Y}).
    │ │ │ │  ...
    │ │ │ │ -bar(X) ->
    │ │ │ │ -    ?MACRO1(a, b),
    │ │ │ │ -    ?MACRO1(X, 123)

    This is expanded to:

    bar(X) ->
    │ │ │ │ -    {a,a,b,b},
    │ │ │ │ -    {a,X,b,123}.

    It is good programming practice, but not mandatory, to ensure that a macro │ │ │ │ +bar(X) -> │ │ │ │ + ?MACRO1(a, b), │ │ │ │ + ?MACRO1(X, 123)

    This is expanded to:

    bar(X) ->
    │ │ │ │ +    {a,a,b,b},
    │ │ │ │ +    {a,X,b,123}.

    It is good programming practice, but not mandatory, to ensure that a macro │ │ │ │ definition is a valid Erlang syntactic form.

    To view the result of macro expansion, a module can be compiled with the 'P' │ │ │ │ option. compile:file(File, ['P']). This produces a listing of the parsed code │ │ │ │ after preprocessing and parse transforms, in the file File.P.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Predefined Macros │ │ │ │ @@ -90,29 +90,29 @@ │ │ │ │ │ │ │ │ │ │ │ │ Macros Overloading │ │ │ │

    │ │ │ │

    It is possible to overload macros, except for predefined macros. An overloaded │ │ │ │ macro has more than one definition, each with a different number of arguments.

    Change

    Support for overloading of macros was added in Erlang 5.7.5/OTP R13B04.

    A macro ?Func(Arg1,...,ArgN) with a (possibly empty) list of arguments results │ │ │ │ in an error message if there is at least one definition of Func with │ │ │ │ -arguments, but none with N arguments.

    Assuming these definitions:

    -define(F0(), c).
    │ │ │ │ --define(F1(A), A).
    │ │ │ │ --define(C, m:f).

    the following does not work:

    f0() ->
    │ │ │ │ +arguments, but none with N arguments.

    Assuming these definitions:

    -define(F0(), c).
    │ │ │ │ +-define(F1(A), A).
    │ │ │ │ +-define(C, m:f).

    the following does not work:

    f0() ->
    │ │ │ │      ?F0. % No, an empty list of arguments expected.
    │ │ │ │  
    │ │ │ │ -f1(A) ->
    │ │ │ │ -    ?F1(A, A). % No, exactly one argument expected.

    On the other hand,

    f() ->
    │ │ │ │ -    ?C().

    is expanded to

    f() ->
    │ │ │ │ -    m:f().

    │ │ │ │ +f1(A) -> │ │ │ │ + ?F1(A, A). % No, exactly one argument expected.

    On the other hand,

    f() ->
    │ │ │ │ +    ?C().

    is expanded to

    f() ->
    │ │ │ │ +    m:f().

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Removing a macro definition │ │ │ │

    │ │ │ │ -

    A definition of macro can be removed as follows:

    -undef(Macro).

    │ │ │ │ +

    A definition of macro can be removed as follows:

    -undef(Macro).

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Conditional Compilation │ │ │ │

    │ │ │ │

    The following macro directives support conditional compilation:

    • -ifdef(Macro). - Evaluate the following lines only if Macro is │ │ │ │ defined.

    • -ifndef(Macro). - Evaluate the following lines only if Macro is not │ │ │ │ @@ -124,43 +124,43 @@ │ │ │ │ true, and the Condition evaluates to true, the lines following the elif │ │ │ │ are evaluated instead.

    • -endif. - Specifies the end of a series of control flow directives.

    Note

    Macro directives cannot be used inside functions.

    Syntactically, the Condition in if and elif must be a │ │ │ │ guard expression. Other constructs (such as │ │ │ │ a case expression) result in a compilation error.

    As opposed to the standard guard expressions, an expression in an if and │ │ │ │ elif also supports calling the psuedo-function defined(Name), which tests │ │ │ │ whether the Name argument is the name of a previously defined macro. │ │ │ │ defined(Name) evaluates to true if the macro is defined and false │ │ │ │ -otherwise. An attempt to call other functions results in a compilation error.

    Example:

    -module(m).
    │ │ │ │ +otherwise. An attempt to call other functions results in a compilation error.

    Example:

    -module(m).
    │ │ │ │  ...
    │ │ │ │  
    │ │ │ │ --ifdef(debug).
    │ │ │ │ --define(LOG(X), io:format("{~p,~p}: ~p~n", [?MODULE,?LINE,X])).
    │ │ │ │ +-ifdef(debug).
    │ │ │ │ +-define(LOG(X), io:format("{~p,~p}: ~p~n", [?MODULE,?LINE,X])).
    │ │ │ │  -else.
    │ │ │ │ --define(LOG(X), true).
    │ │ │ │ +-define(LOG(X), true).
    │ │ │ │  -endif.
    │ │ │ │  
    │ │ │ │  ...

    When trace output is desired, debug is to be defined when the module m is │ │ │ │ compiled:

    % erlc -Ddebug m.erl
    │ │ │ │  
    │ │ │ │  or
    │ │ │ │  
    │ │ │ │ -1> c(m, {d, debug}).
    │ │ │ │ -{ok,m}

    ?LOG(Arg) is then expanded to a call to io:format/2 and provide the user │ │ │ │ -with some simple trace output.

    Example:

    -module(m)
    │ │ │ │ +1> c(m, {d, debug}).
    │ │ │ │ +{ok,m}

    ?LOG(Arg) is then expanded to a call to io:format/2 and provide the user │ │ │ │ +with some simple trace output.

    Example:

    -module(m)
    │ │ │ │  ...
    │ │ │ │ --if(?OTP_RELEASE >= 25).
    │ │ │ │ +-if(?OTP_RELEASE >= 25).
    │ │ │ │  %% Code that will work in OTP 25 or higher
    │ │ │ │ --elif(?OTP_RELEASE >= 26).
    │ │ │ │ +-elif(?OTP_RELEASE >= 26).
    │ │ │ │  %% Code that will work in OTP 26 or higher
    │ │ │ │  -else.
    │ │ │ │  %% Code that will work in OTP 24 or lower.
    │ │ │ │  -endif.
    │ │ │ │  ...

    This code uses the OTP_RELEASE macro to conditionally select code depending on │ │ │ │ -release.

    Example:

    -module(m)
    │ │ │ │ +release.

    Example:

    -module(m)
    │ │ │ │  ...
    │ │ │ │ --if(?OTP_RELEASE >= 26 andalso defined(debug)).
    │ │ │ │ +-if(?OTP_RELEASE >= 26 andalso defined(debug)).
    │ │ │ │  %% Debugging code that requires OTP 26 or later.
    │ │ │ │  -else.
    │ │ │ │  %% Non-debug code that works in any release.
    │ │ │ │  -endif.
    │ │ │ │  ...

    This code uses the OTP_RELEASE macro and defined(debug) to compile debug │ │ │ │ code only for OTP 26 or later.

    │ │ │ │ │ │ │ │ @@ -175,40 +175,40 @@ │ │ │ │ used. In practice this means it should appear before any -export(..) or record │ │ │ │ definitions.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -error() and -warning() directives │ │ │ │

    │ │ │ │ -

    The directive -error(Term) causes a compilation error.

    Example:

    -module(t).
    │ │ │ │ --export([version/0]).
    │ │ │ │ +

    The directive -error(Term) causes a compilation error.

    Example:

    -module(t).
    │ │ │ │ +-export([version/0]).
    │ │ │ │  
    │ │ │ │ --ifdef(VERSION).
    │ │ │ │ -version() -> ?VERSION.
    │ │ │ │ +-ifdef(VERSION).
    │ │ │ │ +version() -> ?VERSION.
    │ │ │ │  -else.
    │ │ │ │ --error("Macro VERSION must be defined.").
    │ │ │ │ -version() -> "".
    │ │ │ │ +-error("Macro VERSION must be defined.").
    │ │ │ │ +version() -> "".
    │ │ │ │  -endif.

    The error message will look like this:

    % erlc t.erl
    │ │ │ │ -t.erl:7: -error("Macro VERSION must be defined.").

    The directive -warning(Term) causes a compilation warning.

    Example:

    -module(t).
    │ │ │ │ --export([version/0]).
    │ │ │ │ +t.erl:7: -error("Macro VERSION must be defined.").

    The directive -warning(Term) causes a compilation warning.

    Example:

    -module(t).
    │ │ │ │ +-export([version/0]).
    │ │ │ │  
    │ │ │ │ --ifndef(VERSION).
    │ │ │ │ --warning("Macro VERSION not defined -- using default version.").
    │ │ │ │ --define(VERSION, "0").
    │ │ │ │ +-ifndef(VERSION).
    │ │ │ │ +-warning("Macro VERSION not defined -- using default version.").
    │ │ │ │ +-define(VERSION, "0").
    │ │ │ │  -endif.
    │ │ │ │ -version() -> ?VERSION.

    The warning message will look like this:

    % erlc t.erl
    │ │ │ │ +version() -> ?VERSION.

    The warning message will look like this:

    % erlc t.erl
    │ │ │ │  t.erl:5: Warning: -warning("Macro VERSION not defined -- using default version.").

    Change

    The -error() and -warning() directives were added in Erlang/OTP 19.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Stringifying Macro Arguments │ │ │ │

    │ │ │ │

    The construction ??Arg, where Arg is a macro argument, is expanded to a │ │ │ │ string containing the tokens of the argument. This is similar to the #arg │ │ │ │ -stringifying construction in C.

    Example:

    -define(TESTCALL(Call), io:format("Call ~s: ~w~n", [??Call, Call])).
    │ │ │ │ +stringifying construction in C.

    Example:

    -define(TESTCALL(Call), io:format("Call ~s: ~w~n", [??Call, Call])).
    │ │ │ │  
    │ │ │ │ -?TESTCALL(myfunction(1,2)),
    │ │ │ │ -?TESTCALL(you:function(2,1)).

    results in

    io:format("Call ~s: ~w~n",["myfunction ( 1 , 2 )",myfunction(1,2)]),
    │ │ │ │ -io:format("Call ~s: ~w~n",["you : function ( 2 , 1 )",you:function(2,1)]).

    That is, a trace output, with both the function called and the resulting value.

    │ │ │ │ +
    ?TESTCALL(myfunction(1,2)), │ │ │ │ +?TESTCALL(you:function(2,1)).

    results in

    io:format("Call ~s: ~w~n",["myfunction ( 1 , 2 )",myfunction(1,2)]),
    │ │ │ │ +io:format("Call ~s: ~w~n",["you : function ( 2 , 1 )",you:function(2,1)]).

    That is, a trace output, with both the function called and the resulting value.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/listhandling.xhtml │ │ │ │ @@ -25,101 +25,101 @@ │ │ │ │ │ │ │ │ │ │ │ │ Creating a List │ │ │ │

    │ │ │ │

    Lists can only be built starting from the end and attaching list elements at the │ │ │ │ beginning. If you use the ++ operator as follows, a new list is created that │ │ │ │ is a copy of the elements in List1, followed by List2:

    List1 ++ List2

    Looking at how lists:append/2 or ++ would be implemented in plain Erlang, │ │ │ │ -clearly the first list is copied:

    append([H|T], Tail) ->
    │ │ │ │ -    [H|append(T, Tail)];
    │ │ │ │ -append([], Tail) ->
    │ │ │ │ +clearly the first list is copied:

    append([H|T], Tail) ->
    │ │ │ │ +    [H|append(T, Tail)];
    │ │ │ │ +append([], Tail) ->
    │ │ │ │      Tail.

    When recursing and building a list, it is important to ensure that you attach │ │ │ │ the new elements to the beginning of the list. In this way, you will build one │ │ │ │ -list, not hundreds or thousands of copies of the growing result list.

    Let us first see how it is not to be done:

    DO NOT

    bad_fib(N) ->
    │ │ │ │ -    bad_fib(N, 0, 1, []).
    │ │ │ │ +list, not hundreds or thousands of copies of the growing result list.

    Let us first see how it is not to be done:

    DO NOT

    bad_fib(N) ->
    │ │ │ │ +    bad_fib(N, 0, 1, []).
    │ │ │ │  
    │ │ │ │ -bad_fib(0, _Current, _Next, Fibs) ->
    │ │ │ │ +bad_fib(0, _Current, _Next, Fibs) ->
    │ │ │ │      Fibs;
    │ │ │ │ -bad_fib(N, Current, Next, Fibs) ->
    │ │ │ │ -    bad_fib(N - 1, Next, Current + Next, Fibs ++ [Current]).

    Here more than one list is built. In each iteration step a new list is created │ │ │ │ +bad_fib(N, Current, Next, Fibs) -> │ │ │ │ + bad_fib(N - 1, Next, Current + Next, Fibs ++ [Current]).

    Here more than one list is built. In each iteration step a new list is created │ │ │ │ that is one element longer than the new previous list.

    To avoid copying the result in each iteration, build the list in reverse order │ │ │ │ -and reverse the list when you are done:

    DO

    tail_recursive_fib(N) ->
    │ │ │ │ -    tail_recursive_fib(N, 0, 1, []).
    │ │ │ │ +and reverse the list when you are done:

    DO

    tail_recursive_fib(N) ->
    │ │ │ │ +    tail_recursive_fib(N, 0, 1, []).
    │ │ │ │  
    │ │ │ │ -tail_recursive_fib(0, _Current, _Next, Fibs) ->
    │ │ │ │ -    lists:reverse(Fibs);
    │ │ │ │ -tail_recursive_fib(N, Current, Next, Fibs) ->
    │ │ │ │ -    tail_recursive_fib(N - 1, Next, Current + Next, [Current|Fibs]).

    │ │ │ │ +tail_recursive_fib(0, _Current, _Next, Fibs) -> │ │ │ │ + lists:reverse(Fibs); │ │ │ │ +tail_recursive_fib(N, Current, Next, Fibs) -> │ │ │ │ + tail_recursive_fib(N - 1, Next, Current + Next, [Current|Fibs]).

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ List Comprehensions │ │ │ │

    │ │ │ │ -

    A list comprehension:

    [Expr(E) || E <- List]

    is basically translated to a local function:

    'lc^0'([E|Tail], Expr) ->
    │ │ │ │ -    [Expr(E)|'lc^0'(Tail, Expr)];
    │ │ │ │ -'lc^0'([], _Expr) -> [].

    If the result of the list comprehension will obviously not be used, a list │ │ │ │ -will not be constructed. For example, in this code:

    [io:put_chars(E) || E <- List],
    │ │ │ │ +

    A list comprehension:

    [Expr(E) || E <- List]

    is basically translated to a local function:

    'lc^0'([E|Tail], Expr) ->
    │ │ │ │ +    [Expr(E)|'lc^0'(Tail, Expr)];
    │ │ │ │ +'lc^0'([], _Expr) -> [].

    If the result of the list comprehension will obviously not be used, a list │ │ │ │ +will not be constructed. For example, in this code:

    [io:put_chars(E) || E <- List],
    │ │ │ │  ok.

    or in this code:

    case Var of
    │ │ │ │      ... ->
    │ │ │ │ -        [io:put_chars(E) || E <- List];
    │ │ │ │ +        [io:put_chars(E) || E <- List];
    │ │ │ │      ... ->
    │ │ │ │  end,
    │ │ │ │ -some_function(...),

    the value is not assigned to a variable, not passed to another function, and not │ │ │ │ +some_function(...),

    the value is not assigned to a variable, not passed to another function, and not │ │ │ │ returned. This means that there is no need to construct a list and the compiler │ │ │ │ -will simplify the code for the list comprehension to:

    'lc^0'([E|Tail], Expr) ->
    │ │ │ │ -    Expr(E),
    │ │ │ │ -    'lc^0'(Tail, Expr);
    │ │ │ │ -'lc^0'([], _Expr) -> [].

    The compiler also understands that assigning to _ means that the value will │ │ │ │ -not be used. Therefore, the code in the following example will also be optimized:

    _ = [io:put_chars(E) || E <- List],
    │ │ │ │ +will simplify the code for the list comprehension to:

    'lc^0'([E|Tail], Expr) ->
    │ │ │ │ +    Expr(E),
    │ │ │ │ +    'lc^0'(Tail, Expr);
    │ │ │ │ +'lc^0'([], _Expr) -> [].

    The compiler also understands that assigning to _ means that the value will │ │ │ │ +not be used. Therefore, the code in the following example will also be optimized:

    _ = [io:put_chars(E) || E <- List],
    │ │ │ │  ok.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Deep and Flat Lists │ │ │ │

    │ │ │ │

    lists:flatten/1 builds an entirely new list. It is therefore expensive, and │ │ │ │ even more expensive than the ++ operator (which copies its left argument, │ │ │ │ but not its right argument).

    In the following situations it is unnecessary to call lists:flatten/1:

    • When sending data to a port. Ports understand deep lists so there is no reason │ │ │ │ to flatten the list before sending it to the port.
    • When calling BIFs that accept deep lists, such as │ │ │ │ list_to_binary/1 or │ │ │ │ iolist_to_binary/1.
    • When you know that your list is only one level deep. Use lists:append/1 │ │ │ │ -instead.

    Examples:

    DO

    port_command(Port, DeepList)

    DO NOT

    port_command(Port, lists:flatten(DeepList))

    A common way to send a zero-terminated string to a port is the following:

    DO NOT

    TerminatedStr = String ++ [0],
    │ │ │ │ -port_command(Port, TerminatedStr)

    Instead:

    DO

    TerminatedStr = [String, 0],
    │ │ │ │ -port_command(Port, TerminatedStr)

    DO

    1> lists:append([[1], [2], [3]]).
    │ │ │ │ -[1,2,3]

    DO NOT

    1> lists:flatten([[1], [2], [3]]).
    │ │ │ │ -[1,2,3]

    │ │ │ │ +instead.

Examples:

DO

port_command(Port, DeepList)

DO NOT

port_command(Port, lists:flatten(DeepList))

A common way to send a zero-terminated string to a port is the following:

DO NOT

TerminatedStr = String ++ [0],
│ │ │ │ +port_command(Port, TerminatedStr)

Instead:

DO

TerminatedStr = [String, 0],
│ │ │ │ +port_command(Port, TerminatedStr)

DO

1> lists:append([[1], [2], [3]]).
│ │ │ │ +[1,2,3]

DO NOT

1> lists:flatten([[1], [2], [3]]).
│ │ │ │ +[1,2,3]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Recursive List Functions │ │ │ │

│ │ │ │

There are two basic ways to write a function that traverses a list and │ │ │ │ produces a new list.

The first way is writing a body-recursive function:

%% Add 42 to each integer in the list.
│ │ │ │ -add_42_body([H|T]) ->
│ │ │ │ -    [H + 42 | add_42_body(T)];
│ │ │ │ -add_42_body([]) ->
│ │ │ │ -    [].

The second way is writing a tail-recursive function:

%% Add 42 to each integer in the list.
│ │ │ │ -add_42_tail(List) ->
│ │ │ │ -    add_42_tail(List, []).
│ │ │ │ +add_42_body([H|T]) ->
│ │ │ │ +    [H + 42 | add_42_body(T)];
│ │ │ │ +add_42_body([]) ->
│ │ │ │ +    [].

The second way is writing a tail-recursive function:

%% Add 42 to each integer in the list.
│ │ │ │ +add_42_tail(List) ->
│ │ │ │ +    add_42_tail(List, []).
│ │ │ │  
│ │ │ │ -add_42_tail([H|T], Acc) ->
│ │ │ │ -    add_42_tail(T, [H + 42 | Acc]);
│ │ │ │ -add_42_tail([], Acc) ->
│ │ │ │ -    lists:reverse(Acc).

In early version of Erlang the tail-recursive function would typically │ │ │ │ +add_42_tail([H|T], Acc) -> │ │ │ │ + add_42_tail(T, [H + 42 | Acc]); │ │ │ │ +add_42_tail([], Acc) -> │ │ │ │ + lists:reverse(Acc).

In early version of Erlang the tail-recursive function would typically │ │ │ │ be more efficient. In modern versions of Erlang, there is usually not │ │ │ │ much difference in performance between a body-recursive list function and │ │ │ │ tail-recursive function that reverses the list at the end. Therefore, │ │ │ │ concentrate on writing beautiful code and forget about the performance │ │ │ │ of your list functions. In the time-critical parts of your code, │ │ │ │ measure before rewriting your code.

For a thorough discussion about tail and body recursion, see │ │ │ │ Erlang's Tail Recursion is Not a Silver Bullet.

Note

This section is about list functions that construct lists. A tail-recursive │ │ │ │ function that does not construct a list runs in constant space, while the │ │ │ │ corresponding body-recursive function uses stack space proportional to the │ │ │ │ length of the list.

For example, a function that sums a list of integers, is not to be written as │ │ │ │ -follows:

DO NOT

recursive_sum([H|T]) -> H+recursive_sum(T);
│ │ │ │ -recursive_sum([])    -> 0.

Instead:

DO

sum(L) -> sum(L, 0).
│ │ │ │ +follows:

DO NOT

recursive_sum([H|T]) -> H+recursive_sum(T);
│ │ │ │ +recursive_sum([])    -> 0.

Instead:

DO

sum(L) -> sum(L, 0).
│ │ │ │  
│ │ │ │ -sum([H|T], Sum) -> sum(T, Sum + H);
│ │ │ │ -sum([], Sum)    -> Sum.
│ │ │ │ +
sum([H|T], Sum) -> sum(T, Sum + H); │ │ │ │ +sum([], Sum) -> Sum.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/list_comprehensions.xhtml │ │ │ │ @@ -22,33 +22,33 @@ │ │ │ │ │ │ │ │

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Simple Examples │ │ │ │

│ │ │ │ -

This section starts with a simple example, showing a generator and a filter:

> [X || X <- [1,2,a,3,4,b,5,6], X > 3].
│ │ │ │ -[a,4,b,5,6]

This is read as follows: The list of X such that X is taken from the list │ │ │ │ +

This section starts with a simple example, showing a generator and a filter:

> [X || X <- [1,2,a,3,4,b,5,6], X > 3].
│ │ │ │ +[a,4,b,5,6]

This is read as follows: The list of X such that X is taken from the list │ │ │ │ [1,2,a,...] and X is greater than 3.

The notation X <- [1,2,a,...] is a generator and the expression X > 3 is a │ │ │ │ filter.

An additional filter, is_integer(X), can be added to │ │ │ │ -restrict the result to integers:

> [X || X <- [1,2,a,3,4,b,5,6], is_integer(X), X > 3].
│ │ │ │ -[4,5,6]

Generators can be combined. For example, the Cartesian product of two lists can │ │ │ │ -be written as follows:

> [{X, Y} || X <- [1,2,3], Y <- [a,b]].
│ │ │ │ -[{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}]

│ │ │ │ +restrict the result to integers:

> [X || X <- [1,2,a,3,4,b,5,6], is_integer(X), X > 3].
│ │ │ │ +[4,5,6]

Generators can be combined. For example, the Cartesian product of two lists can │ │ │ │ +be written as follows:

> [{X, Y} || X <- [1,2,3], Y <- [a,b]].
│ │ │ │ +[{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Quick Sort │ │ │ │

│ │ │ │ -

The well-known quick sort routine can be written as follows:

sort([]) -> [];
│ │ │ │ -sort([_] = L) -> L;
│ │ │ │ -sort([Pivot|T]) ->
│ │ │ │ -    sort([ X || X <- T, X < Pivot]) ++
│ │ │ │ -    [Pivot] ++
│ │ │ │ -    sort([ X || X <- T, X >= Pivot]).

The expression [X || X <- T, X < Pivot] is the list of all elements in T │ │ │ │ +

The well-known quick sort routine can be written as follows:

sort([]) -> [];
│ │ │ │ +sort([_] = L) -> L;
│ │ │ │ +sort([Pivot|T]) ->
│ │ │ │ +    sort([ X || X <- T, X < Pivot]) ++
│ │ │ │ +    [Pivot] ++
│ │ │ │ +    sort([ X || X <- T, X >= Pivot]).

The expression [X || X <- T, X < Pivot] is the list of all elements in T │ │ │ │ that are less than Pivot.

[X || X <- T, X >= Pivot] is the list of all elements in T that are greater │ │ │ │ than or equal to Pivot.

With the algorithm above, a list is sorted as follows:

  • A list with zero or one element is trivially sorted.
  • For lists with more than one element:
    1. The first element in the list is isolated as the pivot element.
    2. The remaining list is partitioned into two sublists, such that:
    • The first sublist contains all elements that are smaller than the pivot │ │ │ │ element.
    • The second sublist contains all elements that are greater than or equal to │ │ │ │ the pivot element.
    1. The sublists are recursively sorted by the same algorithm and the results │ │ │ │ are combined, resulting in a list consisting of:
    • All elements from the first sublist, that is all elements smaller than the │ │ │ │ pivot element, in sorted order.
    • The pivot element.
    • All elements from the second sublist, that is all elements greater than or │ │ │ │ equal to the pivot element, in sorted order.

Note

While the sorting algorithm as shown above serves as a nice example to │ │ │ │ @@ -56,90 +56,90 @@ │ │ │ │ lists module contains sorting functions that are implemented in a more │ │ │ │ efficient way.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Permutations │ │ │ │

│ │ │ │ -

The following example generates all permutations of the elements in a list:

perms([]) -> [[]];
│ │ │ │ -perms(L)  -> [[H|T] || H <- L, T <- perms(L--[H])].

This takes H from L in all possible ways. The result is the set of all lists │ │ │ │ +

The following example generates all permutations of the elements in a list:

perms([]) -> [[]];
│ │ │ │ +perms(L)  -> [[H|T] || H <- L, T <- perms(L--[H])].

This takes H from L in all possible ways. The result is the set of all lists │ │ │ │ [H|T], where T is the set of all possible permutations of L, with H │ │ │ │ -removed:

> perms([b,u,g]).
│ │ │ │ -[[b,u,g],[b,g,u],[u,b,g],[u,g,b],[g,b,u],[g,u,b]]

│ │ │ │ +removed:

> perms([b,u,g]).
│ │ │ │ +[[b,u,g],[b,g,u],[u,b,g],[u,g,b],[g,b,u],[g,u,b]]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Pythagorean Triplets │ │ │ │

│ │ │ │

Pythagorean triplets are sets of integers {A,B,C} such that │ │ │ │ A**2 + B**2 = C**2.

The function pyth(N) generates a list of all integers {A,B,C} such that │ │ │ │ A**2 + B**2 = C**2 and where the sum of the sides is equal to, or less than, │ │ │ │ -N:

pyth(N) ->
│ │ │ │ -    [ {A,B,C} ||
│ │ │ │ -        A <- lists:seq(1,N),
│ │ │ │ -        B <- lists:seq(1,N),
│ │ │ │ -        C <- lists:seq(1,N),
│ │ │ │ +N:

pyth(N) ->
│ │ │ │ +    [ {A,B,C} ||
│ │ │ │ +        A <- lists:seq(1,N),
│ │ │ │ +        B <- lists:seq(1,N),
│ │ │ │ +        C <- lists:seq(1,N),
│ │ │ │          A+B+C =< N,
│ │ │ │          A*A+B*B == C*C
│ │ │ │ -    ].
> pyth(3).
│ │ │ │ -[].
│ │ │ │ -> pyth(11).
│ │ │ │ -[].
│ │ │ │ -> pyth(12).
│ │ │ │ -[{3,4,5},{4,3,5}]
│ │ │ │ -> pyth(50).
│ │ │ │ -[{3,4,5},
│ │ │ │ - {4,3,5},
│ │ │ │ - {5,12,13},
│ │ │ │ - {6,8,10},
│ │ │ │ - {8,6,10},
│ │ │ │ - {8,15,17},
│ │ │ │ - {9,12,15},
│ │ │ │ - {12,5,13},
│ │ │ │ - {12,9,15},
│ │ │ │ - {12,16,20},
│ │ │ │ - {15,8,17},
│ │ │ │ - {16,12,20}]

The following code reduces the search space and is more efficient:

pyth1(N) ->
│ │ │ │ -   [{A,B,C} ||
│ │ │ │ -       A <- lists:seq(1,N-2),
│ │ │ │ -       B <- lists:seq(A+1,N-1),
│ │ │ │ -       C <- lists:seq(B+1,N),
│ │ │ │ +    ].
> pyth(3).
│ │ │ │ +[].
│ │ │ │ +> pyth(11).
│ │ │ │ +[].
│ │ │ │ +> pyth(12).
│ │ │ │ +[{3,4,5},{4,3,5}]
│ │ │ │ +> pyth(50).
│ │ │ │ +[{3,4,5},
│ │ │ │ + {4,3,5},
│ │ │ │ + {5,12,13},
│ │ │ │ + {6,8,10},
│ │ │ │ + {8,6,10},
│ │ │ │ + {8,15,17},
│ │ │ │ + {9,12,15},
│ │ │ │ + {12,5,13},
│ │ │ │ + {12,9,15},
│ │ │ │ + {12,16,20},
│ │ │ │ + {15,8,17},
│ │ │ │ + {16,12,20}]

The following code reduces the search space and is more efficient:

pyth1(N) ->
│ │ │ │ +   [{A,B,C} ||
│ │ │ │ +       A <- lists:seq(1,N-2),
│ │ │ │ +       B <- lists:seq(A+1,N-1),
│ │ │ │ +       C <- lists:seq(B+1,N),
│ │ │ │         A+B+C =< N,
│ │ │ │ -       A*A+B*B == C*C ].

│ │ │ │ + A*A+B*B == C*C ].

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Simplifications With List Comprehensions │ │ │ │

│ │ │ │

As an example, list comprehensions can be used to simplify some of the functions │ │ │ │ -in lists.erl:

append(L)   ->  [X || L1 <- L, X <- L1].
│ │ │ │ -map(Fun, L) -> [Fun(X) || X <- L].
│ │ │ │ -filter(Pred, L) -> [X || X <- L, Pred(X)].

│ │ │ │ +in lists.erl:

append(L)   ->  [X || L1 <- L, X <- L1].
│ │ │ │ +map(Fun, L) -> [Fun(X) || X <- L].
│ │ │ │ +filter(Pred, L) -> [X || X <- L, Pred(X)].

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Variable Bindings in List Comprehensions │ │ │ │

│ │ │ │

The scope rules for variables that occur in list comprehensions are as follows:

  • All variables that occur in a generator pattern are assumed to be "fresh" │ │ │ │ variables.
  • Any variables that are defined before the list comprehension, and that are │ │ │ │ used in filters, have the values they had before the list comprehension.
  • Variables cannot be exported from a list comprehension.

As an example of these rules, suppose you want to write the function select, │ │ │ │ which selects certain elements from a list of tuples. Suppose you write │ │ │ │ select(X, L) -> [Y || {X, Y} <- L]. with the intention of extracting all │ │ │ │ tuples from L, where the first item is X.

Compiling this gives the following diagnostic:

./FileName.erl:Line: Warning: variable 'X' shadowed in generate

This diagnostic warns that the variable X in the pattern is not the same as │ │ │ │ -the variable X that occurs in the function head.

Evaluating select gives the following result:

> select(b,[{a,1},{b,2},{c,3},{b,7}]).
│ │ │ │ -[1,2,3,7]

This is not the wanted result. To achieve the desired effect, select must be │ │ │ │ -written as follows:

select(X, L) ->  [Y || {X1, Y} <- L, X == X1].

The generator now contains unbound variables and the test has been moved into │ │ │ │ -the filter.

This now works as expected:

> select(b,[{a,1},{b,2},{c,3},{b,7}]).
│ │ │ │ -[2,7]

Also note that a variable in a generator pattern will shadow a variable with the │ │ │ │ -same name bound in a previous generator pattern. For example:

> [{X,Y} || X <- [1,2,3], X=Y <- [a,b,c]].
│ │ │ │ -[{a,a},{b,b},{c,c},{a,a},{b,b},{c,c},{a,a},{b,b},{c,c}]

A consequence of the rules for importing variables into a list comprehensions is │ │ │ │ +the variable X that occurs in the function head.

Evaluating select gives the following result:

> select(b,[{a,1},{b,2},{c,3},{b,7}]).
│ │ │ │ +[1,2,3,7]

This is not the wanted result. To achieve the desired effect, select must be │ │ │ │ +written as follows:

select(X, L) ->  [Y || {X1, Y} <- L, X == X1].

The generator now contains unbound variables and the test has been moved into │ │ │ │ +the filter.

This now works as expected:

> select(b,[{a,1},{b,2},{c,3},{b,7}]).
│ │ │ │ +[2,7]

Also note that a variable in a generator pattern will shadow a variable with the │ │ │ │ +same name bound in a previous generator pattern. For example:

> [{X,Y} || X <- [1,2,3], X=Y <- [a,b,c]].
│ │ │ │ +[{a,a},{b,b},{c,c},{a,a},{b,b},{c,c},{a,a},{b,b},{c,c}]

A consequence of the rules for importing variables into a list comprehensions is │ │ │ │ that certain pattern matching operations must be moved into the filters and │ │ │ │ -cannot be written directly in the generators.

To illustrate this, do not write as follows:

f(...) ->
│ │ │ │ +cannot be written directly in the generators.

To illustrate this, do not write as follows:

f(...) ->
│ │ │ │      Y = ...
│ │ │ │ -    [ Expression || PatternInvolving Y  <- Expr, ...]
│ │ │ │ -    ...

Instead, write as follows:

f(...) ->
│ │ │ │ +    [ Expression || PatternInvolving Y  <- Expr, ...]
│ │ │ │ +    ...

Instead, write as follows:

f(...) ->
│ │ │ │      Y = ...
│ │ │ │ -    [ Expression || PatternInvolving Y1  <- Expr, Y == Y1, ...]
│ │ │ │ +    [ Expression || PatternInvolving Y1  <- Expr, Y == Y1, ...]
│ │ │ │      ...
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/install-win32.xhtml │ │ │ │ @@ -200,15 +200,15 @@ │ │ │ │
$ cd erts/emulator │ │ │ │ $ make debug │ │ │ │ $ cd ../etc │ │ │ │ $ make debug │ │ │ │

and sometimes

$ cd $ERL_TOP
│ │ │ │  $ make local_setup
│ │ │ │  

So now when you run $ERL_TOP/erl.exe, you should have a debug compiled │ │ │ │ -emulator, which you will see if you do a:

1> erlang:system_info(system_version).

in the erlang shell. If the returned string contains [debug], you │ │ │ │ +emulator, which you will see if you do a:

1> erlang:system_info(system_version).

in the erlang shell. If the returned string contains [debug], you │ │ │ │ got a debug compiled emulator.

To hack the erlang libraries, you simply do a make opt in the │ │ │ │ specific "applications" directory, like:

$ cd $ERL_TOP/lib/stdlib
│ │ │ │  $ make opt
│ │ │ │  

or even in the source directory...

$ cd $ERL_TOP/lib/stdlib/src
│ │ │ │  $ make opt
│ │ │ │  

Note that you're expected to have a fresh Erlang in your path when │ │ │ │ doing this, preferably the plain 27 you have built in the previous │ │ │ │ @@ -223,19 +223,19 @@ │ │ │ │ :$ERL_TOP/erts/etc/win32/wsl_tools:$ERL_TOP/bootstrap/bin:$PATH │ │ │ │

That should make it possible to rebuild any library without hassle...

If you want to copy a library (an application) newly built, to a │ │ │ │ release area, you do like with the emulator:

$ cd $ERL_TOP/lib/stdlib
│ │ │ │  $ make TESTROOT=/tmp/erlang_release release
│ │ │ │  

Remember that:

  • Windows specific C-code goes in the $ERL_TOP/erts/emulator/sys/win32, │ │ │ │ $ERL_TOP/erts/emulator/drivers/win32 or $ERL_TOP/erts/etc/win32.

  • Windows specific erlang code should be used conditionally and the │ │ │ │ host OS tested in runtime, the exactly same beam files should be │ │ │ │ -distributed for every platform! So write code like:

    case os:type() of
    │ │ │ │ -    {win32,_} ->
    │ │ │ │ -        do_windows_specific();
    │ │ │ │ +distributed for every platform! So write code like:

    case os:type() of
    │ │ │ │ +    {win32,_} ->
    │ │ │ │ +        do_windows_specific();
    │ │ │ │      Other ->
    │ │ │ │ -        do_fallback_or_exit()
    │ │ │ │ +        do_fallback_or_exit()
    │ │ │ │  end,

That's basically all you need to get going.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Frequently Asked Questions │ │ │ │

│ │ │ │
  • Q: So, now I can build Erlang using GCC on Windows?

    A: No, unfortunately not. You'll need Microsoft's Visual C++ │ │ │ ├── OEBPS/included_applications.xhtml │ │ │ │ @@ -66,72 +66,72 @@ │ │ │ │ belonging to the primary application.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Specifying Included Applications │ │ │ │

    │ │ │ │

    Which applications to include is defined by the included_applications key in │ │ │ │ -the .app file:

    {application, prim_app,
    │ │ │ │ - [{description, "Tree application"},
    │ │ │ │ -  {vsn, "1"},
    │ │ │ │ -  {modules, [prim_app_cb, prim_app_sup, prim_app_server]},
    │ │ │ │ -  {registered, [prim_app_server]},
    │ │ │ │ -  {included_applications, [incl_app]},
    │ │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ │ -  {mod, {prim_app_cb,[]}},
    │ │ │ │ -  {env, [{file, "/usr/local/log"}]}
    │ │ │ │ - ]}.

    │ │ │ │ +the .app file:

    {application, prim_app,
    │ │ │ │ + [{description, "Tree application"},
    │ │ │ │ +  {vsn, "1"},
    │ │ │ │ +  {modules, [prim_app_cb, prim_app_sup, prim_app_server]},
    │ │ │ │ +  {registered, [prim_app_server]},
    │ │ │ │ +  {included_applications, [incl_app]},
    │ │ │ │ +  {applications, [kernel, stdlib, sasl]},
    │ │ │ │ +  {mod, {prim_app_cb,[]}},
    │ │ │ │ +  {env, [{file, "/usr/local/log"}]}
    │ │ │ │ + ]}.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Synchronizing Processes during Startup │ │ │ │

    │ │ │ │

    The supervisor tree of an included application is started as part of the │ │ │ │ supervisor tree of the including application. If there is a need for │ │ │ │ synchronization between processes in the including and included applications, │ │ │ │ this can be achieved by using start phases.

    Start phases are defined by the start_phases key in the .app file as a list │ │ │ │ of tuples {Phase,PhaseArgs}, where Phase is an atom and PhaseArgs is a │ │ │ │ term.

    The value of the mod key of the including application must be set to │ │ │ │ {application_starter,[Module,StartArgs]}, where Module as usual is the │ │ │ │ application callback module. StartArgs is a term provided as argument to the │ │ │ │ -callback function Module:start/2:

    {application, prim_app,
    │ │ │ │ - [{description, "Tree application"},
    │ │ │ │ -  {vsn, "1"},
    │ │ │ │ -  {modules, [prim_app_cb, prim_app_sup, prim_app_server]},
    │ │ │ │ -  {registered, [prim_app_server]},
    │ │ │ │ -  {included_applications, [incl_app]},
    │ │ │ │ -  {start_phases, [{init,[]}, {go,[]}]},
    │ │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ │ -  {mod, {application_starter,[prim_app_cb,[]]}},
    │ │ │ │ -  {env, [{file, "/usr/local/log"}]}
    │ │ │ │ - ]}.
    │ │ │ │ +callback function Module:start/2:

    {application, prim_app,
    │ │ │ │ + [{description, "Tree application"},
    │ │ │ │ +  {vsn, "1"},
    │ │ │ │ +  {modules, [prim_app_cb, prim_app_sup, prim_app_server]},
    │ │ │ │ +  {registered, [prim_app_server]},
    │ │ │ │ +  {included_applications, [incl_app]},
    │ │ │ │ +  {start_phases, [{init,[]}, {go,[]}]},
    │ │ │ │ +  {applications, [kernel, stdlib, sasl]},
    │ │ │ │ +  {mod, {application_starter,[prim_app_cb,[]]}},
    │ │ │ │ +  {env, [{file, "/usr/local/log"}]}
    │ │ │ │ + ]}.
    │ │ │ │  
    │ │ │ │ -{application, incl_app,
    │ │ │ │ - [{description, "Included application"},
    │ │ │ │ -  {vsn, "1"},
    │ │ │ │ -  {modules, [incl_app_cb, incl_app_sup, incl_app_server]},
    │ │ │ │ -  {registered, []},
    │ │ │ │ -  {start_phases, [{go,[]}]},
    │ │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ │ -  {mod, {incl_app_cb,[]}}
    │ │ │ │ - ]}.

    When starting a primary application with included applications, the primary │ │ │ │ +{application, incl_app, │ │ │ │ + [{description, "Included application"}, │ │ │ │ + {vsn, "1"}, │ │ │ │ + {modules, [incl_app_cb, incl_app_sup, incl_app_server]}, │ │ │ │ + {registered, []}, │ │ │ │ + {start_phases, [{go,[]}]}, │ │ │ │ + {applications, [kernel, stdlib, sasl]}, │ │ │ │ + {mod, {incl_app_cb,[]}} │ │ │ │ + ]}.

    When starting a primary application with included applications, the primary │ │ │ │ application is started the normal way, that is:

    • The application controller creates an application master for the application
    • The application master calls Module:start(normal, StartArgs) to start the │ │ │ │ top supervisor.

    Then, for the primary application and each included application in top-down, │ │ │ │ left-to-right order, the application master calls │ │ │ │ Module:start_phase(Phase, Type, PhaseArgs) for each phase defined for the │ │ │ │ primary application, in that order. If a phase is not defined for an included │ │ │ │ application, the function is not called for this phase and application.

    The following requirements apply to the .app file for an included application:

    • The {mod, {Module,StartArgs}} option must be included. This option is used │ │ │ │ to find the callback module Module of the application. StartArgs is │ │ │ │ ignored, as Module:start/2 is called only for the primary application.
    • If the included application itself contains included applications, instead the │ │ │ │ {mod, {application_starter, [Module,StartArgs]}} option must be included.
    • The {start_phases, [{Phase,PhaseArgs}]} option must be included, and the set │ │ │ │ of specified phases must be a subset of the set of phases specified for the │ │ │ │ primary application.

    When starting prim_app as defined above, the application controller calls the │ │ │ │ following callback functions before application:start(prim_app) returns a │ │ │ │ -value:

    application:start(prim_app)
    │ │ │ │ - => prim_app_cb:start(normal, [])
    │ │ │ │ - => prim_app_cb:start_phase(init, normal, [])
    │ │ │ │ - => prim_app_cb:start_phase(go, normal, [])
    │ │ │ │ - => incl_app_cb:start_phase(go, normal, [])
    │ │ │ │ +value:

    application:start(prim_app)
    │ │ │ │ + => prim_app_cb:start(normal, [])
    │ │ │ │ + => prim_app_cb:start_phase(init, normal, [])
    │ │ │ │ + => prim_app_cb:start_phase(go, normal, [])
    │ │ │ │ + => incl_app_cb:start_phase(go, normal, [])
    │ │ │ │  ok
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/gen_server_concepts.xhtml │ │ │ │ @@ -62,63 +62,63 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Example │ │ │ │ │ │ │ │

    An example of a simple server written in plain Erlang is provided in │ │ │ │ Overview. The server can be reimplemented using │ │ │ │ -gen_server, resulting in this callback module:

    -module(ch3).
    │ │ │ │ --behaviour(gen_server).
    │ │ │ │ +gen_server, resulting in this callback module:

    -module(ch3).
    │ │ │ │ +-behaviour(gen_server).
    │ │ │ │  
    │ │ │ │ --export([start_link/0]).
    │ │ │ │ --export([alloc/0, free/1]).
    │ │ │ │ --export([init/1, handle_call/3, handle_cast/2]).
    │ │ │ │ +-export([start_link/0]).
    │ │ │ │ +-export([alloc/0, free/1]).
    │ │ │ │ +-export([init/1, handle_call/3, handle_cast/2]).
    │ │ │ │  
    │ │ │ │ -start_link() ->
    │ │ │ │ -    gen_server:start_link({local, ch3}, ch3, [], []).
    │ │ │ │ +start_link() ->
    │ │ │ │ +    gen_server:start_link({local, ch3}, ch3, [], []).
    │ │ │ │  
    │ │ │ │ -alloc() ->
    │ │ │ │ -    gen_server:call(ch3, alloc).
    │ │ │ │ +alloc() ->
    │ │ │ │ +    gen_server:call(ch3, alloc).
    │ │ │ │  
    │ │ │ │ -free(Ch) ->
    │ │ │ │ -    gen_server:cast(ch3, {free, Ch}).
    │ │ │ │ +free(Ch) ->
    │ │ │ │ +    gen_server:cast(ch3, {free, Ch}).
    │ │ │ │  
    │ │ │ │ -init(_Args) ->
    │ │ │ │ -    {ok, channels()}.
    │ │ │ │ +init(_Args) ->
    │ │ │ │ +    {ok, channels()}.
    │ │ │ │  
    │ │ │ │ -handle_call(alloc, _From, Chs) ->
    │ │ │ │ -    {Ch, Chs2} = alloc(Chs),
    │ │ │ │ -    {reply, Ch, Chs2}.
    │ │ │ │ +handle_call(alloc, _From, Chs) ->
    │ │ │ │ +    {Ch, Chs2} = alloc(Chs),
    │ │ │ │ +    {reply, Ch, Chs2}.
    │ │ │ │  
    │ │ │ │ -handle_cast({free, Ch}, Chs) ->
    │ │ │ │ -    Chs2 = free(Ch, Chs),
    │ │ │ │ -    {noreply, Chs2}.

    The code is explained in the next sections.

    │ │ │ │ +handle_cast({free, Ch}, Chs) -> │ │ │ │ + Chs2 = free(Ch, Chs), │ │ │ │ + {noreply, Chs2}.

    The code is explained in the next sections.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Starting a Gen_Server │ │ │ │

    │ │ │ │

    In the example in the previous section, gen_server is started by calling │ │ │ │ -ch3:start_link():

    start_link() ->
    │ │ │ │ -    gen_server:start_link({local, ch3}, ch3, [], []) => {ok, Pid}

    start_link/0 calls function gen_server:start_link/4. This function │ │ │ │ +ch3:start_link():

    start_link() ->
    │ │ │ │ +    gen_server:start_link({local, ch3}, ch3, [], []) => {ok, Pid}

    start_link/0 calls function gen_server:start_link/4. This function │ │ │ │ spawns and links to a new process, a gen_server.

    • The first argument, {local, ch3}, specifies the name. │ │ │ │ The gen_server is then locally registered as ch3.

      If the name is omitted, the gen_server is not registered. Instead its pid │ │ │ │ must be used. The name can also be given as {global, Name}, in which case │ │ │ │ the gen_server is registered using global:register_name/2.

    • The second argument, ch3, is the name of the callback module, which is │ │ │ │ the module where the callback functions are located.

      The interface functions (start_link/0, alloc/0, and free/1) are located │ │ │ │ in the same module as the callback functions (init/1, handle_call/3, and │ │ │ │ handle_cast/2). It is usually good programming practice to have the code │ │ │ │ corresponding to one process contained in a single module.

    • The third argument, [], is a term that is passed as is to the callback │ │ │ │ function init. Here, init does not need any indata and ignores the │ │ │ │ argument.

    • The fourth argument, [], is a list of options. See gen_server │ │ │ │ for the available options.

    If name registration succeeds, the new gen_server process calls the callback │ │ │ │ function ch3:init([]). init is expected to return {ok, State}, where │ │ │ │ State is the internal state of the gen_server. In this case, the state is │ │ │ │ -the available channels.

    init(_Args) ->
    │ │ │ │ -    {ok, channels()}.

    gen_server:start_link/4 is synchronous. It does not return until the │ │ │ │ +the available channels.

    init(_Args) ->
    │ │ │ │ +    {ok, channels()}.

    gen_server:start_link/4 is synchronous. It does not return until the │ │ │ │ gen_server has been initialized and is ready to receive requests.

    gen_server:start_link/4 must be used if the gen_server is part of │ │ │ │ a supervision tree, meaning that it was started by a supervisor. There │ │ │ │ is another function, gen_server:start/4, to start a standalone │ │ │ │ gen_server that is not part of a supervision tree.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -126,32 +126,32 @@ │ │ │ │

    │ │ │ │

    The synchronous request alloc() is implemented using gen_server:call/2:

    alloc() ->
    │ │ │ │      gen_server:call(ch3, alloc).

    ch3 is the name of the gen_server and must agree with the name │ │ │ │ used to start it. alloc is the actual request.

    The request is made into a message and sent to the gen_server. │ │ │ │ When the request is received, the gen_server calls │ │ │ │ handle_call(Request, From, State), which is expected to return │ │ │ │ a tuple {reply,Reply,State1}. Reply is the reply that is to be sent back │ │ │ │ -to the client, and State1 is a new value for the state of the gen_server.

    handle_call(alloc, _From, Chs) ->
    │ │ │ │ -    {Ch, Chs2} = alloc(Chs),
    │ │ │ │ -    {reply, Ch, Chs2}.

    In this case, the reply is the allocated channel Ch and the new state is the │ │ │ │ +to the client, and State1 is a new value for the state of the gen_server.

    handle_call(alloc, _From, Chs) ->
    │ │ │ │ +    {Ch, Chs2} = alloc(Chs),
    │ │ │ │ +    {reply, Ch, Chs2}.

    In this case, the reply is the allocated channel Ch and the new state is the │ │ │ │ set of remaining available channels Chs2.

    Thus, the call ch3:alloc() returns the allocated channel Ch and the │ │ │ │ gen_server then waits for new requests, now with an updated list of │ │ │ │ available channels.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Asynchronous Requests - Cast │ │ │ │

    │ │ │ │ -

    The asynchronous request free(Ch) is implemented using gen_server:cast/2:

    free(Ch) ->
    │ │ │ │ -    gen_server:cast(ch3, {free, Ch}).

    ch3 is the name of the gen_server. {free, Ch} is the actual request.

    The request is made into a message and sent to the gen_server. │ │ │ │ +

    The asynchronous request free(Ch) is implemented using gen_server:cast/2:

    free(Ch) ->
    │ │ │ │ +    gen_server:cast(ch3, {free, Ch}).

    ch3 is the name of the gen_server. {free, Ch} is the actual request.

    The request is made into a message and sent to the gen_server. │ │ │ │ cast, and thus free, then returns ok.

    When the request is received, the gen_server calls │ │ │ │ handle_cast(Request, State), which is expected to return a tuple │ │ │ │ -{noreply,State1}. State1 is a new value for the state of the gen_server.

    handle_cast({free, Ch}, Chs) ->
    │ │ │ │ -    Chs2 = free(Ch, Chs),
    │ │ │ │ -    {noreply, Chs2}.

    In this case, the new state is the updated list of available channels Chs2. │ │ │ │ +{noreply,State1}. State1 is a new value for the state of the gen_server.

    handle_cast({free, Ch}, Chs) ->
    │ │ │ │ +    Chs2 = free(Ch, Chs),
    │ │ │ │ +    {noreply, Chs2}.

    In this case, the new state is the updated list of available channels Chs2. │ │ │ │ The gen_server is now ready for new requests.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Stopping │ │ │ │

    │ │ │ │

    │ │ │ │ @@ -162,65 +162,65 @@ │ │ │ │

    │ │ │ │

    If the gen_server is part of a supervision tree, no stop function is needed. │ │ │ │ The gen_server is automatically terminated by its supervisor. Exactly how │ │ │ │ this is done is defined by a shutdown strategy │ │ │ │ set in the supervisor.

    If it is necessary to clean up before termination, the shutdown strategy │ │ │ │ must be a time-out value and the gen_server must be set to trap exit signals │ │ │ │ in function init. When ordered to shutdown, the gen_server then calls │ │ │ │ -the callback function terminate(shutdown, State):

    init(Args) ->
    │ │ │ │ +the callback function terminate(shutdown, State):

    init(Args) ->
    │ │ │ │      ...,
    │ │ │ │ -    process_flag(trap_exit, true),
    │ │ │ │ +    process_flag(trap_exit, true),
    │ │ │ │      ...,
    │ │ │ │ -    {ok, State}.
    │ │ │ │ +    {ok, State}.
    │ │ │ │  
    │ │ │ │  ...
    │ │ │ │  
    │ │ │ │ -terminate(shutdown, State) ->
    │ │ │ │ +terminate(shutdown, State) ->
    │ │ │ │      %% Code for cleaning up here
    │ │ │ │      ...
    │ │ │ │      ok.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Standalone Gen_Servers │ │ │ │

    │ │ │ │

    If the gen_server is not part of a supervision tree, a stop function │ │ │ │ can be useful, for example:

    ...
    │ │ │ │ -export([stop/0]).
    │ │ │ │ +export([stop/0]).
    │ │ │ │  ...
    │ │ │ │  
    │ │ │ │ -stop() ->
    │ │ │ │ -    gen_server:cast(ch3, stop).
    │ │ │ │ +stop() ->
    │ │ │ │ +    gen_server:cast(ch3, stop).
    │ │ │ │  ...
    │ │ │ │  
    │ │ │ │ -handle_cast(stop, State) ->
    │ │ │ │ -    {stop, normal, State};
    │ │ │ │ -handle_cast({free, Ch}, State) ->
    │ │ │ │ +handle_cast(stop, State) ->
    │ │ │ │ +    {stop, normal, State};
    │ │ │ │ +handle_cast({free, Ch}, State) ->
    │ │ │ │      ...
    │ │ │ │  
    │ │ │ │  ...
    │ │ │ │  
    │ │ │ │ -terminate(normal, State) ->
    │ │ │ │ +terminate(normal, State) ->
    │ │ │ │      ok.

    The callback function handling the stop request returns a tuple │ │ │ │ {stop,normal,State1}, where normal specifies that it is │ │ │ │ a normal termination and State1 is a new value for the state │ │ │ │ of the gen_server. This causes the gen_server to call │ │ │ │ terminate(normal, State1) and then it terminates gracefully.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Handling Other Messages │ │ │ │

    │ │ │ │

    If the gen_server is to be able to receive other messages than requests, │ │ │ │ the callback function handle_info(Info, State) must be implemented │ │ │ │ to handle them. Examples of other messages are exit messages, │ │ │ │ if the gen_server is linked to other processes than the supervisor │ │ │ │ -and it is trapping exit signals.

    handle_info({'EXIT', Pid, Reason}, State) ->
    │ │ │ │ +and it is trapping exit signals.

    handle_info({'EXIT', Pid, Reason}, State) ->
    │ │ │ │      %% Code to handle exits here.
    │ │ │ │      ...
    │ │ │ │ -    {noreply, State1}.

    The final function to implement is code_change/3:

    code_change(OldVsn, State, Extra) ->
    │ │ │ │ +    {noreply, State1}.

    The final function to implement is code_change/3:

    code_change(OldVsn, State, Extra) ->
    │ │ │ │      %% Code to convert state (and more) during code change.
    │ │ │ │      ...
    │ │ │ │ -    {ok, NewState}.
    │ │ │ │ +
    {ok, NewState}.
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/funs.xhtml │ │ │ │ @@ -22,399 +22,399 @@ │ │ │ │ │ │ │ │

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ map │ │ │ │

    │ │ │ │ -

    The following function, double, doubles every element in a list:

    double([H|T]) -> [2*H|double(T)];
    │ │ │ │ -double([])    -> [].

    Hence, the argument entered as input is doubled as follows:

    > double([1,2,3,4]).
    │ │ │ │ -[2,4,6,8]

    The following function, add_one, adds one to every element in a list:

    add_one([H|T]) -> [H+1|add_one(T)];
    │ │ │ │ -add_one([])    -> [].

    The functions double and add_one have a similar structure. This can be used │ │ │ │ -by writing a function map that expresses this similarity:

    map(F, [H|T]) -> [F(H)|map(F, T)];
    │ │ │ │ -map(F, [])    -> [].

    The functions double and add_one can now be expressed in terms of map as │ │ │ │ -follows:

    double(L)  -> map(fun(X) -> 2*X end, L).
    │ │ │ │ -add_one(L) -> map(fun(X) -> 1 + X end, L).

    map(F, List) is a function that takes a function F and a list L as │ │ │ │ +

    The following function, double, doubles every element in a list:

    double([H|T]) -> [2*H|double(T)];
    │ │ │ │ +double([])    -> [].

    Hence, the argument entered as input is doubled as follows:

    > double([1,2,3,4]).
    │ │ │ │ +[2,4,6,8]

    The following function, add_one, adds one to every element in a list:

    add_one([H|T]) -> [H+1|add_one(T)];
    │ │ │ │ +add_one([])    -> [].

    The functions double and add_one have a similar structure. This can be used │ │ │ │ +by writing a function map that expresses this similarity:

    map(F, [H|T]) -> [F(H)|map(F, T)];
    │ │ │ │ +map(F, [])    -> [].

    The functions double and add_one can now be expressed in terms of map as │ │ │ │ +follows:

    double(L)  -> map(fun(X) -> 2*X end, L).
    │ │ │ │ +add_one(L) -> map(fun(X) -> 1 + X end, L).

    map(F, List) is a function that takes a function F and a list L as │ │ │ │ arguments and returns a new list, obtained by applying F to each of the │ │ │ │ elements in L.

    The process of abstracting out the common features of a number of different │ │ │ │ programs is called procedural abstraction. Procedural abstraction can be used │ │ │ │ to write several different functions that have a similar structure, but differ │ │ │ │ in some minor detail. This is done as follows:

    1. Step 1. Write one function that represents the common features of these │ │ │ │ functions.
    2. Step 2. Parameterize the difference in terms of functions that are passed │ │ │ │ as arguments to the common function.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ foreach │ │ │ │

    │ │ │ │

    This section illustrates procedural abstraction. Initially, the following two │ │ │ │ -examples are written as conventional functions.

    This function prints all elements of a list onto a stream:

    print_list(Stream, [H|T]) ->
    │ │ │ │ -    io:format(Stream, "~p~n", [H]),
    │ │ │ │ -    print_list(Stream, T);
    │ │ │ │ -print_list(Stream, []) ->
    │ │ │ │ -    true.

    This function broadcasts a message to a list of processes:

    broadcast(Msg, [Pid|Pids]) ->
    │ │ │ │ +examples are written as conventional functions.

    This function prints all elements of a list onto a stream:

    print_list(Stream, [H|T]) ->
    │ │ │ │ +    io:format(Stream, "~p~n", [H]),
    │ │ │ │ +    print_list(Stream, T);
    │ │ │ │ +print_list(Stream, []) ->
    │ │ │ │ +    true.

    This function broadcasts a message to a list of processes:

    broadcast(Msg, [Pid|Pids]) ->
    │ │ │ │      Pid ! Msg,
    │ │ │ │ -    broadcast(Msg, Pids);
    │ │ │ │ -broadcast(_, []) ->
    │ │ │ │ +    broadcast(Msg, Pids);
    │ │ │ │ +broadcast(_, []) ->
    │ │ │ │      true.

    These two functions have a similar structure. They both iterate over a list and │ │ │ │ do something to each element in the list. The "something" is passed on as an │ │ │ │ -extra argument to the function that does this.

    The function foreach expresses this similarity:

    foreach(F, [H|T]) ->
    │ │ │ │ -    F(H),
    │ │ │ │ -    foreach(F, T);
    │ │ │ │ -foreach(F, []) ->
    │ │ │ │ -    ok.

    Using the function foreach, the function print_list becomes:

    foreach(fun(H) -> io:format(S, "~p~n",[H]) end, L)

    Using the function foreach, the function broadcast becomes:

    foreach(fun(Pid) -> Pid ! M end, L)

    foreach is evaluated for its side-effect and not its value. foreach(Fun ,L) │ │ │ │ +extra argument to the function that does this.

    The function foreach expresses this similarity:

    foreach(F, [H|T]) ->
    │ │ │ │ +    F(H),
    │ │ │ │ +    foreach(F, T);
    │ │ │ │ +foreach(F, []) ->
    │ │ │ │ +    ok.

    Using the function foreach, the function print_list becomes:

    foreach(fun(H) -> io:format(S, "~p~n",[H]) end, L)

    Using the function foreach, the function broadcast becomes:

    foreach(fun(Pid) -> Pid ! M end, L)

    foreach is evaluated for its side-effect and not its value. foreach(Fun ,L) │ │ │ │ calls Fun(X) for each element X in L and the processing occurs in the │ │ │ │ order that the elements were defined in L. map does not define the order in │ │ │ │ which its elements are processed.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Syntax of Funs │ │ │ │

    │ │ │ │

    Funs are written with the following syntax (see │ │ │ │ -Fun Expressions for full description):

    F = fun (Arg1, Arg2, ... ArgN) ->
    │ │ │ │ +Fun Expressions for full description):

    F = fun (Arg1, Arg2, ... ArgN) ->
    │ │ │ │          ...
    │ │ │ │      end

    This creates an anonymous function of N arguments and binds it to the variable │ │ │ │ F.

    Another function, FunctionName, written in the same module, can be passed as │ │ │ │ an argument, using the following syntax:

    F = fun FunctionName/Arity

    With this form of function reference, the function that is referred to does not │ │ │ │ need to be exported from the module.

    It is also possible to refer to a function defined in a different module, with │ │ │ │ -the following syntax:

    F = fun Module:FunctionName/Arity

    In this case, the function must be exported from the module in question.

    The following program illustrates the different ways of creating funs:

    -module(fun_test).
    │ │ │ │ --export([t1/0, t2/0]).
    │ │ │ │ --import(lists, [map/2]).
    │ │ │ │ +the following syntax:

    F = fun Module:FunctionName/Arity

    In this case, the function must be exported from the module in question.

    The following program illustrates the different ways of creating funs:

    -module(fun_test).
    │ │ │ │ +-export([t1/0, t2/0]).
    │ │ │ │ +-import(lists, [map/2]).
    │ │ │ │  
    │ │ │ │ -t1() -> map(fun(X) -> 2 * X end, [1,2,3,4,5]).
    │ │ │ │ +t1() -> map(fun(X) -> 2 * X end, [1,2,3,4,5]).
    │ │ │ │  
    │ │ │ │ -t2() -> map(fun double/1, [1,2,3,4,5]).
    │ │ │ │ +t2() -> map(fun double/1, [1,2,3,4,5]).
    │ │ │ │  
    │ │ │ │ -double(X) -> X * 2.

    The fun F can be evaluated with the following syntax:

    F(Arg1, Arg2, ..., Argn)

    To check whether a term is a fun, use the test │ │ │ │ -is_function/1 in a guard.

    Example:

    f(F, Args) when is_function(F) ->
    │ │ │ │ -   apply(F, Args);
    │ │ │ │ -f(N, _) when is_integer(N) ->
    │ │ │ │ +double(X) -> X * 2.

    The fun F can be evaluated with the following syntax:

    F(Arg1, Arg2, ..., Argn)

    To check whether a term is a fun, use the test │ │ │ │ +is_function/1 in a guard.

    Example:

    f(F, Args) when is_function(F) ->
    │ │ │ │ +   apply(F, Args);
    │ │ │ │ +f(N, _) when is_integer(N) ->
    │ │ │ │     N.

    Funs are a distinct type. The BIFs erlang:fun_info/1,2 can be used to retrieve │ │ │ │ information about a fun, and the BIF erlang:fun_to_list/1 returns a textual │ │ │ │ representation of a fun. The check_process_code/2 │ │ │ │ BIF returns true if the process contains funs that depend on the old version │ │ │ │ of a module.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Variable Bindings Within a Fun │ │ │ │

    │ │ │ │

    The scope rules for variables that occur in funs are as follows:

    • All variables that occur in the head of a fun are assumed to be "fresh" │ │ │ │ variables.
    • Variables that are defined before the fun, and that occur in function calls or │ │ │ │ -guard tests within the fun, have the values they had outside the fun.
    • Variables cannot be exported from a fun.

    The following examples illustrate these rules:

    print_list(File, List) ->
    │ │ │ │ -    {ok, Stream} = file:open(File, write),
    │ │ │ │ -    foreach(fun(X) -> io:format(Stream,"~p~n",[X]) end, List),
    │ │ │ │ -    file:close(Stream).

    Here, the variable X, defined in the head of the fun, is a new variable. The │ │ │ │ +guard tests within the fun, have the values they had outside the fun.

  • Variables cannot be exported from a fun.

The following examples illustrate these rules:

print_list(File, List) ->
│ │ │ │ +    {ok, Stream} = file:open(File, write),
│ │ │ │ +    foreach(fun(X) -> io:format(Stream,"~p~n",[X]) end, List),
│ │ │ │ +    file:close(Stream).

Here, the variable X, defined in the head of the fun, is a new variable. The │ │ │ │ variable Stream, which is used within the fun, gets its value from the │ │ │ │ file:open line.

As any variable that occurs in the head of a fun is considered a new variable, │ │ │ │ -it is equally valid to write as follows:

print_list(File, List) ->
│ │ │ │ -    {ok, Stream} = file:open(File, write),
│ │ │ │ -    foreach(fun(File) ->
│ │ │ │ -                io:format(Stream,"~p~n",[File])
│ │ │ │ -            end, List),
│ │ │ │ -    file:close(Stream).

Here, File is used as the new variable instead of X. This is not so wise │ │ │ │ +it is equally valid to write as follows:

print_list(File, List) ->
│ │ │ │ +    {ok, Stream} = file:open(File, write),
│ │ │ │ +    foreach(fun(File) ->
│ │ │ │ +                io:format(Stream,"~p~n",[File])
│ │ │ │ +            end, List),
│ │ │ │ +    file:close(Stream).

Here, File is used as the new variable instead of X. This is not so wise │ │ │ │ because code in the fun body cannot refer to the variable File, which is │ │ │ │ defined outside of the fun. Compiling this example gives the following │ │ │ │ diagnostic:

./FileName.erl:Line: Warning: variable 'File'
│ │ │ │        shadowed in 'fun'

This indicates that the variable File, which is defined inside the fun, │ │ │ │ collides with the variable File, which is defined outside the fun.

The rules for importing variables into a fun has the consequence that certain │ │ │ │ pattern matching operations must be moved into guard expressions and cannot be │ │ │ │ written in the head of the fun. For example, you might write the following code │ │ │ │ if you intend the first clause of F to be evaluated when the value of its │ │ │ │ -argument is Y:

f(...) ->
│ │ │ │ +argument is Y:

f(...) ->
│ │ │ │      Y = ...
│ │ │ │ -    map(fun(X) when X == Y ->
│ │ │ │ +    map(fun(X) when X == Y ->
│ │ │ │               ;
│ │ │ │ -           (_) ->
│ │ │ │ +           (_) ->
│ │ │ │               ...
│ │ │ │ -        end, ...)
│ │ │ │ -    ...

instead of writing the following code:

f(...) ->
│ │ │ │ +        end, ...)
│ │ │ │ +    ...

instead of writing the following code:

f(...) ->
│ │ │ │      Y = ...
│ │ │ │ -    map(fun(Y) ->
│ │ │ │ +    map(fun(Y) ->
│ │ │ │               ;
│ │ │ │ -           (_) ->
│ │ │ │ +           (_) ->
│ │ │ │               ...
│ │ │ │ -        end, ...)
│ │ │ │ +        end, ...)
│ │ │ │      ...

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Funs and Module Lists │ │ │ │

│ │ │ │

The following examples show a dialogue with the Erlang shell. All the higher │ │ │ │ order functions discussed are exported from the module lists.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ map │ │ │ │

│ │ │ │ -

lists:map/2 takes a function of one argument and a list of terms:

map(F, [H|T]) -> [F(H)|map(F, T)];
│ │ │ │ -map(F, [])    -> [].

It returns the list obtained by applying the function to every argument in the │ │ │ │ +

lists:map/2 takes a function of one argument and a list of terms:

map(F, [H|T]) -> [F(H)|map(F, T)];
│ │ │ │ +map(F, [])    -> [].

It returns the list obtained by applying the function to every argument in the │ │ │ │ list.

When a new fun is defined in the shell, the value of the fun is printed as │ │ │ │ -Fun#<erl_eval>:

> Double = fun(X) -> 2 * X end.
│ │ │ │ +Fun#<erl_eval>:

> Double = fun(X) -> 2 * X end.
│ │ │ │  #Fun<erl_eval.6.72228031>
│ │ │ │ -> lists:map(Double, [1,2,3,4,5]).
│ │ │ │ -[2,4,6,8,10]

│ │ │ │ +> lists:map(Double, [1,2,3,4,5]). │ │ │ │ +[2,4,6,8,10]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ any │ │ │ │

│ │ │ │ -

lists:any/2 takes a predicate P of one argument and a list of terms:

any(Pred, [H|T]) ->
│ │ │ │ -    case Pred(H) of
│ │ │ │ +

lists:any/2 takes a predicate P of one argument and a list of terms:

any(Pred, [H|T]) ->
│ │ │ │ +    case Pred(H) of
│ │ │ │          true  ->  true;
│ │ │ │ -        false ->  any(Pred, T)
│ │ │ │ +        false ->  any(Pred, T)
│ │ │ │      end;
│ │ │ │ -any(Pred, []) ->
│ │ │ │ +any(Pred, []) ->
│ │ │ │      false.

A predicate is a function that returns true or false. any is true if │ │ │ │ there is a term X in the list such that P(X) is true.

A predicate Big(X) is defined, which is true if its argument is greater that │ │ │ │ -10:

> Big =  fun(X) -> if X > 10 -> true; true -> false end end.
│ │ │ │ +10:

> Big =  fun(X) -> if X > 10 -> true; true -> false end end.
│ │ │ │  #Fun<erl_eval.6.72228031>
│ │ │ │ -> lists:any(Big, [1,2,3,4]).
│ │ │ │ +> lists:any(Big, [1,2,3,4]).
│ │ │ │  false
│ │ │ │ -> lists:any(Big, [1,2,3,12,5]).
│ │ │ │ +> lists:any(Big, [1,2,3,12,5]).
│ │ │ │  true

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ all │ │ │ │

│ │ │ │ -

lists:all/2 has the same arguments as any:

all(Pred, [H|T]) ->
│ │ │ │ -    case Pred(H) of
│ │ │ │ -        true  ->  all(Pred, T);
│ │ │ │ +

lists:all/2 has the same arguments as any:

all(Pred, [H|T]) ->
│ │ │ │ +    case Pred(H) of
│ │ │ │ +        true  ->  all(Pred, T);
│ │ │ │          false ->  false
│ │ │ │      end;
│ │ │ │ -all(Pred, []) ->
│ │ │ │ -    true.

It is true if the predicate applied to all elements in the list is true.

> lists:all(Big, [1,2,3,4,12,6]).
│ │ │ │ +all(Pred, []) ->
│ │ │ │ +    true.

It is true if the predicate applied to all elements in the list is true.

> lists:all(Big, [1,2,3,4,12,6]).
│ │ │ │  false
│ │ │ │ -> lists:all(Big, [12,13,14,15]).
│ │ │ │ +> lists:all(Big, [12,13,14,15]).
│ │ │ │  true

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ foreach │ │ │ │

│ │ │ │ -

lists:foreach/2 takes a function of one argument and a list of terms:

foreach(F, [H|T]) ->
│ │ │ │ -    F(H),
│ │ │ │ -    foreach(F, T);
│ │ │ │ -foreach(F, []) ->
│ │ │ │ +

lists:foreach/2 takes a function of one argument and a list of terms:

foreach(F, [H|T]) ->
│ │ │ │ +    F(H),
│ │ │ │ +    foreach(F, T);
│ │ │ │ +foreach(F, []) ->
│ │ │ │      ok.

The function is applied to each argument in the list. foreach returns ok. It │ │ │ │ -is only used for its side-effect:

> lists:foreach(fun(X) -> io:format("~w~n",[X]) end, [1,2,3,4]).
│ │ │ │ +is only used for its side-effect:

> lists:foreach(fun(X) -> io:format("~w~n",[X]) end, [1,2,3,4]).
│ │ │ │  1
│ │ │ │  2
│ │ │ │  3
│ │ │ │  4
│ │ │ │  ok

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ foldl │ │ │ │

│ │ │ │ -

lists:foldl/3 takes a function of two arguments, an accumulator and a list:

foldl(F, Accu, [Hd|Tail]) ->
│ │ │ │ -    foldl(F, F(Hd, Accu), Tail);
│ │ │ │ -foldl(F, Accu, []) -> Accu.

The function is called with two arguments. The first argument is the successive │ │ │ │ +

lists:foldl/3 takes a function of two arguments, an accumulator and a list:

foldl(F, Accu, [Hd|Tail]) ->
│ │ │ │ +    foldl(F, F(Hd, Accu), Tail);
│ │ │ │ +foldl(F, Accu, []) -> Accu.

The function is called with two arguments. The first argument is the successive │ │ │ │ elements in the list. The second argument is the accumulator. The function must │ │ │ │ return a new accumulator, which is used the next time the function is called.

If you have a list of lists L = ["I","like","Erlang"], then you can sum the │ │ │ │ -lengths of all the strings in L as follows:

> L = ["I","like","Erlang"].
│ │ │ │ -["I","like","Erlang"]
│ │ │ │ -10> lists:foldl(fun(X, Sum) -> length(X) + Sum end, 0, L).
│ │ │ │ -11

lists:foldl/3 works like a while loop in an imperative language:

L =  ["I","like","Erlang"],
│ │ │ │ +lengths of all the strings in L as follows:

> L = ["I","like","Erlang"].
│ │ │ │ +["I","like","Erlang"]
│ │ │ │ +10> lists:foldl(fun(X, Sum) -> length(X) + Sum end, 0, L).
│ │ │ │ +11

lists:foldl/3 works like a while loop in an imperative language:

L =  ["I","like","Erlang"],
│ │ │ │  Sum = 0,
│ │ │ │ -while( L != []){
│ │ │ │ -    Sum += length(head(L)),
│ │ │ │ -    L = tail(L)
│ │ │ │ +while( L != []){
│ │ │ │ +    Sum += length(head(L)),
│ │ │ │ +    L = tail(L)
│ │ │ │  end

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ mapfoldl │ │ │ │

│ │ │ │ -

lists:mapfoldl/3 simultaneously maps and folds over a list:

mapfoldl(F, Accu0, [Hd|Tail]) ->
│ │ │ │ -    {R,Accu1} = F(Hd, Accu0),
│ │ │ │ -    {Rs,Accu2} = mapfoldl(F, Accu1, Tail),
│ │ │ │ -    {[R|Rs], Accu2};
│ │ │ │ -mapfoldl(F, Accu, []) -> {[], Accu}.

The following example shows how to change all letters in L to upper case and │ │ │ │ -then count them.

First the change to upper case:

> Upcase =  fun(X) when $a =< X,  X =< $z -> X + $A - $a;
│ │ │ │ -(X) -> X
│ │ │ │ +

lists:mapfoldl/3 simultaneously maps and folds over a list:

mapfoldl(F, Accu0, [Hd|Tail]) ->
│ │ │ │ +    {R,Accu1} = F(Hd, Accu0),
│ │ │ │ +    {Rs,Accu2} = mapfoldl(F, Accu1, Tail),
│ │ │ │ +    {[R|Rs], Accu2};
│ │ │ │ +mapfoldl(F, Accu, []) -> {[], Accu}.

The following example shows how to change all letters in L to upper case and │ │ │ │ +then count them.

First the change to upper case:

> Upcase =  fun(X) when $a =< X,  X =< $z -> X + $A - $a;
│ │ │ │ +(X) -> X
│ │ │ │  end.
│ │ │ │  #Fun<erl_eval.6.72228031>
│ │ │ │  > Upcase_word =
│ │ │ │ -fun(X) ->
│ │ │ │ -lists:map(Upcase, X)
│ │ │ │ +fun(X) ->
│ │ │ │ +lists:map(Upcase, X)
│ │ │ │  end.
│ │ │ │  #Fun<erl_eval.6.72228031>
│ │ │ │ -> Upcase_word("Erlang").
│ │ │ │ +> Upcase_word("Erlang").
│ │ │ │  "ERLANG"
│ │ │ │ -> lists:map(Upcase_word, L).
│ │ │ │ -["I","LIKE","ERLANG"]

Now, the fold and the map can be done at the same time:

> lists:mapfoldl(fun(Word, Sum) ->
│ │ │ │ -{Upcase_word(Word), Sum + length(Word)}
│ │ │ │ -end, 0, L).
│ │ │ │ -{["I","LIKE","ERLANG"],11}

│ │ │ │ +> lists:map(Upcase_word, L). │ │ │ │ +["I","LIKE","ERLANG"]

Now, the fold and the map can be done at the same time:

> lists:mapfoldl(fun(Word, Sum) ->
│ │ │ │ +{Upcase_word(Word), Sum + length(Word)}
│ │ │ │ +end, 0, L).
│ │ │ │ +{["I","LIKE","ERLANG"],11}

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ filter │ │ │ │

│ │ │ │

lists:filter/2 takes a predicate of one argument and a list and returns all elements │ │ │ │ -in the list that satisfy the predicate:

filter(F, [H|T]) ->
│ │ │ │ -    case F(H) of
│ │ │ │ -        true  -> [H|filter(F, T)];
│ │ │ │ -        false -> filter(F, T)
│ │ │ │ +in the list that satisfy the predicate:

filter(F, [H|T]) ->
│ │ │ │ +    case F(H) of
│ │ │ │ +        true  -> [H|filter(F, T)];
│ │ │ │ +        false -> filter(F, T)
│ │ │ │      end;
│ │ │ │ -filter(F, []) -> [].
> lists:filter(Big, [500,12,2,45,6,7]).
│ │ │ │ -[500,12,45]

Combining maps and filters enables writing of very succinct code. For example, │ │ │ │ +filter(F, []) -> [].

> lists:filter(Big, [500,12,2,45,6,7]).
│ │ │ │ +[500,12,45]

Combining maps and filters enables writing of very succinct code. For example, │ │ │ │ to define a set difference function diff(L1, L2) to be the difference between │ │ │ │ -the lists L1 and L2, the code can be written as follows:

diff(L1, L2) ->
│ │ │ │ -    filter(fun(X) -> not member(X, L2) end, L1).

This gives the list of all elements in L1 that are not contained in L2.

The AND intersection of the list L1 and L2 is also easily defined:

intersection(L1,L2) -> filter(fun(X) -> member(X,L1) end, L2).

│ │ │ │ +the lists L1 and L2, the code can be written as follows:

diff(L1, L2) ->
│ │ │ │ +    filter(fun(X) -> not member(X, L2) end, L1).

This gives the list of all elements in L1 that are not contained in L2.

The AND intersection of the list L1 and L2 is also easily defined:

intersection(L1,L2) -> filter(fun(X) -> member(X,L1) end, L2).

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ takewhile │ │ │ │

│ │ │ │

lists:takewhile/2 takes elements X from a list L as long as the predicate │ │ │ │ -P(X) is true:

takewhile(Pred, [H|T]) ->
│ │ │ │ -    case Pred(H) of
│ │ │ │ -        true  -> [H|takewhile(Pred, T)];
│ │ │ │ -        false -> []
│ │ │ │ +P(X) is true:

takewhile(Pred, [H|T]) ->
│ │ │ │ +    case Pred(H) of
│ │ │ │ +        true  -> [H|takewhile(Pred, T)];
│ │ │ │ +        false -> []
│ │ │ │      end;
│ │ │ │ -takewhile(Pred, []) ->
│ │ │ │ -    [].
> lists:takewhile(Big, [200,500,45,5,3,45,6]).
│ │ │ │ -[200,500,45]

│ │ │ │ +takewhile(Pred, []) -> │ │ │ │ + [].

> lists:takewhile(Big, [200,500,45,5,3,45,6]).
│ │ │ │ +[200,500,45]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dropwhile │ │ │ │

│ │ │ │ -

lists:dropwhile/2 is the complement of takewhile:

dropwhile(Pred, [H|T]) ->
│ │ │ │ -    case Pred(H) of
│ │ │ │ -        true  -> dropwhile(Pred, T);
│ │ │ │ -        false -> [H|T]
│ │ │ │ +

lists:dropwhile/2 is the complement of takewhile:

dropwhile(Pred, [H|T]) ->
│ │ │ │ +    case Pred(H) of
│ │ │ │ +        true  -> dropwhile(Pred, T);
│ │ │ │ +        false -> [H|T]
│ │ │ │      end;
│ │ │ │ -dropwhile(Pred, []) ->
│ │ │ │ -    [].
> lists:dropwhile(Big, [200,500,45,5,3,45,6]).
│ │ │ │ -[5,3,45,6]

│ │ │ │ +dropwhile(Pred, []) -> │ │ │ │ + [].

> lists:dropwhile(Big, [200,500,45,5,3,45,6]).
│ │ │ │ +[5,3,45,6]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ splitwith │ │ │ │

│ │ │ │

lists:splitwith/2 splits the list L into the two sublists {L1, L2}, where │ │ │ │ -L = takewhile(P, L) and L2 = dropwhile(P, L):

splitwith(Pred, L) ->
│ │ │ │ -    splitwith(Pred, L, []).
│ │ │ │ +L = takewhile(P, L) and L2 = dropwhile(P, L):

splitwith(Pred, L) ->
│ │ │ │ +    splitwith(Pred, L, []).
│ │ │ │  
│ │ │ │ -splitwith(Pred, [H|T], L) ->
│ │ │ │ -    case Pred(H) of
│ │ │ │ -        true  -> splitwith(Pred, T, [H|L]);
│ │ │ │ -        false -> {reverse(L), [H|T]}
│ │ │ │ +splitwith(Pred, [H|T], L) ->
│ │ │ │ +    case Pred(H) of
│ │ │ │ +        true  -> splitwith(Pred, T, [H|L]);
│ │ │ │ +        false -> {reverse(L), [H|T]}
│ │ │ │      end;
│ │ │ │ -splitwith(Pred, [], L) ->
│ │ │ │ -    {reverse(L), []}.
> lists:splitwith(Big, [200,500,45,5,3,45,6]).
│ │ │ │ -{[200,500,45],[5,3,45,6]}

│ │ │ │ +splitwith(Pred, [], L) -> │ │ │ │ + {reverse(L), []}.

> lists:splitwith(Big, [200,500,45,5,3,45,6]).
│ │ │ │ +{[200,500,45],[5,3,45,6]}

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Funs Returning Funs │ │ │ │

│ │ │ │

So far, only functions that take funs as arguments have been described. More │ │ │ │ powerful functions, that themselves return funs, can also be written. The │ │ │ │ following examples illustrate these type of functions.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Simple Higher Order Functions │ │ │ │

│ │ │ │

Adder(X) is a function that given X, returns a new function G such that │ │ │ │ -G(K) returns K + X:

> Adder = fun(X) -> fun(Y) -> X + Y end end.
│ │ │ │ +G(K) returns K + X:

> Adder = fun(X) -> fun(Y) -> X + Y end end.
│ │ │ │  #Fun<erl_eval.6.72228031>
│ │ │ │ -> Add6 = Adder(6).
│ │ │ │ +> Add6 = Adder(6).
│ │ │ │  #Fun<erl_eval.6.72228031>
│ │ │ │ -> Add6(10).
│ │ │ │ +> Add6(10).
│ │ │ │  16

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Infinite Lists │ │ │ │

│ │ │ │ -

The idea is to write something like:

-module(lazy).
│ │ │ │ --export([ints_from/1]).
│ │ │ │ -ints_from(N) ->
│ │ │ │ -    fun() ->
│ │ │ │ -            [N|ints_from(N+1)]
│ │ │ │ -    end.

Then proceed as follows:

> XX = lazy:ints_from(1).
│ │ │ │ +

The idea is to write something like:

-module(lazy).
│ │ │ │ +-export([ints_from/1]).
│ │ │ │ +ints_from(N) ->
│ │ │ │ +    fun() ->
│ │ │ │ +            [N|ints_from(N+1)]
│ │ │ │ +    end.

Then proceed as follows:

> XX = lazy:ints_from(1).
│ │ │ │  #Fun<lazy.0.29874839>
│ │ │ │ -> XX().
│ │ │ │ -[1|#Fun<lazy.0.29874839>]
│ │ │ │ -> hd(XX()).
│ │ │ │ +> XX().
│ │ │ │ +[1|#Fun<lazy.0.29874839>]
│ │ │ │ +> hd(XX()).
│ │ │ │  1
│ │ │ │ -> Y = tl(XX()).
│ │ │ │ +> Y = tl(XX()).
│ │ │ │  #Fun<lazy.0.29874839>
│ │ │ │ -> hd(Y()).
│ │ │ │ +> hd(Y()).
│ │ │ │  2

And so on. This is an example of "lazy embedding".

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Parsing │ │ │ │

│ │ │ │ -

The following examples show parsers of the following type:

Parser(Toks) -> {ok, Tree, Toks1} | fail

Toks is the list of tokens to be parsed. A successful parse returns │ │ │ │ +

The following examples show parsers of the following type:

Parser(Toks) -> {ok, Tree, Toks1} | fail

Toks is the list of tokens to be parsed. A successful parse returns │ │ │ │ {ok, Tree, Toks1}.

  • Tree is a parse tree.
  • Toks1 is a tail of Tree that contains symbols encountered after the │ │ │ │ structure that was correctly parsed.

An unsuccessful parse returns fail.

The following example illustrates a simple, functional parser that parses the │ │ │ │ grammar:

(a | b) & (c | d)

The following code defines a function pconst(X) in the module funparse, │ │ │ │ -which returns a fun that parses a list of tokens:

pconst(X) ->
│ │ │ │ -    fun (T) ->
│ │ │ │ +which returns a fun that parses a list of tokens:

pconst(X) ->
│ │ │ │ +    fun (T) ->
│ │ │ │         case T of
│ │ │ │ -           [X|T1] -> {ok, {const, X}, T1};
│ │ │ │ +           [X|T1] -> {ok, {const, X}, T1};
│ │ │ │             _      -> fail
│ │ │ │         end
│ │ │ │ -    end.

This function can be used as follows:

> P1 = funparse:pconst(a).
│ │ │ │ +    end.

This function can be used as follows:

> P1 = funparse:pconst(a).
│ │ │ │  #Fun<funparse.0.22674075>
│ │ │ │ -> P1([a,b,c]).
│ │ │ │ -{ok,{const,a},[b,c]}
│ │ │ │ -> P1([x,y,z]).
│ │ │ │ +> P1([a,b,c]).
│ │ │ │ +{ok,{const,a},[b,c]}
│ │ │ │ +> P1([x,y,z]).
│ │ │ │  fail

Next, the two higher order functions pand and por are defined. They combine │ │ │ │ -primitive parsers to produce more complex parsers.

First pand:

pand(P1, P2) ->
│ │ │ │ -    fun (T) ->
│ │ │ │ -        case P1(T) of
│ │ │ │ -            {ok, R1, T1} ->
│ │ │ │ -                case P2(T1) of
│ │ │ │ -                    {ok, R2, T2} ->
│ │ │ │ -                        {ok, {'and', R1, R2}};
│ │ │ │ +primitive parsers to produce more complex parsers.

First pand:

pand(P1, P2) ->
│ │ │ │ +    fun (T) ->
│ │ │ │ +        case P1(T) of
│ │ │ │ +            {ok, R1, T1} ->
│ │ │ │ +                case P2(T1) of
│ │ │ │ +                    {ok, R2, T2} ->
│ │ │ │ +                        {ok, {'and', R1, R2}};
│ │ │ │                      fail ->
│ │ │ │                          fail
│ │ │ │                  end;
│ │ │ │              fail ->
│ │ │ │                  fail
│ │ │ │          end
│ │ │ │      end.

Given a parser P1 for grammar G1, and a parser P2 for grammar G2, │ │ │ │ pand(P1, P2) returns a parser for the grammar, which consists of sequences of │ │ │ │ tokens that satisfy G1, followed by sequences of tokens that satisfy G2.

por(P1, P2) returns a parser for the language described by the grammar G1 or │ │ │ │ -G2:

por(P1, P2) ->
│ │ │ │ -    fun (T) ->
│ │ │ │ -        case P1(T) of
│ │ │ │ -            {ok, R, T1} ->
│ │ │ │ -                {ok, {'or',1,R}, T1};
│ │ │ │ +G2:

por(P1, P2) ->
│ │ │ │ +    fun (T) ->
│ │ │ │ +        case P1(T) of
│ │ │ │ +            {ok, R, T1} ->
│ │ │ │ +                {ok, {'or',1,R}, T1};
│ │ │ │              fail ->
│ │ │ │ -                case P2(T) of
│ │ │ │ -                    {ok, R1, T1} ->
│ │ │ │ -                        {ok, {'or',2,R1}, T1};
│ │ │ │ +                case P2(T) of
│ │ │ │ +                    {ok, R1, T1} ->
│ │ │ │ +                        {ok, {'or',2,R1}, T1};
│ │ │ │                      fail ->
│ │ │ │                          fail
│ │ │ │                  end
│ │ │ │          end
│ │ │ │      end.

The original problem was to parse the grammar (a | b) & (c | d). The following │ │ │ │ -code addresses this problem:

grammar() ->
│ │ │ │ -    pand(
│ │ │ │ -         por(pconst(a), pconst(b)),
│ │ │ │ -         por(pconst(c), pconst(d))).

The following code adds a parser interface to the grammar:

parse(List) ->
│ │ │ │ -    (grammar())(List).

The parser can be tested as follows:

> funparse:parse([a,c]).
│ │ │ │ -{ok,{'and',{'or',1,{const,a}},{'or',1,{const,c}}}}
│ │ │ │ -> funparse:parse([a,d]).
│ │ │ │ -{ok,{'and',{'or',1,{const,a}},{'or',2,{const,d}}}}
│ │ │ │ -> funparse:parse([b,c]).
│ │ │ │ -{ok,{'and',{'or',2,{const,b}},{'or',1,{const,c}}}}
│ │ │ │ -> funparse:parse([b,d]).
│ │ │ │ -{ok,{'and',{'or',2,{const,b}},{'or',2,{const,d}}}}
│ │ │ │ -> funparse:parse([a,b]).
│ │ │ │ +code addresses this problem:

grammar() ->
│ │ │ │ +    pand(
│ │ │ │ +         por(pconst(a), pconst(b)),
│ │ │ │ +         por(pconst(c), pconst(d))).

The following code adds a parser interface to the grammar:

parse(List) ->
│ │ │ │ +    (grammar())(List).

The parser can be tested as follows:

> funparse:parse([a,c]).
│ │ │ │ +{ok,{'and',{'or',1,{const,a}},{'or',1,{const,c}}}}
│ │ │ │ +> funparse:parse([a,d]).
│ │ │ │ +{ok,{'and',{'or',1,{const,a}},{'or',2,{const,d}}}}
│ │ │ │ +> funparse:parse([b,c]).
│ │ │ │ +{ok,{'and',{'or',2,{const,b}},{'or',1,{const,c}}}}
│ │ │ │ +> funparse:parse([b,d]).
│ │ │ │ +{ok,{'and',{'or',2,{const,b}},{'or',2,{const,d}}}}
│ │ │ │ +> funparse:parse([a,b]).
│ │ │ │  fail
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/expressions.xhtml │ │ │ │ @@ -56,81 +56,81 @@ │ │ │ │
Phone_number │ │ │ │ _ │ │ │ │ _Height │ │ │ │ name@node

Variables are bound to values using pattern matching. Erlang uses │ │ │ │ single assignment, that is, a variable can only be bound once.

The anonymous variable is denoted by underscore (_) and can be used when a │ │ │ │ variable is required but its value can be ignored.

Example:

[H|_] = [1,2,3]

Variables starting with underscore (_), for example, _Height, are normal │ │ │ │ variables, not anonymous. However, they are ignored by the compiler in the sense │ │ │ │ -that they do not generate warnings.

Example:

The following code:

member(_, []) ->
│ │ │ │ -    [].

can be rewritten to be more readable:

member(Elem, []) ->
│ │ │ │ -    [].

This causes a warning for an unused variable, Elem. To avoid the warning, │ │ │ │ -the code can be rewritten to:

member(_Elem, []) ->
│ │ │ │ -    [].

Notice that since variables starting with an underscore are not anonymous, the │ │ │ │ -following example matches:

{_,_} = {1,2}

But this example fails:

{_N,_N} = {1,2}

The scope for a variable is its function clause. Variables bound in a branch of │ │ │ │ +that they do not generate warnings.

Example:

The following code:

member(_, []) ->
│ │ │ │ +    [].

can be rewritten to be more readable:

member(Elem, []) ->
│ │ │ │ +    [].

This causes a warning for an unused variable, Elem. To avoid the warning, │ │ │ │ +the code can be rewritten to:

member(_Elem, []) ->
│ │ │ │ +    [].

Notice that since variables starting with an underscore are not anonymous, the │ │ │ │ +following example matches:

{_,_} = {1,2}

But this example fails:

{_N,_N} = {1,2}

The scope for a variable is its function clause. Variables bound in a branch of │ │ │ │ an if, case, or receive expression must be bound in all branches to have a │ │ │ │ value outside the expression. Otherwise they are regarded as unsafe outside │ │ │ │ the expression.

For the try expression variable scoping is limited so that variables bound in │ │ │ │ the expression are always unsafe outside the expression.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Patterns │ │ │ │

│ │ │ │

A pattern has the same structure as a term but can contain unbound variables.

Example:

Name1
│ │ │ │ -[H|T]
│ │ │ │ -{error,Reason}

Patterns are allowed in clause heads, case expressions, │ │ │ │ +[H|T] │ │ │ │ +{error,Reason}

Patterns are allowed in clause heads, case expressions, │ │ │ │ receive expressions, and │ │ │ │ match expressions.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ The Compound Pattern Operator │ │ │ │

│ │ │ │

If Pattern1 and Pattern2 are valid patterns, the following is also a valid │ │ │ │ pattern:

Pattern1 = Pattern2

When matched against a term, both Pattern1 and Pattern2 are matched against │ │ │ │ -the term. The idea behind this feature is to avoid reconstruction of terms.

Example:

f({connect,From,To,Number,Options}, To) ->
│ │ │ │ -    Signal = {connect,From,To,Number,Options},
│ │ │ │ +the term. The idea behind this feature is to avoid reconstruction of terms.

Example:

f({connect,From,To,Number,Options}, To) ->
│ │ │ │ +    Signal = {connect,From,To,Number,Options},
│ │ │ │      ...;
│ │ │ │ -f(Signal, To) ->
│ │ │ │ -    ignore.

can instead be written as

f({connect,_,To,_,_} = Signal, To) ->
│ │ │ │ +f(Signal, To) ->
│ │ │ │ +    ignore.

can instead be written as

f({connect,_,To,_,_} = Signal, To) ->
│ │ │ │      ...;
│ │ │ │ -f(Signal, To) ->
│ │ │ │ +f(Signal, To) ->
│ │ │ │      ignore.

The compound pattern operator does not imply that its operands are matched in │ │ │ │ any particular order. That means that it is not legal to bind a variable in │ │ │ │ Pattern1 and use it in Pattern2, or vice versa.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ String Prefix in Patterns │ │ │ │

│ │ │ │ -

When matching strings, the following is a valid pattern:

f("prefix" ++ Str) -> ...

This is syntactic sugar for the equivalent, but harder to read:

f([$p,$r,$e,$f,$i,$x | Str]) -> ...

│ │ │ │ +

When matching strings, the following is a valid pattern:

f("prefix" ++ Str) -> ...

This is syntactic sugar for the equivalent, but harder to read:

f([$p,$r,$e,$f,$i,$x | Str]) -> ...

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Expressions in Patterns │ │ │ │

│ │ │ │

An arithmetic expression can be used within a pattern if it meets both of the │ │ │ │ -following two conditions:

  • It uses only numeric or bitwise operators.
  • Its value can be evaluated to a constant when complied.

Example:

case {Value, Result} of
│ │ │ │ -    {?THRESHOLD+1, ok} -> ...

│ │ │ │ +following two conditions:

  • It uses only numeric or bitwise operators.
  • Its value can be evaluated to a constant when complied.

Example:

case {Value, Result} of
│ │ │ │ +    {?THRESHOLD+1, ok} -> ...

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ The Match Operator │ │ │ │

│ │ │ │

The following matches Pattern against Expr:

Pattern = Expr

If the matching succeeds, any unbound variable in the pattern becomes bound and │ │ │ │ the value of Expr is returned.

If multiple match operators are applied in sequence, they will be evaluated from │ │ │ │ -right to left.

If the matching fails, a badmatch run-time error occurs.

Examples:

1> {A, B} = T = {answer, 42}.
│ │ │ │ -{answer,42}
│ │ │ │ +right to left.

If the matching fails, a badmatch run-time error occurs.

Examples:

1> {A, B} = T = {answer, 42}.
│ │ │ │ +{answer,42}
│ │ │ │  2> A.
│ │ │ │  answer
│ │ │ │  3> B.
│ │ │ │  42
│ │ │ │  4> T.
│ │ │ │ -{answer,42}
│ │ │ │ -5> {C, D} = [1, 2].
│ │ │ │ +{answer,42}
│ │ │ │ +5> {C, D} = [1, 2].
│ │ │ │  ** exception error: no match of right-hand side value [1,2]

Because multiple match operators are evaluated from right to left, it means │ │ │ │ that:

Pattern1 = Pattern2 = . . . = PatternN = Expression

is equivalent to:

Temporary = Expression,
│ │ │ │  PatternN = Temporary,
│ │ │ │     .
│ │ │ │     .
│ │ │ │     .,
│ │ │ │  Pattern2 = Temporary,
│ │ │ │ @@ -144,30 +144,30 @@
│ │ │ │  can safely be skipped on a first reading.

The = character is used to denote two similar but distinct operators: the │ │ │ │ match operator and the compound pattern operator. Which one is meant is │ │ │ │ determined by context.

The compound pattern operator is used to construct a compound pattern from two │ │ │ │ patterns. Compound patterns are accepted everywhere a pattern is accepted. A │ │ │ │ compound pattern matches if all of its constituent patterns match. It is not │ │ │ │ legal for a pattern that is part of a compound pattern to use variables (as keys │ │ │ │ in map patterns or sizes in binary patterns) bound in other sub patterns of the │ │ │ │ -same compound pattern.

Examples:

1> fun(#{Key := Value} = #{key := Key}) -> Value end.
│ │ │ │ +same compound pattern.

Examples:

1> fun(#{Key := Value} = #{key := Key}) -> Value end.
│ │ │ │  * 1:7: variable 'Key' is unbound
│ │ │ │ -2> F = fun({A, B} = E) -> {E, A + B} end, F({1,2}).
│ │ │ │ -{{1,2},3}
│ │ │ │ -3> G = fun(<<A:8,B:8>> = <<C:16>>) -> {A, B, C} end, G(<<42,43>>).
│ │ │ │ -{42,43,10795}

The match operator is allowed everywhere an expression is allowed. It is used │ │ │ │ +2> F = fun({A, B} = E) -> {E, A + B} end, F({1,2}). │ │ │ │ +{{1,2},3} │ │ │ │ +3> G = fun(<<A:8,B:8>> = <<C:16>>) -> {A, B, C} end, G(<<42,43>>). │ │ │ │ +{42,43,10795}

The match operator is allowed everywhere an expression is allowed. It is used │ │ │ │ to match the value of an expression to a pattern. If multiple match operators │ │ │ │ -are applied in sequence, they will be evaluated from right to left.

Examples:

1> M = #{key => key2, key2 => value}.
│ │ │ │ -#{key => key2,key2 => value}
│ │ │ │ -2> f(Key), #{Key := Value} = #{key := Key} = M, Value.
│ │ │ │ +are applied in sequence, they will be evaluated from right to left.

Examples:

1> M = #{key => key2, key2 => value}.
│ │ │ │ +#{key => key2,key2 => value}
│ │ │ │ +2> f(Key), #{Key := Value} = #{key := Key} = M, Value.
│ │ │ │  value
│ │ │ │ -3> f(Key), #{Key := Value} = (#{key := Key} = M), Value.
│ │ │ │ +3> f(Key), #{Key := Value} = (#{key := Key} = M), Value.
│ │ │ │  value
│ │ │ │ -4> f(Key), (#{Key := Value} = #{key := Key}) = M, Value.
│ │ │ │ +4> f(Key), (#{Key := Value} = #{key := Key}) = M, Value.
│ │ │ │  * 1:12: variable 'Key' is unbound
│ │ │ │ -5> <<X:Y>> = begin Y = 8, <<42:8>> end, X.
│ │ │ │ +5> <<X:Y>> = begin Y = 8, <<42:8>> end, X.
│ │ │ │  42

The expression at prompt 2> first matches the value of variable M against │ │ │ │ pattern #{key := Key}, binding variable Key. It then matches the value of │ │ │ │ M against pattern #{Key := Value} using variable Key as the key, binding │ │ │ │ variable Value.

The expression at prompt 3> matches expression (#{key := Key} = M) against │ │ │ │ pattern #{Key := Value}. The expression inside the parentheses is evaluated │ │ │ │ first. That is, M is matched against #{key := Key}, and then the value of │ │ │ │ M is matched against pattern #{Key := Value}. That is the same evaluation │ │ │ │ @@ -181,30 +181,30 @@ │ │ │ │ binding variable Y and creating a binary. The binary is then matched against │ │ │ │ pattern <<X:Y>> using the value of Y as the size of the segment.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Function Calls │ │ │ │

│ │ │ │ -
ExprF(Expr1,...,ExprN)
│ │ │ │ -ExprM:ExprF(Expr1,...,ExprN)

In the first form of function calls, ExprM:ExprF(Expr1,...,ExprN), each of │ │ │ │ +

ExprF(Expr1,...,ExprN)
│ │ │ │ +ExprM:ExprF(Expr1,...,ExprN)

In the first form of function calls, ExprM:ExprF(Expr1,...,ExprN), each of │ │ │ │ ExprM and ExprF must be an atom or an expression that evaluates to an atom. │ │ │ │ The function is said to be called by using the fully qualified function name. │ │ │ │ -This is often referred to as a remote or external function call.

Example:

lists:keyfind(Name, 1, List)

In the second form of function calls, ExprF(Expr1,...,ExprN), ExprF must be │ │ │ │ +This is often referred to as a remote or external function call.

Example:

lists:keyfind(Name, 1, List)

In the second form of function calls, ExprF(Expr1,...,ExprN), ExprF must be │ │ │ │ an atom or evaluate to a fun.

If ExprF is an atom, the function is said to be called by using the │ │ │ │ implicitly qualified function name. If the function ExprF is locally │ │ │ │ defined, it is called. Alternatively, if ExprF is explicitly imported from the │ │ │ │ M module, M:ExprF(Expr1,...,ExprN) is called. If ExprF is neither declared │ │ │ │ locally nor explicitly imported, ExprF must be the name of an automatically │ │ │ │ -imported BIF.

Examples:

handle(Msg, State)
│ │ │ │ -spawn(m, init, [])

Examples where ExprF is a fun:

1> Fun1 = fun(X) -> X+1 end,
│ │ │ │ -Fun1(3).
│ │ │ │ +imported BIF.

Examples:

handle(Msg, State)
│ │ │ │ +spawn(m, init, [])

Examples where ExprF is a fun:

1> Fun1 = fun(X) -> X+1 end,
│ │ │ │ +Fun1(3).
│ │ │ │  4
│ │ │ │ -2> fun lists:append/2([1,2], [3,4]).
│ │ │ │ -[1,2,3,4]
│ │ │ │ +2> fun lists:append/2([1,2], [3,4]).
│ │ │ │ +[1,2,3,4]
│ │ │ │  3>

Notice that when calling a local function, there is a difference between using │ │ │ │ the implicitly or fully qualified function name. The latter always refers to the │ │ │ │ latest version of the module. See │ │ │ │ Compilation and Code Loading and │ │ │ │ Function Evaluation.

│ │ │ │ │ │ │ │ │ │ │ │ @@ -221,40 +221,40 @@ │ │ │ │ called instead. This is to avoid that future additions to the set of │ │ │ │ auto-imported BIFs do not silently change the behavior of old code.

However, to avoid that old (pre R14) code changed its behavior when compiled │ │ │ │ with Erlang/OTP version R14A or later, the following restriction applies: If you │ │ │ │ override the name of a BIF that was auto-imported in OTP versions prior to R14A │ │ │ │ (ERTS version 5.8) and have an implicitly qualified call to that function in │ │ │ │ your code, you either need to explicitly remove the auto-import using a compiler │ │ │ │ directive, or replace the call with a fully qualified function call. Otherwise │ │ │ │ -you get a compilation error. See the following example:

-export([length/1,f/1]).
│ │ │ │ +you get a compilation error. See the following example:

-export([length/1,f/1]).
│ │ │ │  
│ │ │ │ --compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported
│ │ │ │ +-compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported
│ │ │ │  
│ │ │ │ -length([]) ->
│ │ │ │ +length([]) ->
│ │ │ │      0;
│ │ │ │ -length([H|T]) ->
│ │ │ │ -    1 + length(T). %% Calls the local function length/1
│ │ │ │ +length([H|T]) ->
│ │ │ │ +    1 + length(T). %% Calls the local function length/1
│ │ │ │  
│ │ │ │ -f(X) when erlang:length(X) > 3 -> %% Calls erlang:length/1,
│ │ │ │ +f(X) when erlang:length(X) > 3 -> %% Calls erlang:length/1,
│ │ │ │                                    %% which is allowed in guards
│ │ │ │      long.

The same logic applies to explicitly imported functions from other modules, as │ │ │ │ to locally defined functions. It is not allowed to both import a function from │ │ │ │ -another module and have the function declared in the module at the same time:

-export([f/1]).
│ │ │ │ +another module and have the function declared in the module at the same time:

-export([f/1]).
│ │ │ │  
│ │ │ │ --compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported
│ │ │ │ +-compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported
│ │ │ │  
│ │ │ │ --import(mod,[length/1]).
│ │ │ │ +-import(mod,[length/1]).
│ │ │ │  
│ │ │ │ -f(X) when erlang:length(X) > 33 -> %% Calls erlang:length/1,
│ │ │ │ +f(X) when erlang:length(X) > 33 -> %% Calls erlang:length/1,
│ │ │ │                                     %% which is allowed in guards
│ │ │ │  
│ │ │ │ -    erlang:length(X);              %% Explicit call to erlang:length in body
│ │ │ │ +    erlang:length(X);              %% Explicit call to erlang:length in body
│ │ │ │  
│ │ │ │ -f(X) ->
│ │ │ │ -    length(X).                     %% mod:length/1 is called

For auto-imported BIFs added in Erlang/OTP R14A and thereafter, overriding the │ │ │ │ +f(X) -> │ │ │ │ + length(X). %% mod:length/1 is called

For auto-imported BIFs added in Erlang/OTP R14A and thereafter, overriding the │ │ │ │ name with a local function or explicit import is always allowed. However, if the │ │ │ │ -compile({no_auto_import,[F/A]) directive is not used, the compiler issues a │ │ │ │ warning whenever the function is called in the module using the implicitly │ │ │ │ qualified function name.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -266,40 +266,40 @@ │ │ │ │ ...; │ │ │ │ GuardSeqN -> │ │ │ │ BodyN │ │ │ │ end

The branches of an if-expression are scanned sequentially until a guard │ │ │ │ sequence GuardSeq that evaluates to true is found. Then the corresponding │ │ │ │ Body (a sequence of expressions separated by ,) is evaluated.

The return value of Body is the return value of the if expression.

If no guard sequence is evaluated as true, an if_clause run-time error occurs. │ │ │ │ If necessary, the guard expression true can be used in the last branch, as │ │ │ │ -that guard sequence is always true.

Example:

is_greater_than(X, Y) ->
│ │ │ │ +that guard sequence is always true.

Example:

is_greater_than(X, Y) ->
│ │ │ │      if
│ │ │ │          X > Y ->
│ │ │ │              true;
│ │ │ │          true -> % works as an 'else' branch
│ │ │ │              false
│ │ │ │      end

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Case │ │ │ │

│ │ │ │
case Expr of
│ │ │ │ -    Pattern1 [when GuardSeq1] ->
│ │ │ │ +    Pattern1 [when GuardSeq1] ->
│ │ │ │          Body1;
│ │ │ │      ...;
│ │ │ │ -    PatternN [when GuardSeqN] ->
│ │ │ │ +    PatternN [when GuardSeqN] ->
│ │ │ │          BodyN
│ │ │ │  end

The expression Expr is evaluated and the patterns Pattern are sequentially │ │ │ │ matched against the result. If a match succeeds and the optional guard sequence │ │ │ │ GuardSeq is true, the corresponding Body is evaluated.

The return value of Body is the return value of the case expression.

If there is no matching pattern with a true guard sequence, a case_clause │ │ │ │ -run-time error occurs.

Example:

is_valid_signal(Signal) ->
│ │ │ │ +run-time error occurs.

Example:

is_valid_signal(Signal) ->
│ │ │ │      case Signal of
│ │ │ │ -        {signal, _What, _From, _To} ->
│ │ │ │ +        {signal, _What, _From, _To} ->
│ │ │ │              true;
│ │ │ │ -        {signal, _What, _To} ->
│ │ │ │ +        {signal, _What, _To} ->
│ │ │ │              true;
│ │ │ │          _Else ->
│ │ │ │              false
│ │ │ │      end.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -317,57 +317,57 @@ │ │ │ │ the top-level of a maybe block. It matches the pattern Expr1 against │ │ │ │ Expr2. If the matching succeeds, any unbound variable in the pattern becomes │ │ │ │ bound. If the expression is the last expression in the maybe block, it also │ │ │ │ returns the value of Expr2. If the matching is unsuccessful, the rest of the │ │ │ │ expressions in the maybe block are skipped and the return value of the maybe │ │ │ │ block is Expr2.

None of the variables bound in a maybe block must be used in the code that │ │ │ │ follows the block.

Here is an example:

maybe
│ │ │ │ -    {ok, A} ?= a(),
│ │ │ │ +    {ok, A} ?= a(),
│ │ │ │      true = A >= 0,
│ │ │ │ -    {ok, B} ?= b(),
│ │ │ │ +    {ok, B} ?= b(),
│ │ │ │      A + B
│ │ │ │  end

Let us first assume that a() returns {ok,42} and b() returns {ok,58}. │ │ │ │ With those return values, all of the match operators will succeed, and the │ │ │ │ return value of the maybe block is A + B, which is equal to 42 + 58 = 100.

Now let us assume that a() returns error. The conditional match operator in │ │ │ │ {ok, A} ?= a() fails to match, and the return value of the maybe block is │ │ │ │ the value of the expression that failed to match, namely error. Similarly, if │ │ │ │ b() returns wrong, the return value of the maybe block is wrong.

Finally, let us assume that a() returns {ok,-1}. Because true = A >= 0 uses │ │ │ │ the match operator =, a {badmatch,false} run-time error occurs when the │ │ │ │ -expression fails to match the pattern.

The example can be written in a less succient way using nested case expressions:

case a() of
│ │ │ │ -    {ok, A} ->
│ │ │ │ +expression fails to match the pattern.

The example can be written in a less succient way using nested case expressions:

case a() of
│ │ │ │ +    {ok, A} ->
│ │ │ │          true = A >= 0,
│ │ │ │ -        case b() of
│ │ │ │ -            {ok, B} ->
│ │ │ │ +        case b() of
│ │ │ │ +            {ok, B} ->
│ │ │ │                  A + B;
│ │ │ │              Other1 ->
│ │ │ │                  Other1
│ │ │ │          end;
│ │ │ │      Other2 ->
│ │ │ │          Other2
│ │ │ │  end

The maybe block can be augmented with else clauses:

maybe
│ │ │ │      Expr1,
│ │ │ │      ...,
│ │ │ │      ExprN
│ │ │ │  else
│ │ │ │ -    Pattern1 [when GuardSeq1] ->
│ │ │ │ +    Pattern1 [when GuardSeq1] ->
│ │ │ │          Body1;
│ │ │ │      ...;
│ │ │ │ -    PatternN [when GuardSeqN] ->
│ │ │ │ +    PatternN [when GuardSeqN] ->
│ │ │ │          BodyN
│ │ │ │  end

If a conditional match operator fails, the failed expression is matched against │ │ │ │ the patterns in all clauses between the else and end keywords. If a match │ │ │ │ succeeds and the optional guard sequence GuardSeq is true, the corresponding │ │ │ │ Body is evaluated. The value returned from the body is the return value of the │ │ │ │ maybe block.

If there is no matching pattern with a true guard sequence, an else_clause │ │ │ │ run-time error occurs.

None of the variables bound in a maybe block must be used in the else │ │ │ │ clauses. None of the variables bound in the else clauses must be used in the │ │ │ │ code that follows the maybe block.

Here is the previous example augmented with else clauses:

maybe
│ │ │ │ -    {ok, A} ?= a(),
│ │ │ │ +    {ok, A} ?= a(),
│ │ │ │      true = A >= 0,
│ │ │ │ -    {ok, B} ?= b(),
│ │ │ │ +    {ok, B} ?= b(),
│ │ │ │      A + B
│ │ │ │  else
│ │ │ │      error -> error;
│ │ │ │      wrong -> error
│ │ │ │  end

The else clauses translate the failing value from the conditional match │ │ │ │ operators to the value error. If the failing value is not one of the │ │ │ │ recognized values, a else_clause run-time error occurs.

│ │ │ │ @@ -386,75 +386,75 @@ │ │ │ │ {Name,Node} (or a pid located at another node), also never fails.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Receive │ │ │ │

│ │ │ │
receive
│ │ │ │ -    Pattern1 [when GuardSeq1] ->
│ │ │ │ +    Pattern1 [when GuardSeq1] ->
│ │ │ │          Body1;
│ │ │ │      ...;
│ │ │ │ -    PatternN [when GuardSeqN] ->
│ │ │ │ +    PatternN [when GuardSeqN] ->
│ │ │ │          BodyN
│ │ │ │  end

Fetches a received message present in the message queue of the process. The │ │ │ │ first message in the message queue is matched sequentially against the patterns │ │ │ │ from top to bottom. If no match was found, the matching sequence is repeated for │ │ │ │ the second message in the queue, and so on. Messages are queued in the │ │ │ │ order they were received. If a match │ │ │ │ succeeds, that is, if the Pattern matches and the optional guard sequence │ │ │ │ GuardSeq is true, then the message is removed from the message queue and the │ │ │ │ corresponding Body is evaluated. All other messages in the message queue │ │ │ │ remain unchanged.

The return value of Body is the return value of the receive expression.

receive never fails. The execution is suspended, possibly indefinitely, until │ │ │ │ a message arrives that matches one of the patterns and with a true guard │ │ │ │ -sequence.

Example:

wait_for_onhook() ->
│ │ │ │ +sequence.

Example:

wait_for_onhook() ->
│ │ │ │      receive
│ │ │ │          onhook ->
│ │ │ │ -            disconnect(),
│ │ │ │ -            idle();
│ │ │ │ -        {connect, B} ->
│ │ │ │ -            B ! {busy, self()},
│ │ │ │ -            wait_for_onhook()
│ │ │ │ +            disconnect(),
│ │ │ │ +            idle();
│ │ │ │ +        {connect, B} ->
│ │ │ │ +            B ! {busy, self()},
│ │ │ │ +            wait_for_onhook()
│ │ │ │      end.

The receive expression can be augmented with a timeout:

receive
│ │ │ │ -    Pattern1 [when GuardSeq1] ->
│ │ │ │ +    Pattern1 [when GuardSeq1] ->
│ │ │ │          Body1;
│ │ │ │      ...;
│ │ │ │ -    PatternN [when GuardSeqN] ->
│ │ │ │ +    PatternN [when GuardSeqN] ->
│ │ │ │          BodyN
│ │ │ │  after
│ │ │ │      ExprT ->
│ │ │ │          BodyT
│ │ │ │  end

receive...after works exactly as receive, except that if no matching message │ │ │ │ has arrived within ExprT milliseconds, then BodyT is evaluated instead. The │ │ │ │ return value of BodyT then becomes the return value of the receive...after │ │ │ │ expression. ExprT is to evaluate to an integer, or the atom infinity. The │ │ │ │ allowed integer range is from 0 to 4294967295, that is, the longest possible │ │ │ │ timeout is almost 50 days. With a zero value the timeout occurs immediately if │ │ │ │ there is no matching message in the message queue.

The atom infinity will make the process wait indefinitely for a matching │ │ │ │ message. This is the same as not using a timeout. It can be useful for timeout │ │ │ │ -values that are calculated at runtime.

Example:

wait_for_onhook() ->
│ │ │ │ +values that are calculated at runtime.

Example:

wait_for_onhook() ->
│ │ │ │      receive
│ │ │ │          onhook ->
│ │ │ │ -            disconnect(),
│ │ │ │ -            idle();
│ │ │ │ -        {connect, B} ->
│ │ │ │ -            B ! {busy, self()},
│ │ │ │ -            wait_for_onhook()
│ │ │ │ +            disconnect(),
│ │ │ │ +            idle();
│ │ │ │ +        {connect, B} ->
│ │ │ │ +            B ! {busy, self()},
│ │ │ │ +            wait_for_onhook()
│ │ │ │      after
│ │ │ │          60000 ->
│ │ │ │ -            disconnect(),
│ │ │ │ -            error()
│ │ │ │ +            disconnect(),
│ │ │ │ +            error()
│ │ │ │      end.

It is legal to use a receive...after expression with no branches:

receive
│ │ │ │  after
│ │ │ │      ExprT ->
│ │ │ │          BodyT
│ │ │ │  end

This construction does not consume any messages, only suspends execution in the │ │ │ │ -process for ExprT milliseconds. This can be used to implement simple timers.

Example:

timer() ->
│ │ │ │ -    spawn(m, timer, [self()]).
│ │ │ │ +process for ExprT milliseconds. This can be used to implement simple timers.

Example:

timer() ->
│ │ │ │ +    spawn(m, timer, [self()]).
│ │ │ │  
│ │ │ │ -timer(Pid) ->
│ │ │ │ +timer(Pid) ->
│ │ │ │      receive
│ │ │ │      after
│ │ │ │          5000 ->
│ │ │ │              Pid ! timeout
│ │ │ │      end.

For more information on timers in Erlang in general, see the │ │ │ │ Timers section of the │ │ │ │ Time and Time Correction in Erlang │ │ │ │ @@ -496,21 +496,21 @@ │ │ │ │ false │ │ │ │ 4> 0.0 =:= -0.0. │ │ │ │ false │ │ │ │ 5> 0.0 =:= +0.0. │ │ │ │ true │ │ │ │ 6> 1 > a. │ │ │ │ false │ │ │ │ -7> #{c => 3} > #{a => 1, b => 2}. │ │ │ │ +7> #{c => 3} > #{a => 1, b => 2}. │ │ │ │ false │ │ │ │ -8> #{a => 1, b => 2} == #{a => 1.0, b => 2.0}. │ │ │ │ +8> #{a => 1, b => 2} == #{a => 1.0, b => 2.0}. │ │ │ │ true │ │ │ │ -9> <<2:2>> < <<128>>. │ │ │ │ +9> <<2:2>> < <<128>>. │ │ │ │ true │ │ │ │ -10> <<3:2>> < <<128>>. │ │ │ │ +10> <<3:2>> < <<128>>. │ │ │ │ false

Note

Prior to OTP 27, the term equivalence operators considered 0.0 │ │ │ │ and -0.0 to be the same term.

This was changed in OTP 27 but legacy code may have expected them to be │ │ │ │ considered the same. To help users catch errors that may arise from an │ │ │ │ upgrade, the compiler raises a warning when 0.0 is pattern-matched or used │ │ │ │ in a term equivalence test.

If you need to match 0.0 specifically, the warning can be silenced by │ │ │ │ writing +0.0 instead, which produces the same term but makes the compiler │ │ │ │ interpret the match as being done on purpose.

│ │ │ │ @@ -536,15 +536,15 @@ │ │ │ │ 0 │ │ │ │ 8> 2#10 bor 2#01. │ │ │ │ 3 │ │ │ │ 9> a + 10. │ │ │ │ ** exception error: an error occurred when evaluating an arithmetic expression │ │ │ │ in operator +/2 │ │ │ │ called as a + 10 │ │ │ │ -10> 1 bsl (1 bsl 64). │ │ │ │ +10> 1 bsl (1 bsl 64). │ │ │ │ ** exception error: a system limit has been reached │ │ │ │ in operator bsl/2 │ │ │ │ called as 1 bsl 18446744073709551616

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Boolean Expressions │ │ │ │ @@ -563,136 +563,136 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Short-Circuit Expressions │ │ │ │

│ │ │ │
Expr1 orelse Expr2
│ │ │ │  Expr1 andalso Expr2

Expr2 is evaluated only if necessary. That is, Expr2 is evaluated only if:

  • Expr1 evaluates to false in an orelse expression.

or

  • Expr1 evaluates to true in an andalso expression.

Returns either the value of Expr1 (that is, true or false) or the value of │ │ │ │ -Expr2 (if Expr2 is evaluated).

Example 1:

case A >= -1.0 andalso math:sqrt(A+1) > B of

This works even if A is less than -1.0, since in that case, math:sqrt/1 is │ │ │ │ -never evaluated.

Example 2:

OnlyOne = is_atom(L) orelse
│ │ │ │ -         (is_list(L) andalso length(L) == 1),

Expr2 is not required to evaluate to a Boolean value. Because of that, │ │ │ │ -andalso and orelse are tail-recursive.

Example 3 (tail-recursive function):

all(Pred, [Hd|Tail]) ->
│ │ │ │ -    Pred(Hd) andalso all(Pred, Tail);
│ │ │ │ -all(_, []) ->
│ │ │ │ +Expr2 (if Expr2 is evaluated).

Example 1:

case A >= -1.0 andalso math:sqrt(A+1) > B of

This works even if A is less than -1.0, since in that case, math:sqrt/1 is │ │ │ │ +never evaluated.

Example 2:

OnlyOne = is_atom(L) orelse
│ │ │ │ +         (is_list(L) andalso length(L) == 1),

Expr2 is not required to evaluate to a Boolean value. Because of that, │ │ │ │ +andalso and orelse are tail-recursive.

Example 3 (tail-recursive function):

all(Pred, [Hd|Tail]) ->
│ │ │ │ +    Pred(Hd) andalso all(Pred, Tail);
│ │ │ │ +all(_, []) ->
│ │ │ │      true.

Change

Before Erlang/OTP R13A, Expr2 was required to evaluate to a Boolean value, │ │ │ │ and as consequence, andalso and orelse were not tail-recursive.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ List Operations │ │ │ │

│ │ │ │
Expr1 ++ Expr2
│ │ │ │  Expr1 -- Expr2

The list concatenation operator ++ appends its second argument to its first │ │ │ │ and returns the resulting list.

The list subtraction operator -- produces a list that is a copy of the first │ │ │ │ argument. The procedure is as follows: for each element in the second argument, │ │ │ │ -the first occurrence of this element (if any) is removed.

Example:

1> [1,2,3] ++ [4,5].
│ │ │ │ -[1,2,3,4,5]
│ │ │ │ -2> [1,2,3,2,1,2] -- [2,1,2].
│ │ │ │ -[3,1,2]

│ │ │ │ +the first occurrence of this element (if any) is removed.

Example:

1> [1,2,3] ++ [4,5].
│ │ │ │ +[1,2,3,4,5]
│ │ │ │ +2> [1,2,3,2,1,2] -- [2,1,2].
│ │ │ │ +[3,1,2]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Map Expressions │ │ │ │

│ │ │ │

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Creating Maps │ │ │ │

│ │ │ │

Constructing a new map is done by letting an expression K be associated with │ │ │ │ -another expression V:

#{K => V}

New maps can include multiple associations at construction by listing every │ │ │ │ -association:

#{K1 => V1, ..., Kn => Vn}

An empty map is constructed by not associating any terms with each other:

#{}

All keys and values in the map are terms. Any expression is first evaluated and │ │ │ │ +another expression V:

#{K => V}

New maps can include multiple associations at construction by listing every │ │ │ │ +association:

#{K1 => V1, ..., Kn => Vn}

An empty map is constructed by not associating any terms with each other:

#{}

All keys and values in the map are terms. Any expression is first evaluated and │ │ │ │ then the resulting terms are used as key and value respectively.

Keys and values are separated by the => arrow and associations are separated │ │ │ │ -by a comma (,).

Examples:

M0 = #{},                 % empty map
│ │ │ │ -M1 = #{a => <<"hello">>}, % single association with literals
│ │ │ │ -M2 = #{1 => 2, b => b},   % multiple associations with literals
│ │ │ │ -M3 = #{k => {A,B}},       % single association with variables
│ │ │ │ -M4 = #{{"w", 1} => f()}.  % compound key associated with an evaluated expression

Here, A and B are any expressions and M0 through M4 are the resulting │ │ │ │ -map terms.

If two matching keys are declared, the latter key takes precedence.

Example:

1> #{1 => a, 1 => b}.
│ │ │ │ -#{1 => b }
│ │ │ │ -2> #{1.0 => a, 1 => b}.
│ │ │ │ -#{1 => b, 1.0 => a}

The order in which the expressions constructing the keys (and their associated │ │ │ │ +by a comma (,).

Examples:

M0 = #{},                 % empty map
│ │ │ │ +M1 = #{a => <<"hello">>}, % single association with literals
│ │ │ │ +M2 = #{1 => 2, b => b},   % multiple associations with literals
│ │ │ │ +M3 = #{k => {A,B}},       % single association with variables
│ │ │ │ +M4 = #{{"w", 1} => f()}.  % compound key associated with an evaluated expression

Here, A and B are any expressions and M0 through M4 are the resulting │ │ │ │ +map terms.

If two matching keys are declared, the latter key takes precedence.

Example:

1> #{1 => a, 1 => b}.
│ │ │ │ +#{1 => b }
│ │ │ │ +2> #{1.0 => a, 1 => b}.
│ │ │ │ +#{1 => b, 1.0 => a}

The order in which the expressions constructing the keys (and their associated │ │ │ │ values) are evaluated is not defined. The syntactic order of the key-value pairs │ │ │ │ in the construction is of no relevance, except in the recently mentioned case of │ │ │ │ two matching keys.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Updating Maps │ │ │ │

│ │ │ │

Updating a map has a similar syntax as constructing it.

An expression defining the map to be updated is put in front of the expression │ │ │ │ -defining the keys to be updated and their respective values:

M#{K => V}

Here M is a term of type map and K and V are any expression.

If key K does not match any existing key in the map, a new association is │ │ │ │ +defining the keys to be updated and their respective values:

M#{K => V}

Here M is a term of type map and K and V are any expression.

If key K does not match any existing key in the map, a new association is │ │ │ │ created from key K to value V.

If key K matches an existing key in map M, its associated value is replaced │ │ │ │ by the new value V. In both cases, the evaluated map expression returns a new │ │ │ │ -map.

If M is not of type map, an exception of type badmap is raised.

To only update an existing value, the following syntax is used:

M#{K := V}

Here M is a term of type map, V is an expression and K is an expression │ │ │ │ +map.

If M is not of type map, an exception of type badmap is raised.

To only update an existing value, the following syntax is used:

M#{K := V}

Here M is a term of type map, V is an expression and K is an expression │ │ │ │ that evaluates to an existing key in M.

If key K does not match any existing keys in map M, an exception of type │ │ │ │ badkey is raised at runtime. If a matching key K is present in map M, │ │ │ │ its associated value is replaced by the new value V, and the evaluated map │ │ │ │ -expression returns a new map.

If M is not of type map, an exception of type badmap is raised.

Examples:

M0 = #{},
│ │ │ │ -M1 = M0#{a => 0},
│ │ │ │ -M2 = M1#{a => 1, b => 2},
│ │ │ │ -M3 = M2#{"function" => fun() -> f() end},
│ │ │ │ -M4 = M3#{a := 2, b := 3}.  % 'a' and 'b' was added in `M1` and `M2`.

Here M0 is any map. It follows that M1 through M4 are maps as well.

More examples:

1> M = #{1 => a}.
│ │ │ │ -#{1 => a }
│ │ │ │ -2> M#{1.0 => b}.
│ │ │ │ -#{1 => a, 1.0 => b}.
│ │ │ │ -3> M#{1 := b}.
│ │ │ │ -#{1 => b}
│ │ │ │ -4> M#{1.0 := b}.
│ │ │ │ +expression returns a new map.

If M is not of type map, an exception of type badmap is raised.

Examples:

M0 = #{},
│ │ │ │ +M1 = M0#{a => 0},
│ │ │ │ +M2 = M1#{a => 1, b => 2},
│ │ │ │ +M3 = M2#{"function" => fun() -> f() end},
│ │ │ │ +M4 = M3#{a := 2, b := 3}.  % 'a' and 'b' was added in `M1` and `M2`.

Here M0 is any map. It follows that M1 through M4 are maps as well.

More examples:

1> M = #{1 => a}.
│ │ │ │ +#{1 => a }
│ │ │ │ +2> M#{1.0 => b}.
│ │ │ │ +#{1 => a, 1.0 => b}.
│ │ │ │ +3> M#{1 := b}.
│ │ │ │ +#{1 => b}
│ │ │ │ +4> M#{1.0 := b}.
│ │ │ │  ** exception error: bad argument

As in construction, the order in which the key and value expressions are │ │ │ │ evaluated is not defined. The syntactic order of the key-value pairs in the │ │ │ │ update is of no relevance, except in the case where two keys match. In that │ │ │ │ case, the latter value is used.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Maps in Patterns │ │ │ │

│ │ │ │ -

Matching of key-value associations from maps is done as follows:

#{K := V} = M

Here M is any map. The key K must be a │ │ │ │ +

Matching of key-value associations from maps is done as follows:

#{K := V} = M

Here M is any map. The key K must be a │ │ │ │ guard expression, with all variables already │ │ │ │ bound. V can be any pattern with either bound or unbound variables.

If the variable V is unbound, it becomes bound to the value associated with │ │ │ │ the key K, which must exist in the map M. If the variable V is bound, it │ │ │ │ must match the value associated with K in M.

Change

Before Erlang/OTP 23, the expression defining the key K was restricted to be │ │ │ │ -either a single variable or a literal.

Example:

1> M = #{"tuple" => {1,2}}.
│ │ │ │ -#{"tuple" => {1,2}}
│ │ │ │ -2> #{"tuple" := {1,B}} = M.
│ │ │ │ -#{"tuple" => {1,2}}
│ │ │ │ +either a single variable or a literal.

Example:

1> M = #{"tuple" => {1,2}}.
│ │ │ │ +#{"tuple" => {1,2}}
│ │ │ │ +2> #{"tuple" := {1,B}} = M.
│ │ │ │ +#{"tuple" => {1,2}}
│ │ │ │  3> B.
│ │ │ │ -2.

This binds variable B to integer 2.

Similarly, multiple values from the map can be matched:

#{K1 := V1, ..., Kn := Vn} = M

Here keys K1 through Kn are any expressions with literals or bound │ │ │ │ +2.

This binds variable B to integer 2.

Similarly, multiple values from the map can be matched:

#{K1 := V1, ..., Kn := Vn} = M

Here keys K1 through Kn are any expressions with literals or bound │ │ │ │ variables. If all key expressions evaluate successfully and all keys │ │ │ │ exist in map M, all variables in V1 .. Vn is matched to the │ │ │ │ associated values of their respective keys.

If the matching conditions are not met the match fails.

Note that when matching a map, only the := operator (not the =>) is allowed │ │ │ │ as a delimiter for the associations.

The order in which keys are declared in matching has no relevance.

Duplicate keys are allowed in matching and match each pattern associated to the │ │ │ │ -keys:

#{K := V1, K := V2} = M

The empty map literal (#{}) matches any map when used as a pattern:

#{} = Expr

This expression matches if the expression Expr is of type map, otherwise it │ │ │ │ -fails with an exception badmatch.

Here the key to be retrieved is constructed from an expression:

#{{tag,length(List)} := V} = Map

List must be an already bound variable.

Matching Syntax

Matching of literals as keys are allowed in function heads:

%% only start if not_started
│ │ │ │ -handle_call(start, From, #{state := not_started} = S) ->
│ │ │ │ +keys:

#{K := V1, K := V2} = M

The empty map literal (#{}) matches any map when used as a pattern:

#{} = Expr

This expression matches if the expression Expr is of type map, otherwise it │ │ │ │ +fails with an exception badmatch.

Here the key to be retrieved is constructed from an expression:

#{{tag,length(List)} := V} = Map

List must be an already bound variable.

Matching Syntax

Matching of literals as keys are allowed in function heads:

%% only start if not_started
│ │ │ │ +handle_call(start, From, #{state := not_started} = S) ->
│ │ │ │  ...
│ │ │ │ -    {reply, ok, S#{state := start}};
│ │ │ │ +    {reply, ok, S#{state := start}};
│ │ │ │  
│ │ │ │  %% only change if started
│ │ │ │ -handle_call(change, From, #{state := start} = S) ->
│ │ │ │ +handle_call(change, From, #{state := start} = S) ->
│ │ │ │  ...
│ │ │ │ -    {reply, ok, S#{state := changed}};

│ │ │ │ + {reply, ok, S#{state := changed}};

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Maps in Guards │ │ │ │

│ │ │ │

Maps are allowed in guards as long as all subexpressions are valid guard │ │ │ │ expressions.

The following guard BIFs handle maps:

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Bit Syntax Expressions │ │ │ │

│ │ │ │

The bit syntax operates on bit strings. A bit string is a sequence of bits │ │ │ │ -ordered from the most significant bit to the least significant bit.

<<>>  % The empty bit string, zero length
│ │ │ │ -<<E1>>
│ │ │ │ -<<E1,...,En>>

Each element Ei specifies a segment of the bit string. The segments are │ │ │ │ +ordered from the most significant bit to the least significant bit.

<<>>  % The empty bit string, zero length
│ │ │ │ +<<E1>>
│ │ │ │ +<<E1,...,En>>

Each element Ei specifies a segment of the bit string. The segments are │ │ │ │ ordered left to right from the most significant bit to the least significant bit │ │ │ │ of the bit string.

Each segment specification Ei is a value, whose default type is integer, │ │ │ │ followed by an optional size expression and an optional type specifier list.

Ei = Value |
│ │ │ │       Value:Size |
│ │ │ │       Value/TypeSpecifierList |
│ │ │ │       Value:Size/TypeSpecifierList

When used in a bit string construction, Value is an expression that is to │ │ │ │ evaluate to an integer, float, or bit string. If the expression is not a single │ │ │ │ @@ -703,34 +703,34 @@ │ │ │ │ guard expression that evaluates to an │ │ │ │ integer. All variables in the guard expression must be already bound.

Change

Before Erlang/OTP 23, Size was restricted to be an integer or a variable │ │ │ │ bound to an integer.

The value of Size specifies the size of the segment in units (see below). The │ │ │ │ default value depends on the type (see below):

  • For integer it is 8.
  • For float it is 64.
  • For binary and bitstring it is the whole binary or bit string.

In matching, the default value for a binary or bit string segment is only valid │ │ │ │ for the last element. All other bit string or binary elements in the matching │ │ │ │ must have a size specification.

Binaries

A bit string with a length that is a multiple of 8 bits is known as a binary, │ │ │ │ which is the most common and useful type of bit string.

A binary has a canonical representation in memory. Here follows a sequence of │ │ │ │ -bytes where each byte's value is its sequence number:

<<1, 2, 3, 4, 5, 6, 7, 8, 9, 10>>

Bit strings are a later generalization of binaries, so many texts and much │ │ │ │ -information about binaries apply just as well for bit strings.

Example:

1> <<A/binary, B/binary>> = <<"abcde">>.
│ │ │ │ +bytes where each byte's value is its sequence number:

<<1, 2, 3, 4, 5, 6, 7, 8, 9, 10>>

Bit strings are a later generalization of binaries, so many texts and much │ │ │ │ +information about binaries apply just as well for bit strings.

Example:

1> <<A/binary, B/binary>> = <<"abcde">>.
│ │ │ │  * 1:3: a binary field without size is only allowed at the end of a binary pattern
│ │ │ │ -2> <<A:3/binary, B/binary>> = <<"abcde">>.
│ │ │ │ -<<"abcde">>
│ │ │ │ +2> <<A:3/binary, B/binary>> = <<"abcde">>.
│ │ │ │ +<<"abcde">>
│ │ │ │  3> A.
│ │ │ │ -<<"abc">>
│ │ │ │ +<<"abc">>
│ │ │ │  4> B.
│ │ │ │ -<<"de">>

For the utf8, utf16, and utf32 types, Size must not be given. The size │ │ │ │ +<<"de">>

For the utf8, utf16, and utf32 types, Size must not be given. The size │ │ │ │ of the segment is implicitly determined by the type and value itself.

TypeSpecifierList is a list of type specifiers, in any order, separated by │ │ │ │ hyphens (-). Default values are used for any omitted type specifiers.

  • Type= integer | float | binary | bytes | bitstring | bits | │ │ │ │ utf8 | utf16 | utf32 - The default is integer. bytes is a │ │ │ │ shorthand for binary and bits is a shorthand for bitstring. See below │ │ │ │ for more information about the utf types.

  • Signedness= signed | unsigned - Only matters for matching and when │ │ │ │ the type is integer. The default is unsigned.

  • Endianness= big | little | native - Specifies byte level (octet │ │ │ │ level) endianness (byte order). Native-endian means that the endianness is │ │ │ │ resolved at load time to be either big-endian or little-endian, depending on │ │ │ │ what is native for the CPU that the Erlang machine is run on. Endianness only │ │ │ │ matters when the Type is either integer, utf16, utf32, or float. The │ │ │ │ -default is big.

    <<16#1234:16/little>> = <<16#3412:16>> = <<16#34:8, 16#12:8>>
  • Unit= unit:IntegerLiteral - The allowed range is 1 through 256. │ │ │ │ +default is big.

    <<16#1234:16/little>> = <<16#3412:16>> = <<16#34:8, 16#12:8>>
  • Unit= unit:IntegerLiteral - The allowed range is 1 through 256. │ │ │ │ Defaults to 1 for integer, float, and bitstring, and to 8 for binary. │ │ │ │ For types bitstring, bits, and bytes, it is not allowed to specify a │ │ │ │ unit value different from the default value. No unit specifier must be given │ │ │ │ for the types utf8, utf16, and utf32.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -755,41 +755,41 @@ │ │ │ │ │ │ │ │ Binary segments │ │ │ │

│ │ │ │

In this section, the phrase "binary segment" refers to any one of the segment │ │ │ │ types binary, bitstring, bytes, and bits.

See also the paragraphs about Binaries.

When constructing binaries and no size is specified for a binary segment, the │ │ │ │ entire binary value is interpolated into the binary being constructed. However, │ │ │ │ the size in bits of the binary being interpolated must be evenly divisible by │ │ │ │ -the unit value for the segment; otherwise an exception is raised.

For example, the following examples all succeed:

1> <<(<<"abc">>)/bitstring>>.
│ │ │ │ -<<"abc">>
│ │ │ │ -2> <<(<<"abc">>)/binary-unit:1>>.
│ │ │ │ -<<"abc">>
│ │ │ │ -3> <<(<<"abc">>)/binary>>.
│ │ │ │ -<<"abc">>

The first two examples have a unit value of 1 for the segment, while the third │ │ │ │ +the unit value for the segment; otherwise an exception is raised.

For example, the following examples all succeed:

1> <<(<<"abc">>)/bitstring>>.
│ │ │ │ +<<"abc">>
│ │ │ │ +2> <<(<<"abc">>)/binary-unit:1>>.
│ │ │ │ +<<"abc">>
│ │ │ │ +3> <<(<<"abc">>)/binary>>.
│ │ │ │ +<<"abc">>

The first two examples have a unit value of 1 for the segment, while the third │ │ │ │ segment has a unit value of 8.

Attempting to interpolate a bit string of size 1 into a binary segment with unit │ │ │ │ -8 (the default unit for binary) fails as shown in this example:

1> <<(<<1:1>>)/binary>>.
│ │ │ │ -** exception error: bad argument

For the construction to succeed, the unit value of the segment must be 1:

2> <<(<<1:1>>)/bitstring>>.
│ │ │ │ -<<1:1>>
│ │ │ │ -3> <<(<<1:1>>)/binary-unit:1>>.
│ │ │ │ -<<1:1>>

Similarly, when matching a binary segment with no size specified, the match │ │ │ │ +8 (the default unit for binary) fails as shown in this example:

1> <<(<<1:1>>)/binary>>.
│ │ │ │ +** exception error: bad argument

For the construction to succeed, the unit value of the segment must be 1:

2> <<(<<1:1>>)/bitstring>>.
│ │ │ │ +<<1:1>>
│ │ │ │ +3> <<(<<1:1>>)/binary-unit:1>>.
│ │ │ │ +<<1:1>>

Similarly, when matching a binary segment with no size specified, the match │ │ │ │ succeeds if and only if the size in bits of the rest of the binary is evenly │ │ │ │ -divisible by the unit value:

1> <<_/binary-unit:16>> = <<"">>.
│ │ │ │ -<<>>
│ │ │ │ -2> <<_/binary-unit:16>> = <<"a">>.
│ │ │ │ +divisible by the unit value:

1> <<_/binary-unit:16>> = <<"">>.
│ │ │ │ +<<>>
│ │ │ │ +2> <<_/binary-unit:16>> = <<"a">>.
│ │ │ │  ** exception error: no match of right hand side value <<"a">>
│ │ │ │ -3> <<_/binary-unit:16>> = <<"ab">>.
│ │ │ │ -<<"ab">>
│ │ │ │ -4> <<_/binary-unit:16>> = <<"abc">>.
│ │ │ │ +3> <<_/binary-unit:16>> = <<"ab">>.
│ │ │ │ +<<"ab">>
│ │ │ │ +4> <<_/binary-unit:16>> = <<"abc">>.
│ │ │ │  ** exception error: no match of right hand side value <<"abc">>
│ │ │ │ -5> <<_/binary-unit:16>> = <<"abcd">>.
│ │ │ │ -<<"abcd">>

When a size is explicitly specified for a binary segment, the segment size in │ │ │ │ +5> <<_/binary-unit:16>> = <<"abcd">>. │ │ │ │ +<<"abcd">>

When a size is explicitly specified for a binary segment, the segment size in │ │ │ │ bits is the value of Size multiplied by the default or explicit unit value.

When constructing binaries, the size of the binary being interpolated into the │ │ │ │ -constructed binary must be at least as large as the size of the binary segment.

Examples:

1> <<(<<"abc">>):2/binary>>.
│ │ │ │ -<<"ab">>
│ │ │ │ -2> <<(<<"a">>):2/binary>>.
│ │ │ │ +constructed binary must be at least as large as the size of the binary segment.

Examples:

1> <<(<<"abc">>):2/binary>>.
│ │ │ │ +<<"ab">>
│ │ │ │ +2> <<(<<"a">>):2/binary>>.
│ │ │ │  ** exception error: construction of binary failed
│ │ │ │          *** segment 1 of type 'binary': the value <<"a">> is shorter than the size of the segment

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Unicode segments │ │ │ │

│ │ │ │ @@ -805,78 +805,78 @@ │ │ │ │ range 0 through 16#D7FF or 16#E000 through 16#10FFFF. The match fails if the │ │ │ │ returned value falls outside those ranges.

A segment of type utf8 matches 1-4 bytes in the bit string, if the bit string │ │ │ │ at the match position contains a valid UTF-8 sequence. (See RFC-3629 or the │ │ │ │ Unicode standard.)

A segment of type utf16 can match 2 or 4 bytes in the bit string. The match │ │ │ │ fails if the bit string at the match position does not contain a legal UTF-16 │ │ │ │ encoding of a Unicode code point. (See RFC-2781 or the Unicode standard.)

A segment of type utf32 can match 4 bytes in the bit string in the same way as │ │ │ │ an integer segment matches 32 bits. The match fails if the resulting integer │ │ │ │ -is outside the legal ranges previously mentioned.

Examples:

1> Bin1 = <<1,17,42>>.
│ │ │ │ -<<1,17,42>>
│ │ │ │ -2> Bin2 = <<"abc">>.
│ │ │ │ -<<97,98,99>>
│ │ │ │ +is outside the legal ranges previously mentioned.

Examples:

1> Bin1 = <<1,17,42>>.
│ │ │ │ +<<1,17,42>>
│ │ │ │ +2> Bin2 = <<"abc">>.
│ │ │ │ +<<97,98,99>>
│ │ │ │  
│ │ │ │ -3> Bin3 = <<1,17,42:16>>.
│ │ │ │ -<<1,17,0,42>>
│ │ │ │ -4> <<A,B,C:16>> = <<1,17,42:16>>.
│ │ │ │ -<<1,17,0,42>>
│ │ │ │ +3> Bin3 = <<1,17,42:16>>.
│ │ │ │ +<<1,17,0,42>>
│ │ │ │ +4> <<A,B,C:16>> = <<1,17,42:16>>.
│ │ │ │ +<<1,17,0,42>>
│ │ │ │  5> C.
│ │ │ │  42
│ │ │ │ -6> <<D:16,E,F>> = <<1,17,42:16>>.
│ │ │ │ -<<1,17,0,42>>
│ │ │ │ +6> <<D:16,E,F>> = <<1,17,42:16>>.
│ │ │ │ +<<1,17,0,42>>
│ │ │ │  7> D.
│ │ │ │  273
│ │ │ │  8> F.
│ │ │ │  42
│ │ │ │ -9> <<G,H/binary>> = <<1,17,42:16>>.
│ │ │ │ -<<1,17,0,42>>
│ │ │ │ +9> <<G,H/binary>> = <<1,17,42:16>>.
│ │ │ │ +<<1,17,0,42>>
│ │ │ │  10> H.
│ │ │ │ -<<17,0,42>>
│ │ │ │ -11> <<G,J/bitstring>> = <<1,17,42:12>>.
│ │ │ │ -<<1,17,2,10:4>>
│ │ │ │ +<<17,0,42>>
│ │ │ │ +11> <<G,J/bitstring>> = <<1,17,42:12>>.
│ │ │ │ +<<1,17,2,10:4>>
│ │ │ │  12> J.
│ │ │ │ -<<17,2,10:4>>
│ │ │ │ +<<17,2,10:4>>
│ │ │ │  
│ │ │ │ -13> <<1024/utf8>>.
│ │ │ │ -<<208,128>>
│ │ │ │ +13> <<1024/utf8>>.
│ │ │ │ +<<208,128>>
│ │ │ │  
│ │ │ │ -14> <<1:1,0:7>>.
│ │ │ │ -<<128>>
│ │ │ │ -15> <<16#123:12/little>> = <<16#231:12>> = <<2:4, 3:4, 1:4>>.
│ │ │ │ -<<35,1:4>>

Notice that bit string patterns cannot be nested.

Notice also that "B=<<1>>" is interpreted as "B =< <1>>" which is a syntax │ │ │ │ +14> <<1:1,0:7>>. │ │ │ │ +<<128>> │ │ │ │ +15> <<16#123:12/little>> = <<16#231:12>> = <<2:4, 3:4, 1:4>>. │ │ │ │ +<<35,1:4>>

Notice that bit string patterns cannot be nested.

Notice also that "B=<<1>>" is interpreted as "B =< <1>>" which is a syntax │ │ │ │ error. The correct way is to write a space after =: "B = <<1>>.

More examples are provided in Programming Examples.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Fun Expressions │ │ │ │

│ │ │ │
fun
│ │ │ │ -    [Name](Pattern11,...,Pattern1N) [when GuardSeq1] ->
│ │ │ │ +    [Name](Pattern11,...,Pattern1N) [when GuardSeq1] ->
│ │ │ │                Body1;
│ │ │ │      ...;
│ │ │ │ -    [Name](PatternK1,...,PatternKN) [when GuardSeqK] ->
│ │ │ │ +    [Name](PatternK1,...,PatternKN) [when GuardSeqK] ->
│ │ │ │                BodyK
│ │ │ │  end

A fun expression begins with the keyword fun and ends with the keyword end. │ │ │ │ Between them is to be a function declaration, similar to a │ │ │ │ regular function declaration, │ │ │ │ except that the function name is optional and is to be a variable, if any.

Variables in a fun head shadow the function name and both shadow variables in │ │ │ │ the function clause surrounding the fun expression. Variables bound in a fun │ │ │ │ -body are local to the fun body.

The return value of the expression is the resulting fun.

Examples:

1> Fun1 = fun (X) -> X+1 end.
│ │ │ │ +body are local to the fun body.

The return value of the expression is the resulting fun.

Examples:

1> Fun1 = fun (X) -> X+1 end.
│ │ │ │  #Fun<erl_eval.6.39074546>
│ │ │ │ -2> Fun1(2).
│ │ │ │ +2> Fun1(2).
│ │ │ │  3
│ │ │ │ -3> Fun2 = fun (X) when X>=5 -> gt; (X) -> lt end.
│ │ │ │ +3> Fun2 = fun (X) when X>=5 -> gt; (X) -> lt end.
│ │ │ │  #Fun<erl_eval.6.39074546>
│ │ │ │ -4> Fun2(7).
│ │ │ │ +4> Fun2(7).
│ │ │ │  gt
│ │ │ │ -5> Fun3 = fun Fact(1) -> 1; Fact(X) when X > 1 -> X * Fact(X - 1) end.
│ │ │ │ +5> Fun3 = fun Fact(1) -> 1; Fact(X) when X > 1 -> X * Fact(X - 1) end.
│ │ │ │  #Fun<erl_eval.6.39074546>
│ │ │ │ -6> Fun3(4).
│ │ │ │ +6> Fun3(4).
│ │ │ │  24

The following fun expressions are also allowed:

fun Name/Arity
│ │ │ │  fun Module:Name/Arity

In Name/Arity, Name is an atom and Arity is an integer. Name/Arity must │ │ │ │ -specify an existing local function. The expression is syntactic sugar for:

fun (Arg1,...,ArgN) -> Name(Arg1,...,ArgN) end

In Module:Name/Arity, Module, and Name are atoms and Arity is an │ │ │ │ +specify an existing local function. The expression is syntactic sugar for:

fun (Arg1,...,ArgN) -> Name(Arg1,...,ArgN) end

In Module:Name/Arity, Module, and Name are atoms and Arity is an │ │ │ │ integer. Module, Name, and Arity can also be variables. A fun defined in │ │ │ │ this way refers to the function Name with arity Arity in the latest │ │ │ │ version of module Module. A fun defined in this way is not dependent on the │ │ │ │ code for the module in which it is defined.

Change

Before Erlang/OTP R15, Module, Name, and Arity were not allowed to be │ │ │ │ variables.

More examples are provided in Programming Examples.

│ │ │ │ │ │ │ │ │ │ │ │ @@ -886,35 +886,35 @@ │ │ │ │
catch Expr

Returns the value of Expr unless an exception is raised during the evaluation. In │ │ │ │ that case, the exception is caught. The return value depends on the class of the │ │ │ │ exception:

Reason depends on the type of error that occurred, and Stack is the stack of │ │ │ │ recent function calls, see Exit Reasons.

Examples:

1> catch 1+2.
│ │ │ │  3
│ │ │ │  2> catch 1+a.
│ │ │ │ -{'EXIT',{badarith,[...]}}

The BIF throw(Any) can be used for non-local return from a │ │ │ │ -function. It must be evaluated within a catch, which returns the value Any.

Example:

3> catch throw(hello).
│ │ │ │ +{'EXIT',{badarith,[...]}}

The BIF throw(Any) can be used for non-local return from a │ │ │ │ +function. It must be evaluated within a catch, which returns the value Any.

Example:

3> catch throw(hello).
│ │ │ │  hello

If throw/1 is not evaluated within a catch, a nocatch run-time │ │ │ │ error occurs.

Change

Before Erlang/OTP 24, the catch operator had the lowest precedence, making │ │ │ │ -it necessary to add parentheses when combining it with the match operator:

1> A = (catch 42).
│ │ │ │ +it necessary to add parentheses when combining it with the match operator:

1> A = (catch 42).
│ │ │ │  42
│ │ │ │  2> A.
│ │ │ │  42

Starting from Erlang/OTP 24, the parentheses can be omitted:

1> A = catch 42.
│ │ │ │  42
│ │ │ │  2> A.
│ │ │ │  42

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Try │ │ │ │

│ │ │ │
try Exprs
│ │ │ │  catch
│ │ │ │ -    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
│ │ │ │ +    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
│ │ │ │          ExceptionBody1;
│ │ │ │ -    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
│ │ │ │ +    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
│ │ │ │          ExceptionBodyN
│ │ │ │  end

This is an enhancement of catch. It gives the │ │ │ │ possibility to:

  • Distinguish between different exception classes.
  • Choose to handle only the desired ones.
  • Passing the others on to an enclosing try or catch, or to default error │ │ │ │ handling.

Notice that although the keyword catch is used in the try expression, there │ │ │ │ is not a catch expression within the try expression.

It returns the value of Exprs (a sequence of expressions Expr1, ..., ExprN) │ │ │ │ unless an exception occurs during the evaluation. In that case the exception is │ │ │ │ caught and the patterns ExceptionPattern with the right exception class │ │ │ │ @@ -924,47 +924,47 @@ │ │ │ │ stack trace is bound to the variable when the corresponding ExceptionPattern │ │ │ │ matches.

If an exception occurs during evaluation of Exprs but there is no matching │ │ │ │ ExceptionPattern of the right Class with a true guard sequence, the │ │ │ │ exception is passed on as if Exprs had not been enclosed in a try │ │ │ │ expression.

If an exception occurs during evaluation of ExceptionBody, it is not caught.

It is allowed to omit Class and Stacktrace. An omitted Class is shorthand │ │ │ │ for throw:

try Exprs
│ │ │ │  catch
│ │ │ │ -    ExceptionPattern1 [when ExceptionGuardSeq1] ->
│ │ │ │ +    ExceptionPattern1 [when ExceptionGuardSeq1] ->
│ │ │ │          ExceptionBody1;
│ │ │ │ -    ExceptionPatternN [when ExceptionGuardSeqN] ->
│ │ │ │ +    ExceptionPatternN [when ExceptionGuardSeqN] ->
│ │ │ │          ExceptionBodyN
│ │ │ │  end

The try expression can have an of section:

try Exprs of
│ │ │ │ -    Pattern1 [when GuardSeq1] ->
│ │ │ │ +    Pattern1 [when GuardSeq1] ->
│ │ │ │          Body1;
│ │ │ │      ...;
│ │ │ │ -    PatternN [when GuardSeqN] ->
│ │ │ │ +    PatternN [when GuardSeqN] ->
│ │ │ │          BodyN
│ │ │ │  catch
│ │ │ │ -    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
│ │ │ │ +    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
│ │ │ │          ExceptionBody1;
│ │ │ │      ...;
│ │ │ │ -    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
│ │ │ │ +    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
│ │ │ │          ExceptionBodyN
│ │ │ │  end

If the evaluation of Exprs succeeds without an exception, the patterns │ │ │ │ Pattern are sequentially matched against the result in the same way as for a │ │ │ │ case expression, except that if the matching fails, a │ │ │ │ try_clause run-time error occurs instead of a case_clause.

Only exceptions occurring during the evaluation of Exprs can be caught by the │ │ │ │ catch section. Exceptions occurring in a Body or due to a failed match are │ │ │ │ not caught.

The try expression can also be augmented with an after section, intended to │ │ │ │ be used for cleanup with side effects:

try Exprs of
│ │ │ │ -    Pattern1 [when GuardSeq1] ->
│ │ │ │ +    Pattern1 [when GuardSeq1] ->
│ │ │ │          Body1;
│ │ │ │      ...;
│ │ │ │ -    PatternN [when GuardSeqN] ->
│ │ │ │ +    PatternN [when GuardSeqN] ->
│ │ │ │          BodyN
│ │ │ │  catch
│ │ │ │ -    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
│ │ │ │ +    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
│ │ │ │          ExceptionBody1;
│ │ │ │      ...;
│ │ │ │ -    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
│ │ │ │ +    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
│ │ │ │          ExceptionBodyN
│ │ │ │  after
│ │ │ │      AfterBody
│ │ │ │  end

AfterBody is evaluated after either Body or ExceptionBody, no matter which │ │ │ │ one. The evaluated value of AfterBody is lost; the return value of the try │ │ │ │ expression is the same with an after section as without.

Even if an exception occurs during evaluation of Body or ExceptionBody, │ │ │ │ AfterBody is evaluated. In this case the exception is passed on after │ │ │ │ @@ -987,40 +987,40 @@ │ │ │ │ ExpressionBody │ │ │ │ after │ │ │ │ AfterBody │ │ │ │ end │ │ │ │ │ │ │ │ try Exprs after AfterBody end

Next is an example of using after. This closes the file, even in the event of │ │ │ │ exceptions in file:read/2 or in binary_to_term/1. The │ │ │ │ -exceptions are the same as without the try...after...end expression:

termize_file(Name) ->
│ │ │ │ -    {ok,F} = file:open(Name, [read,binary]),
│ │ │ │ +exceptions are the same as without the try...after...end expression:

termize_file(Name) ->
│ │ │ │ +    {ok,F} = file:open(Name, [read,binary]),
│ │ │ │      try
│ │ │ │ -        {ok,Bin} = file:read(F, 1024*1024),
│ │ │ │ -        binary_to_term(Bin)
│ │ │ │ +        {ok,Bin} = file:read(F, 1024*1024),
│ │ │ │ +        binary_to_term(Bin)
│ │ │ │      after
│ │ │ │ -        file:close(F)
│ │ │ │ +        file:close(F)
│ │ │ │      end.

Next is an example of using try to emulate catch Expr:

try Expr
│ │ │ │  catch
│ │ │ │      throw:Term -> Term;
│ │ │ │ -    exit:Reason -> {'EXIT',Reason};
│ │ │ │ -    error:Reason:Stk -> {'EXIT',{Reason,Stk}}
│ │ │ │ +    exit:Reason -> {'EXIT',Reason};
│ │ │ │ +    error:Reason:Stk -> {'EXIT',{Reason,Stk}}
│ │ │ │  end

Variables bound in the various parts of these expressions have different scopes. │ │ │ │ Variables bound just after the try keyword are:

  • bound in the of section
  • unsafe in both the catch and after sections, as well as after the whole │ │ │ │ construct

Variables bound in of section are:

  • unbound in the catch section
  • unsafe in both the after section, as well as after the whole construct

Variables bound in the catch section are unsafe in the after section, as │ │ │ │ well as after the whole construct.

Variables bound in the after section are unsafe after the whole construct.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Parenthesized Expressions │ │ │ │

│ │ │ │ -
(Expr)

Parenthesized expressions are useful to override │ │ │ │ +

(Expr)

Parenthesized expressions are useful to override │ │ │ │ operator precedences, for example, in arithmetic │ │ │ │ expressions:

1> 1 + 2 * 3.
│ │ │ │  7
│ │ │ │ -2> (1 + 2) * 3.
│ │ │ │ +2> (1 + 2) * 3.
│ │ │ │  9

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Block Expressions │ │ │ │

│ │ │ │
begin
│ │ │ │ @@ -1032,71 +1032,71 @@
│ │ │ │    
│ │ │ │      
│ │ │ │    
│ │ │ │    Comprehensions
│ │ │ │  

│ │ │ │

Comprehensions provide a succinct notation for iterating over one or more terms │ │ │ │ and constructing a new term. Comprehensions come in three different flavors, │ │ │ │ -depending on the type of term they build.

List comprehensions construct lists. They have the following syntax:

[Expr || Qualifier1, . . ., QualifierN]

Here, Expr is an arbitrary expression, and each Qualifier is either a │ │ │ │ +depending on the type of term they build.

List comprehensions construct lists. They have the following syntax:

[Expr || Qualifier1, . . ., QualifierN]

Here, Expr is an arbitrary expression, and each Qualifier is either a │ │ │ │ generator or a filter.

Bit string comprehensions construct bit strings or binaries. They have the │ │ │ │ -following syntax:

<< BitStringExpr || Qualifier1, . . ., QualifierN >>

BitStringExpr is an expression that evaluates to a bit string. If │ │ │ │ +following syntax:

<< BitStringExpr || Qualifier1, . . ., QualifierN >>

BitStringExpr is an expression that evaluates to a bit string. If │ │ │ │ BitStringExpr is a function call, it must be enclosed in parentheses. Each │ │ │ │ -Qualifier is either a generator or a filter.

Map comprehensions construct maps. They have the following syntax:

#{KeyExpr => ValueExpr || Qualifier1, . . ., QualifierN}

Here, KeyExpr and ValueExpr are arbitrary expressions, and each Qualifier │ │ │ │ +Qualifier is either a generator or a filter.

Map comprehensions construct maps. They have the following syntax:

#{KeyExpr => ValueExpr || Qualifier1, . . ., QualifierN}

Here, KeyExpr and ValueExpr are arbitrary expressions, and each Qualifier │ │ │ │ is either a generator or a filter.

Change

Map comprehensions and map generators were introduced in Erlang/OTP 26.

There are three kinds of generators.

A list generator has the following syntax:

Pattern <- ListExpr

where ListExpr is an expression that evaluates to a list of terms.

A bit string generator has the following syntax:

BitstringPattern <= BitStringExpr

where BitStringExpr is an expression that evaluates to a bit string.

A map generator has the following syntax:

KeyPattern := ValuePattern <- MapExpression

where MapExpr is an expression that evaluates to a map, or a map iterator │ │ │ │ obtained by calling maps:iterator/1 or maps:iterator/2.

A filter is an expression that evaluates to true or false.

The variables in the generator patterns shadow previously bound variables, │ │ │ │ including variables bound in a previous generator pattern.

Variables bound in a generator expression are not visible outside the │ │ │ │ -expression:

1> [{E,L} || E <- L=[1,2,3]].
│ │ │ │ +expression:

1> [{E,L} || E <- L=[1,2,3]].
│ │ │ │  * 1:5: variable 'L' is unbound

A list comprehension returns a list, where the list elements are the result │ │ │ │ of evaluating Expr for each combination of generator elements for which all │ │ │ │ filters are true.

A bit string comprehension returns a bit string, which is created by │ │ │ │ concatenating the results of evaluating BitStringExpr for each combination of │ │ │ │ bit string generator elements for which all filters are true.

A map comprehension returns a map, where the map elements are the result of │ │ │ │ evaluating KeyExpr and ValueExpr for each combination of generator elements │ │ │ │ for which all filters are true. If the key expressions are not unique, the last │ │ │ │ -occurrence is stored in the map.

Examples:

Multiplying each element in a list by two:

1> [X*2 || X <- [1,2,3]].
│ │ │ │ -[2,4,6]

Multiplying each byte in a binary by two, returning a list:

1> [X*2 || <<X>> <= <<1,2,3>>].
│ │ │ │ -[2,4,6]

Multiplying each byte in a binary by two:

1> << <<(X*2)>> || <<X>> <= <<1,2,3>> >>.
│ │ │ │ -<<2,4,6>>

Multiplying each element in a list by two, returning a binary:

1> << <<(X*2)>> || X <- [1,2,3] >>.
│ │ │ │ -<<2,4,6>>

Creating a mapping from an integer to its square:

1> #{X => X*X || X <- [1,2,3]}.
│ │ │ │ -#{1 => 1,2 => 4,3 => 9}

Multiplying the value of each element in a map by two:

1> #{K => 2*V || K := V <- #{a => 1,b => 2,c => 3}}.
│ │ │ │ -#{a => 2,b => 4,c => 6}

Filtering a list, keeping odd numbers:

1> [X || X <- [1,2,3,4,5], X rem 2 =:= 1].
│ │ │ │ -[1,3,5]

Filtering a list, keeping only elements that match:

1> [X || {_,_}=X <- [{a,b}, [a], {x,y,z}, {1,2}]].
│ │ │ │ -[{a,b},{1,2}]

Combining elements from two list generators:

1> [{P,Q} || P <- [a,b,c], Q <- [1,2]].
│ │ │ │ -[{a,1},{a,2},{b,1},{b,2},{c,1},{c,2}]

More examples are provided in │ │ │ │ +occurrence is stored in the map.

Examples:

Multiplying each element in a list by two:

1> [X*2 || X <- [1,2,3]].
│ │ │ │ +[2,4,6]

Multiplying each byte in a binary by two, returning a list:

1> [X*2 || <<X>> <= <<1,2,3>>].
│ │ │ │ +[2,4,6]

Multiplying each byte in a binary by two:

1> << <<(X*2)>> || <<X>> <= <<1,2,3>> >>.
│ │ │ │ +<<2,4,6>>

Multiplying each element in a list by two, returning a binary:

1> << <<(X*2)>> || X <- [1,2,3] >>.
│ │ │ │ +<<2,4,6>>

Creating a mapping from an integer to its square:

1> #{X => X*X || X <- [1,2,3]}.
│ │ │ │ +#{1 => 1,2 => 4,3 => 9}

Multiplying the value of each element in a map by two:

1> #{K => 2*V || K := V <- #{a => 1,b => 2,c => 3}}.
│ │ │ │ +#{a => 2,b => 4,c => 6}

Filtering a list, keeping odd numbers:

1> [X || X <- [1,2,3,4,5], X rem 2 =:= 1].
│ │ │ │ +[1,3,5]

Filtering a list, keeping only elements that match:

1> [X || {_,_}=X <- [{a,b}, [a], {x,y,z}, {1,2}]].
│ │ │ │ +[{a,b},{1,2}]

Combining elements from two list generators:

1> [{P,Q} || P <- [a,b,c], Q <- [1,2]].
│ │ │ │ +[{a,1},{a,2},{b,1},{b,2},{c,1},{c,2}]

More examples are provided in │ │ │ │ Programming Examples.

When there are no generators, a comprehension returns either a term constructed │ │ │ │ from a single element (the result of evaluating Expr) if all filters are true, │ │ │ │ or a term constructed from no elements (that is, [] for list comprehension, │ │ │ │ -<<>> for a bit string comprehension, and #{} for a map comprehension).

Example:

1> [2 || is_integer(2)].
│ │ │ │ -[2]
│ │ │ │ -2> [x || is_integer(x)].
│ │ │ │ -[]

What happens when the filter expression does not evaluate to a boolean value │ │ │ │ +<<>> for a bit string comprehension, and #{} for a map comprehension).

Example:

1> [2 || is_integer(2)].
│ │ │ │ +[2]
│ │ │ │ +2> [x || is_integer(x)].
│ │ │ │ +[]

What happens when the filter expression does not evaluate to a boolean value │ │ │ │ depends on the expression:

  • If the expression is a guard expression, │ │ │ │ failure to evaluate or evaluating to a non-boolean value is equivalent to │ │ │ │ evaluating to false.
  • If the expression is not a guard expression and evaluates to a non-Boolean │ │ │ │ value Val, an exception {bad_filter, Val} is triggered at runtime. If the │ │ │ │ evaluation of the expression raises an exception, it is not caught by the │ │ │ │ -comprehension.

Examples (using a guard expression as filter):

1> List = [1,2,a,b,c,3,4].
│ │ │ │ -[1,2,a,b,c,3,4]
│ │ │ │ -2> [E || E <- List, E rem 2].
│ │ │ │ -[]
│ │ │ │ -3> [E || E <- List, E rem 2 =:= 0].
│ │ │ │ -[2,4]

Examples (using a non-guard expression as filter):

1> List = [1,2,a,b,c,3,4].
│ │ │ │ -[1,2,a,b,c,3,4]
│ │ │ │ -2> FaultyIsEven = fun(E) -> E rem 2 end.
│ │ │ │ +comprehension.

Examples (using a guard expression as filter):

1> List = [1,2,a,b,c,3,4].
│ │ │ │ +[1,2,a,b,c,3,4]
│ │ │ │ +2> [E || E <- List, E rem 2].
│ │ │ │ +[]
│ │ │ │ +3> [E || E <- List, E rem 2 =:= 0].
│ │ │ │ +[2,4]

Examples (using a non-guard expression as filter):

1> List = [1,2,a,b,c,3,4].
│ │ │ │ +[1,2,a,b,c,3,4]
│ │ │ │ +2> FaultyIsEven = fun(E) -> E rem 2 end.
│ │ │ │  #Fun<erl_eval.42.17316486>
│ │ │ │ -3> [E || E <- List, FaultyIsEven(E)].
│ │ │ │ +3> [E || E <- List, FaultyIsEven(E)].
│ │ │ │  ** exception error: bad filter 1
│ │ │ │ -4> IsEven = fun(E) -> E rem 2 =:= 0 end.
│ │ │ │ +4> IsEven = fun(E) -> E rem 2 =:= 0 end.
│ │ │ │  #Fun<erl_eval.42.17316486>
│ │ │ │ -5> [E || E <- List, IsEven(E)].
│ │ │ │ +5> [E || E <- List, IsEven(E)].
│ │ │ │  ** exception error: an error occurred when evaluating an arithmetic expression
│ │ │ │       in operator  rem/2
│ │ │ │          called as a rem 2
│ │ │ │ -6> [E || E <- List, is_integer(E), IsEven(E)].
│ │ │ │ -[2,4]

│ │ │ │ +6> [E || E <- List, is_integer(E), IsEven(E)]. │ │ │ │ +[2,4]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Guard Sequences │ │ │ │

│ │ │ │

A guard sequence is a sequence of guards, separated by semicolon (;). The │ │ │ │ guard sequence is true if at least one of the guards is true. (The remaining │ │ │ ├── OEBPS/example.xhtml │ │ │ │ @@ -36,14 +36,14 @@ │ │ │ │ │ │ │ │ int bar(int y) { │ │ │ │ return y*2; │ │ │ │ }

The functions are deliberately kept as simple as possible, for readability │ │ │ │ reasons.

From an Erlang perspective, it is preferable to be able to call foo and bar │ │ │ │ without having to bother about that they are C functions:

% Erlang code
│ │ │ │  ...
│ │ │ │ -Res = complex:foo(X),
│ │ │ │ +Res = complex:foo(X),
│ │ │ │  ...

Here, the communication with C is hidden in the implementation of complex.erl. │ │ │ │ In the following sections, it is shown how this module can be implemented using │ │ │ │ the different interoperability mechanisms.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/events.xhtml │ │ │ │ @@ -40,43 +40,43 @@ │ │ │ │ event handler.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Example │ │ │ │

│ │ │ │

The callback module for the event handler writing error messages to the terminal │ │ │ │ -can look as follows:

-module(terminal_logger).
│ │ │ │ --behaviour(gen_event).
│ │ │ │ +can look as follows:

-module(terminal_logger).
│ │ │ │ +-behaviour(gen_event).
│ │ │ │  
│ │ │ │ --export([init/1, handle_event/2, terminate/2]).
│ │ │ │ +-export([init/1, handle_event/2, terminate/2]).
│ │ │ │  
│ │ │ │ -init(_Args) ->
│ │ │ │ -    {ok, []}.
│ │ │ │ +init(_Args) ->
│ │ │ │ +    {ok, []}.
│ │ │ │  
│ │ │ │ -handle_event(ErrorMsg, State) ->
│ │ │ │ -    io:format("***Error*** ~p~n", [ErrorMsg]),
│ │ │ │ -    {ok, State}.
│ │ │ │ +handle_event(ErrorMsg, State) ->
│ │ │ │ +    io:format("***Error*** ~p~n", [ErrorMsg]),
│ │ │ │ +    {ok, State}.
│ │ │ │  
│ │ │ │ -terminate(_Args, _State) ->
│ │ │ │ +terminate(_Args, _State) ->
│ │ │ │      ok.

The callback module for the event handler writing error messages to a file can │ │ │ │ -look as follows:

-module(file_logger).
│ │ │ │ --behaviour(gen_event).
│ │ │ │ +look as follows:

-module(file_logger).
│ │ │ │ +-behaviour(gen_event).
│ │ │ │  
│ │ │ │ --export([init/1, handle_event/2, terminate/2]).
│ │ │ │ +-export([init/1, handle_event/2, terminate/2]).
│ │ │ │  
│ │ │ │ -init(File) ->
│ │ │ │ -    {ok, Fd} = file:open(File, read),
│ │ │ │ -    {ok, Fd}.
│ │ │ │ -
│ │ │ │ -handle_event(ErrorMsg, Fd) ->
│ │ │ │ -    io:format(Fd, "***Error*** ~p~n", [ErrorMsg]),
│ │ │ │ -    {ok, Fd}.
│ │ │ │ +init(File) ->
│ │ │ │ +    {ok, Fd} = file:open(File, read),
│ │ │ │ +    {ok, Fd}.
│ │ │ │ +
│ │ │ │ +handle_event(ErrorMsg, Fd) ->
│ │ │ │ +    io:format(Fd, "***Error*** ~p~n", [ErrorMsg]),
│ │ │ │ +    {ok, Fd}.
│ │ │ │  
│ │ │ │ -terminate(_Args, Fd) ->
│ │ │ │ -    file:close(Fd).

The code is explained in the next sections.

│ │ │ │ +terminate(_Args, Fd) -> │ │ │ │ + file:close(Fd).

The code is explained in the next sections.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Starting an Event Manager │ │ │ │

│ │ │ │

To start an event manager for handling errors, as described in the previous │ │ │ │ example, call the following function:

gen_event:start_link({local, error_man})

gen_event:start_link/1 spawns and links to a new event manager process.

The argument, {local, error_man}, specifies the name under which the │ │ │ │ @@ -89,57 +89,57 @@ │ │ │ │ manager that is not part of a supervision tree.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Adding an Event Handler │ │ │ │

│ │ │ │

The following example shows how to start an event manager and add an event │ │ │ │ -handler to it by using the shell:

1> gen_event:start({local, error_man}).
│ │ │ │ -{ok,<0.31.0>}
│ │ │ │ -2> gen_event:add_handler(error_man, terminal_logger, []).
│ │ │ │ +handler to it by using the shell:

1> gen_event:start({local, error_man}).
│ │ │ │ +{ok,<0.31.0>}
│ │ │ │ +2> gen_event:add_handler(error_man, terminal_logger, []).
│ │ │ │  ok

This function sends a message to the event manager registered as error_man, │ │ │ │ telling it to add the event handler terminal_logger. The event manager calls │ │ │ │ the callback function terminal_logger:init([]), where the argument [] is the │ │ │ │ third argument to add_handler. init/1 is expected to return {ok, State}, │ │ │ │ -where State is the internal state of the event handler.

init(_Args) ->
│ │ │ │ -    {ok, []}.

Here, init/1 does not need any input data and ignores its argument. For │ │ │ │ +where State is the internal state of the event handler.

init(_Args) ->
│ │ │ │ +    {ok, []}.

Here, init/1 does not need any input data and ignores its argument. For │ │ │ │ terminal_logger, the internal state is not used. For file_logger, the │ │ │ │ -internal state is used to save the open file descriptor.

init(File) ->
│ │ │ │ -    {ok, Fd} = file:open(File, read),
│ │ │ │ -    {ok, Fd}.

│ │ │ │ +internal state is used to save the open file descriptor.

init(File) ->
│ │ │ │ +    {ok, Fd} = file:open(File, read),
│ │ │ │ +    {ok, Fd}.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Notifying about Events │ │ │ │

│ │ │ │
3> gen_event:notify(error_man, no_reply).
│ │ │ │  ***Error*** no_reply
│ │ │ │  ok

error_man is the name of the event manager and no_reply is the event.

The event is made into a message and sent to the event manager. When the event │ │ │ │ is received, the event manager calls handle_event(Event, State) for each │ │ │ │ installed event handler, in the same order as they were added. The function is │ │ │ │ expected to return a tuple {ok,State1}, where State1 is a new value for the │ │ │ │ -state of the event handler.

In terminal_logger:

handle_event(ErrorMsg, State) ->
│ │ │ │ -    io:format("***Error*** ~p~n", [ErrorMsg]),
│ │ │ │ -    {ok, State}.

In file_logger:

handle_event(ErrorMsg, Fd) ->
│ │ │ │ -    io:format(Fd, "***Error*** ~p~n", [ErrorMsg]),
│ │ │ │ -    {ok, Fd}.

│ │ │ │ +state of the event handler.

In terminal_logger:

handle_event(ErrorMsg, State) ->
│ │ │ │ +    io:format("***Error*** ~p~n", [ErrorMsg]),
│ │ │ │ +    {ok, State}.

In file_logger:

handle_event(ErrorMsg, Fd) ->
│ │ │ │ +    io:format(Fd, "***Error*** ~p~n", [ErrorMsg]),
│ │ │ │ +    {ok, Fd}.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Deleting an Event Handler │ │ │ │

│ │ │ │ -
4> gen_event:delete_handler(error_man, terminal_logger, []).
│ │ │ │ +
4> gen_event:delete_handler(error_man, terminal_logger, []).
│ │ │ │  ok

This function sends a message to the event manager registered as error_man, │ │ │ │ telling it to delete the event handler terminal_logger. The event manager │ │ │ │ calls the callback function terminal_logger:terminate([], State), where the │ │ │ │ argument [] is the third argument to delete_handler. terminate/2 is to be │ │ │ │ the opposite of init/1 and do any necessary cleaning up. Its return value is │ │ │ │ -ignored.

For terminal_logger, no cleaning up is necessary:

terminate(_Args, _State) ->
│ │ │ │ -    ok.

For file_logger, the file descriptor opened in init must be closed:

terminate(_Args, Fd) ->
│ │ │ │ -    file:close(Fd).

│ │ │ │ +ignored.

For terminal_logger, no cleaning up is necessary:

terminate(_Args, _State) ->
│ │ │ │ +    ok.

For file_logger, the file descriptor opened in init must be closed:

terminate(_Args, Fd) ->
│ │ │ │ +    file:close(Fd).

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Stopping │ │ │ │

│ │ │ │

When an event manager is stopped, it gives each of the installed event handlers │ │ │ │ the chance to clean up by calling terminate/2, the same way as when deleting a │ │ │ │ @@ -154,29 +154,29 @@ │ │ │ │ this is done is defined by a shutdown strategy set in │ │ │ │ the supervisor.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Standalone Event Managers │ │ │ │

│ │ │ │ -

An event manager can also be stopped by calling:

1> gen_event:stop(error_man).
│ │ │ │ +

An event manager can also be stopped by calling:

1> gen_event:stop(error_man).
│ │ │ │  ok

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Handling Other Messages │ │ │ │

│ │ │ │

If the gen_event process is to be able to receive other messages │ │ │ │ than events, the callback function handle_info(Info, State) must be │ │ │ │ implemented to handle them. Examples of other messages are exit │ │ │ │ messages if the event manager is linked to other processes than the │ │ │ │ supervisor (for example via gen_event:add_sup_handler/3) and is │ │ │ │ -trapping exit signals.

handle_info({'EXIT', Pid, Reason}, State) ->
│ │ │ │ +trapping exit signals.

handle_info({'EXIT', Pid, Reason}, State) ->
│ │ │ │      %% Code to handle exits here.
│ │ │ │      ...
│ │ │ │ -    {noreply, State1}.

The final function to implement is code_change/3:

code_change(OldVsn, State, Extra) ->
│ │ │ │ +    {noreply, State1}.

The final function to implement is code_change/3:

code_change(OldVsn, State, Extra) ->
│ │ │ │      %% Code to convert state (and more) during code change.
│ │ │ │      ...
│ │ │ │ -    {ok, NewState}.
│ │ │ │ +
{ok, NewState}.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/errors.xhtml │ │ │ │ @@ -56,22 +56,22 @@ │ │ │ │ classes, with different origins. The try expression can │ │ │ │ distinguish between the different classes, whereas the │ │ │ │ catch expression cannot. try and catch are described │ │ │ │ in Expressions.

ClassOrigin
errorRun-time error, for example, 1+a, or the process called error/1
exitThe process called exit/1
throwThe process called throw/1

Table: Exception Classes.

All of the above exceptions can also be generated by calling erlang:raise/3.

An exception consists of its class, an exit reason (see │ │ │ │ Exit Reason), and a stack trace (which aids in finding │ │ │ │ the code location of the exception).

The stack trace can be bound to a variable from within a try expression for │ │ │ │ any exception class, or as part of the exit reason when a run-time error is │ │ │ │ -caught by a catch. Example:

> {'EXIT',{test,Stacktrace}} = (catch error(test)), Stacktrace.
│ │ │ │ -[{shell,apply_fun,3,[]},
│ │ │ │ - {erl_eval,do_apply,6,[]},
│ │ │ │ - ...]
│ │ │ │ -> try throw(test) catch Class:Reason:Stacktrace -> Stacktrace end.
│ │ │ │ -[{shell,apply_fun,3,[]},
│ │ │ │ - {erl_eval,do_apply,6,[]},
│ │ │ │ - ...]

│ │ │ │ +caught by a catch. Example:

> {'EXIT',{test,Stacktrace}} = (catch error(test)), Stacktrace.
│ │ │ │ +[{shell,apply_fun,3,[]},
│ │ │ │ + {erl_eval,do_apply,6,[]},
│ │ │ │ + ...]
│ │ │ │ +> try throw(test) catch Class:Reason:Stacktrace -> Stacktrace end.
│ │ │ │ +[{shell,apply_fun,3,[]},
│ │ │ │ + {erl_eval,do_apply,6,[]},
│ │ │ │ + ...]

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ The call-stack back trace (stacktrace) │ │ │ │

│ │ │ │

The stack back-trace (stacktrace) is a list that │ │ │ │ contains {Module, Function, Arity, ExtraInfo} and/or {Fun, Arity, ExtraInfo} │ │ │ ├── OEBPS/error_logging.xhtml │ │ │ │ @@ -48,36 +48,36 @@ │ │ │ │ reports and other error and information reports are by default logged through │ │ │ │ the log handler which is set up when the Kernel application is started.

Prior to Erlang/OTP 21.0, supervisor, crash, and progress reports were only │ │ │ │ logged when the SASL application was running. This behaviour can, for backwards │ │ │ │ compatibility, be enabled by setting the Kernel configuration parameter │ │ │ │ logger_sasl_compatible to │ │ │ │ true. For more information, see │ │ │ │ SASL Error Logging in the SASL User's Guide.

% erl -kernel logger_level info
│ │ │ │ -Erlang/OTP 21 [erts-10.0] [source-13c50db] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
│ │ │ │ +Erlang/OTP 21 [erts-10.0] [source-13c50db] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
│ │ │ │  
│ │ │ │  =PROGRESS REPORT==== 8-Jun-2018::16:54:19.916404 ===
│ │ │ │      application: kernel
│ │ │ │      started_at: nonode@nohost
│ │ │ │  =PROGRESS REPORT==== 8-Jun-2018::16:54:19.922908 ===
│ │ │ │      application: stdlib
│ │ │ │      started_at: nonode@nohost
│ │ │ │  =PROGRESS REPORT==== 8-Jun-2018::16:54:19.925755 ===
│ │ │ │ -    supervisor: {local,kernel_safe_sup}
│ │ │ │ -    started: [{pid,<0.74.0>},
│ │ │ │ -              {id,disk_log_sup},
│ │ │ │ -              {mfargs,{disk_log_sup,start_link,[]}},
│ │ │ │ -              {restart_type,permanent},
│ │ │ │ -              {shutdown,1000},
│ │ │ │ -              {child_type,supervisor}]
│ │ │ │ +    supervisor: {local,kernel_safe_sup}
│ │ │ │ +    started: [{pid,<0.74.0>},
│ │ │ │ +              {id,disk_log_sup},
│ │ │ │ +              {mfargs,{disk_log_sup,start_link,[]}},
│ │ │ │ +              {restart_type,permanent},
│ │ │ │ +              {shutdown,1000},
│ │ │ │ +              {child_type,supervisor}]
│ │ │ │  =PROGRESS REPORT==== 8-Jun-2018::16:54:19.926056 ===
│ │ │ │ -    supervisor: {local,kernel_safe_sup}
│ │ │ │ -    started: [{pid,<0.75.0>},
│ │ │ │ -              {id,disk_log_server},
│ │ │ │ -              {mfargs,{disk_log_server,start_link,[]}},
│ │ │ │ -              {restart_type,permanent},
│ │ │ │ -              {shutdown,2000},
│ │ │ │ -              {child_type,worker}]
│ │ │ │ -Eshell V10.0  (abort with ^G)
│ │ │ │ +    supervisor: {local,kernel_safe_sup}
│ │ │ │ +    started: [{pid,<0.75.0>},
│ │ │ │ +              {id,disk_log_server},
│ │ │ │ +              {mfargs,{disk_log_server,start_link,[]}},
│ │ │ │ +              {restart_type,permanent},
│ │ │ │ +              {shutdown,2000},
│ │ │ │ +              {child_type,worker}]
│ │ │ │ +Eshell V10.0  (abort with ^G)
│ │ │ │  1>
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/erl_interface.xhtml │ │ │ │ @@ -25,119 +25,119 @@ │ │ │ │ to read the port example in Ports before reading this section.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Erlang Program │ │ │ │

│ │ │ │

The following example shows an Erlang program communicating with a C program │ │ │ │ -over a plain port with home made encoding:

-module(complex1).
│ │ │ │ --export([start/1, stop/0, init/1]).
│ │ │ │ --export([foo/1, bar/1]).
│ │ │ │ -
│ │ │ │ -start(ExtPrg) ->
│ │ │ │ -    spawn(?MODULE, init, [ExtPrg]).
│ │ │ │ -stop() ->
│ │ │ │ +over a plain port with home made encoding:

-module(complex1).
│ │ │ │ +-export([start/1, stop/0, init/1]).
│ │ │ │ +-export([foo/1, bar/1]).
│ │ │ │ +
│ │ │ │ +start(ExtPrg) ->
│ │ │ │ +    spawn(?MODULE, init, [ExtPrg]).
│ │ │ │ +stop() ->
│ │ │ │      complex ! stop.
│ │ │ │  
│ │ │ │ -foo(X) ->
│ │ │ │ -    call_port({foo, X}).
│ │ │ │ -bar(Y) ->
│ │ │ │ -    call_port({bar, Y}).
│ │ │ │ +foo(X) ->
│ │ │ │ +    call_port({foo, X}).
│ │ │ │ +bar(Y) ->
│ │ │ │ +    call_port({bar, Y}).
│ │ │ │  
│ │ │ │ -call_port(Msg) ->
│ │ │ │ -    complex ! {call, self(), Msg},
│ │ │ │ +call_port(Msg) ->
│ │ │ │ +    complex ! {call, self(), Msg},
│ │ │ │      receive
│ │ │ │ -	{complex, Result} ->
│ │ │ │ +	{complex, Result} ->
│ │ │ │  	    Result
│ │ │ │      end.
│ │ │ │  
│ │ │ │ -init(ExtPrg) ->
│ │ │ │ -    register(complex, self()),
│ │ │ │ -    process_flag(trap_exit, true),
│ │ │ │ -    Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
│ │ │ │ -    loop(Port).
│ │ │ │ +init(ExtPrg) ->
│ │ │ │ +    register(complex, self()),
│ │ │ │ +    process_flag(trap_exit, true),
│ │ │ │ +    Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
│ │ │ │ +    loop(Port).
│ │ │ │  
│ │ │ │ -loop(Port) ->
│ │ │ │ +loop(Port) ->
│ │ │ │      receive
│ │ │ │ -	{call, Caller, Msg} ->
│ │ │ │ -	    Port ! {self(), {command, encode(Msg)}},
│ │ │ │ +	{call, Caller, Msg} ->
│ │ │ │ +	    Port ! {self(), {command, encode(Msg)}},
│ │ │ │  	    receive
│ │ │ │ -		{Port, {data, Data}} ->
│ │ │ │ -		    Caller ! {complex, decode(Data)}
│ │ │ │ +		{Port, {data, Data}} ->
│ │ │ │ +		    Caller ! {complex, decode(Data)}
│ │ │ │  	    end,
│ │ │ │ -	    loop(Port);
│ │ │ │ +	    loop(Port);
│ │ │ │  	stop ->
│ │ │ │ -	    Port ! {self(), close},
│ │ │ │ +	    Port ! {self(), close},
│ │ │ │  	    receive
│ │ │ │ -		{Port, closed} ->
│ │ │ │ -		    exit(normal)
│ │ │ │ +		{Port, closed} ->
│ │ │ │ +		    exit(normal)
│ │ │ │  	    end;
│ │ │ │ -	{'EXIT', Port, Reason} ->
│ │ │ │ -	    exit(port_terminated)
│ │ │ │ +	{'EXIT', Port, Reason} ->
│ │ │ │ +	    exit(port_terminated)
│ │ │ │      end.
│ │ │ │  
│ │ │ │ -encode({foo, X}) -> [1, X];
│ │ │ │ -encode({bar, Y}) -> [2, Y].
│ │ │ │ +encode({foo, X}) -> [1, X];
│ │ │ │ +encode({bar, Y}) -> [2, Y].
│ │ │ │  
│ │ │ │ -decode([Int]) -> Int.

There are two differences when using Erl_Interface on the C side compared to the │ │ │ │ +decode([Int]) -> Int.

There are two differences when using Erl_Interface on the C side compared to the │ │ │ │ example in Ports, using only the plain port:

  • As Erl_Interface operates on the Erlang external term format, the port must be │ │ │ │ set to use binaries.
  • Instead of inventing an encoding/decoding scheme, the │ │ │ │ term_to_binary/1 and │ │ │ │ -binary_to_term/1 BIFs are to be used.

That is:

open_port({spawn, ExtPrg}, [{packet, 2}])

is replaced with:

open_port({spawn, ExtPrg}, [{packet, 2}, binary])

And:

Port ! {self(), {command, encode(Msg)}},
│ │ │ │ +binary_to_term/1 BIFs are to be used.

That is:

open_port({spawn, ExtPrg}, [{packet, 2}])

is replaced with:

open_port({spawn, ExtPrg}, [{packet, 2}, binary])

And:

Port ! {self(), {command, encode(Msg)}},
│ │ │ │  receive
│ │ │ │ -  {Port, {data, Data}} ->
│ │ │ │ -    Caller ! {complex, decode(Data)}
│ │ │ │ -end

is replaced with:

Port ! {self(), {command, term_to_binary(Msg)}},
│ │ │ │ +  {Port, {data, Data}} ->
│ │ │ │ +    Caller ! {complex, decode(Data)}
│ │ │ │ +end

is replaced with:

Port ! {self(), {command, term_to_binary(Msg)}},
│ │ │ │  receive
│ │ │ │ -  {Port, {data, Data}} ->
│ │ │ │ -    Caller ! {complex, binary_to_term(Data)}
│ │ │ │ -end

The resulting Erlang program is as follows:

-module(complex2).
│ │ │ │ --export([start/1, stop/0, init/1]).
│ │ │ │ --export([foo/1, bar/1]).
│ │ │ │ -
│ │ │ │ -start(ExtPrg) ->
│ │ │ │ -    spawn(?MODULE, init, [ExtPrg]).
│ │ │ │ -stop() ->
│ │ │ │ +  {Port, {data, Data}} ->
│ │ │ │ +    Caller ! {complex, binary_to_term(Data)}
│ │ │ │ +end

The resulting Erlang program is as follows:

-module(complex2).
│ │ │ │ +-export([start/1, stop/0, init/1]).
│ │ │ │ +-export([foo/1, bar/1]).
│ │ │ │ +
│ │ │ │ +start(ExtPrg) ->
│ │ │ │ +    spawn(?MODULE, init, [ExtPrg]).
│ │ │ │ +stop() ->
│ │ │ │      complex ! stop.
│ │ │ │  
│ │ │ │ -foo(X) ->
│ │ │ │ -    call_port({foo, X}).
│ │ │ │ -bar(Y) ->
│ │ │ │ -    call_port({bar, Y}).
│ │ │ │ +foo(X) ->
│ │ │ │ +    call_port({foo, X}).
│ │ │ │ +bar(Y) ->
│ │ │ │ +    call_port({bar, Y}).
│ │ │ │  
│ │ │ │ -call_port(Msg) ->
│ │ │ │ -    complex ! {call, self(), Msg},
│ │ │ │ +call_port(Msg) ->
│ │ │ │ +    complex ! {call, self(), Msg},
│ │ │ │      receive
│ │ │ │ -	{complex, Result} ->
│ │ │ │ +	{complex, Result} ->
│ │ │ │  	    Result
│ │ │ │      end.
│ │ │ │  
│ │ │ │ -init(ExtPrg) ->
│ │ │ │ -    register(complex, self()),
│ │ │ │ -    process_flag(trap_exit, true),
│ │ │ │ -    Port = open_port({spawn, ExtPrg}, [{packet, 2}, binary]),
│ │ │ │ -    loop(Port).
│ │ │ │ +init(ExtPrg) ->
│ │ │ │ +    register(complex, self()),
│ │ │ │ +    process_flag(trap_exit, true),
│ │ │ │ +    Port = open_port({spawn, ExtPrg}, [{packet, 2}, binary]),
│ │ │ │ +    loop(Port).
│ │ │ │  
│ │ │ │ -loop(Port) ->
│ │ │ │ +loop(Port) ->
│ │ │ │      receive
│ │ │ │ -	{call, Caller, Msg} ->
│ │ │ │ -	    Port ! {self(), {command, term_to_binary(Msg)}},
│ │ │ │ +	{call, Caller, Msg} ->
│ │ │ │ +	    Port ! {self(), {command, term_to_binary(Msg)}},
│ │ │ │  	    receive
│ │ │ │ -		{Port, {data, Data}} ->
│ │ │ │ -		    Caller ! {complex, binary_to_term(Data)}
│ │ │ │ +		{Port, {data, Data}} ->
│ │ │ │ +		    Caller ! {complex, binary_to_term(Data)}
│ │ │ │  	    end,
│ │ │ │ -	    loop(Port);
│ │ │ │ +	    loop(Port);
│ │ │ │  	stop ->
│ │ │ │ -	    Port ! {self(), close},
│ │ │ │ +	    Port ! {self(), close},
│ │ │ │  	    receive
│ │ │ │ -		{Port, closed} ->
│ │ │ │ -		    exit(normal)
│ │ │ │ +		{Port, closed} ->
│ │ │ │ +		    exit(normal)
│ │ │ │  	    end;
│ │ │ │ -	{'EXIT', Port, Reason} ->
│ │ │ │ -	    exit(port_terminated)
│ │ │ │ +	{'EXIT', Port, Reason} ->
│ │ │ │ +	    exit(port_terminated)
│ │ │ │      end.

Notice that calling complex2:foo/1 and complex2:bar/1 results in the tuple │ │ │ │ {foo,X} or {bar,Y} being sent to the complex process, which codes them as │ │ │ │ binaries and sends them to the port. This means that the C program must be able │ │ │ │ to handle these two tuples.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -267,24 +267,24 @@ │ │ │ │ -L/usr/local/otp/lib/erl_interface-3.9.2/lib \ │ │ │ │ complex.c erl_comm.c ei.c -lei -lpthread

In Erlang/OTP R5B and later versions of OTP, the include and lib directories │ │ │ │ are situated under $OTPROOT/lib/erl_interface-VSN, where $OTPROOT is the │ │ │ │ root directory of the OTP installation (/usr/local/otp in the recent example) │ │ │ │ and VSN is the version of the Erl_interface application (3.2.1 in the recent │ │ │ │ example).

In R4B and earlier versions of OTP, include and lib are situated under │ │ │ │ $OTPROOT/usr.

Step 2. Start Erlang and compile the Erlang code:

$ erl
│ │ │ │ -Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
│ │ │ │ +Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
│ │ │ │  
│ │ │ │ -Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
│ │ │ │ -1> c(complex2).
│ │ │ │ -{ok,complex2}

Step 3. Run the example:

2> complex2:start("./extprg").
│ │ │ │ +Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
│ │ │ │ +1> c(complex2).
│ │ │ │ +{ok,complex2}

Step 3. Run the example:

2> complex2:start("./extprg").
│ │ │ │  <0.34.0>
│ │ │ │ -3> complex2:foo(3).
│ │ │ │ +3> complex2:foo(3).
│ │ │ │  4
│ │ │ │ -4> complex2:bar(5).
│ │ │ │ +4> complex2:bar(5).
│ │ │ │  10
│ │ │ │ -5> complex2:bar(352).
│ │ │ │ +5> complex2:bar(352).
│ │ │ │  704
│ │ │ │ -6> complex2:stop().
│ │ │ │ +6> complex2:stop().
│ │ │ │  stop
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/eff_guide_processes.xhtml │ │ │ │ @@ -24,45 +24,45 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Creating an Erlang Process │ │ │ │

│ │ │ │

An Erlang process is lightweight compared to threads and processes in operating │ │ │ │ systems.

A newly spawned Erlang process uses 327 words of memory. The size can be found │ │ │ │ -as follows:

Erlang/OTP 27 [erts-14.2.3] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
│ │ │ │ +as follows:

Erlang/OTP 27 [erts-14.2.3] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
│ │ │ │  
│ │ │ │ -Eshell V14.2.3 (press Ctrl+G to abort, type help(). for help)
│ │ │ │ -1> Fun = fun() -> receive after infinity -> ok end end.
│ │ │ │ +Eshell V14.2.3 (press Ctrl+G to abort, type help(). for help)
│ │ │ │ +1> Fun = fun() -> receive after infinity -> ok end end.
│ │ │ │  #Fun<erl_eval.43.39164016>
│ │ │ │ -2> {_,Bytes} = process_info(spawn(Fun), memory).
│ │ │ │ -{memory,2616}
│ │ │ │ -3> Bytes div erlang:system_info(wordsize).
│ │ │ │ +2> {_,Bytes} = process_info(spawn(Fun), memory).
│ │ │ │ +{memory,2616}
│ │ │ │ +3> Bytes div erlang:system_info(wordsize).
│ │ │ │  327

The size includes 233 words for the heap area (which includes the stack). The │ │ │ │ garbage collector increases the heap as needed.

The main (outer) loop for a process must be tail-recursive. Otherwise, the │ │ │ │ -stack grows until the process terminates.

DO NOT

loop() ->
│ │ │ │ +stack grows until the process terminates.

DO NOT

loop() ->
│ │ │ │    receive
│ │ │ │ -     {sys, Msg} ->
│ │ │ │ -         handle_sys_msg(Msg),
│ │ │ │ -         loop();
│ │ │ │ -     {From, Msg} ->
│ │ │ │ -          Reply = handle_msg(Msg),
│ │ │ │ +     {sys, Msg} ->
│ │ │ │ +         handle_sys_msg(Msg),
│ │ │ │ +         loop();
│ │ │ │ +     {From, Msg} ->
│ │ │ │ +          Reply = handle_msg(Msg),
│ │ │ │            From ! Reply,
│ │ │ │ -          loop()
│ │ │ │ +          loop()
│ │ │ │    end,
│ │ │ │ -  io:format("Message is processed~n", []).

The call to io:format/2 will never be executed, but a return address will │ │ │ │ + io:format("Message is processed~n", []).

The call to io:format/2 will never be executed, but a return address will │ │ │ │ still be pushed to the stack each time loop/0 is called recursively. The │ │ │ │ -correct tail-recursive version of the function looks as follows:

DO

loop() ->
│ │ │ │ +correct tail-recursive version of the function looks as follows:

DO

loop() ->
│ │ │ │     receive
│ │ │ │ -      {sys, Msg} ->
│ │ │ │ -         handle_sys_msg(Msg),
│ │ │ │ -         loop();
│ │ │ │ -      {From, Msg} ->
│ │ │ │ -         Reply = handle_msg(Msg),
│ │ │ │ +      {sys, Msg} ->
│ │ │ │ +         handle_sys_msg(Msg),
│ │ │ │ +         loop();
│ │ │ │ +      {From, Msg} ->
│ │ │ │ +         Reply = handle_msg(Msg),
│ │ │ │           From ! Reply,
│ │ │ │ -         loop()
│ │ │ │ +         loop()
│ │ │ │   end.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Initial Heap Size │ │ │ │

│ │ │ │

The default initial heap size of 233 words is quite conservative to support │ │ │ │ @@ -94,30 +94,30 @@ │ │ │ │ │ │ │ │ │ │ │ │ Receiving messages │ │ │ │ │ │ │ │

The cost of receiving messages depends on how complicated the receive │ │ │ │ expression is. A simple expression that matches any message is very cheap │ │ │ │ because it retrieves the first message in the message queue:

DO

receive
│ │ │ │ -    Message -> handle_msg(Message)
│ │ │ │ +    Message -> handle_msg(Message)
│ │ │ │  end.

However, this is not always convenient: we can receive a message that we do not │ │ │ │ know how to handle at this point, so it is common to only match the messages we │ │ │ │ expect:

receive
│ │ │ │ -    {Tag, Message} -> handle_msg(Message)
│ │ │ │ +    {Tag, Message} -> handle_msg(Message)
│ │ │ │  end.

While this is convenient it means that the entire message queue must be searched │ │ │ │ until it finds a matching message. This is very expensive for processes with │ │ │ │ long message queues, so there is an optimization for the common case of │ │ │ │ -sending a request and waiting for a response shortly after:

DO

MRef = monitor(process, Process),
│ │ │ │ -Process ! {self(), MRef, Request},
│ │ │ │ +sending a request and waiting for a response shortly after:

DO

MRef = monitor(process, Process),
│ │ │ │ +Process ! {self(), MRef, Request},
│ │ │ │  receive
│ │ │ │ -    {MRef, Reply} ->
│ │ │ │ -        erlang:demonitor(MRef, [flush]),
│ │ │ │ -        handle_reply(Reply);
│ │ │ │ -    {'DOWN', MRef, _, _, Reason} ->
│ │ │ │ -        handle_error(Reason)
│ │ │ │ +    {MRef, Reply} ->
│ │ │ │ +        erlang:demonitor(MRef, [flush]),
│ │ │ │ +        handle_reply(Reply);
│ │ │ │ +    {'DOWN', MRef, _, _, Reason} ->
│ │ │ │ +        handle_error(Reason)
│ │ │ │  end.

Since the compiler knows that the reference created by │ │ │ │ monitor/2 cannot exist before the call (since it is a globally │ │ │ │ unique identifier), and that the receive only matches messages that contain │ │ │ │ said reference, it will tell the emulator to search only the messages that │ │ │ │ arrived after the call to monitor/2.

The above is a simple example where one is but guaranteed that the optimization │ │ │ │ will take, but what about more complicated code?

│ │ │ │ │ │ │ │ @@ -133,101 +133,101 @@ │ │ │ │ efficiency_guide.erl:200: Warning: NOT OPTIMIZED: all clauses do not match a suitable reference │ │ │ │ efficiency_guide.erl:206: Warning: OPTIMIZED: reference used to mark a message queue position │ │ │ │ efficiency_guide.erl:208: Warning: OPTIMIZED: all clauses match reference created by monitor/2 at efficiency_guide.erl:206 │ │ │ │ efficiency_guide.erl:219: Warning: INFO: passing reference created by make_ref/0 at efficiency_guide.erl:218 │ │ │ │ efficiency_guide.erl:222: Warning: OPTIMIZED: all clauses match reference in function parameter 1

To make it clearer exactly what code the warnings refer to, the warnings in the │ │ │ │ following examples are inserted as comments after the clause they refer to, for │ │ │ │ example:

%% DO
│ │ │ │ -simple_receive() ->
│ │ │ │ +simple_receive() ->
│ │ │ │  %% efficiency_guide.erl:194: Warning: INFO: not a selective receive, this is always fast
│ │ │ │  receive
│ │ │ │ -    Message -> handle_msg(Message)
│ │ │ │ +    Message -> handle_msg(Message)
│ │ │ │  end.
│ │ │ │  
│ │ │ │  %% DO NOT, unless Tag is known to be a suitable reference: see
│ │ │ │  %% cross_function_receive/0 further down.
│ │ │ │ -selective_receive(Tag, Message) ->
│ │ │ │ +selective_receive(Tag, Message) ->
│ │ │ │  %% efficiency_guide.erl:200: Warning: NOT OPTIMIZED: all clauses do not match a suitable reference
│ │ │ │  receive
│ │ │ │ -    {Tag, Message} -> handle_msg(Message)
│ │ │ │ +    {Tag, Message} -> handle_msg(Message)
│ │ │ │  end.
│ │ │ │  
│ │ │ │  %% DO
│ │ │ │ -optimized_receive(Process, Request) ->
│ │ │ │ +optimized_receive(Process, Request) ->
│ │ │ │  %% efficiency_guide.erl:206: Warning: OPTIMIZED: reference used to mark a message queue position
│ │ │ │ -    MRef = monitor(process, Process),
│ │ │ │ -    Process ! {self(), MRef, Request},
│ │ │ │ +    MRef = monitor(process, Process),
│ │ │ │ +    Process ! {self(), MRef, Request},
│ │ │ │      %% efficiency_guide.erl:208: Warning: OPTIMIZED: matches reference created by monitor/2 at efficiency_guide.erl:206
│ │ │ │      receive
│ │ │ │ -        {MRef, Reply} ->
│ │ │ │ -        erlang:demonitor(MRef, [flush]),
│ │ │ │ -        handle_reply(Reply);
│ │ │ │ -    {'DOWN', MRef, _, _, Reason} ->
│ │ │ │ -    handle_error(Reason)
│ │ │ │ +        {MRef, Reply} ->
│ │ │ │ +        erlang:demonitor(MRef, [flush]),
│ │ │ │ +        handle_reply(Reply);
│ │ │ │ +    {'DOWN', MRef, _, _, Reason} ->
│ │ │ │ +    handle_error(Reason)
│ │ │ │      end.
│ │ │ │  
│ │ │ │  %% DO
│ │ │ │ -cross_function_receive() ->
│ │ │ │ +cross_function_receive() ->
│ │ │ │      %% efficiency_guide.erl:218: Warning: OPTIMIZED: reference used to mark a message queue position
│ │ │ │ -    Ref = make_ref(),
│ │ │ │ +    Ref = make_ref(),
│ │ │ │      %% efficiency_guide.erl:219: Warning: INFO: passing reference created by make_ref/0 at efficiency_guide.erl:218
│ │ │ │ -    cross_function_receive(Ref).
│ │ │ │ +    cross_function_receive(Ref).
│ │ │ │  
│ │ │ │ -cross_function_receive(Ref) ->
│ │ │ │ +cross_function_receive(Ref) ->
│ │ │ │      %% efficiency_guide.erl:222: Warning: OPTIMIZED: all clauses match reference in function parameter 1
│ │ │ │      receive
│ │ │ │ -        {Ref, Message} -> handle_msg(Message)
│ │ │ │ +        {Ref, Message} -> handle_msg(Message)
│ │ │ │      end.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Literal Pool │ │ │ │

│ │ │ │

Constant Erlang terms (hereafter called literals) are kept in literal pools; │ │ │ │ each loaded module has its own pool. The following function does not build the │ │ │ │ tuple every time it is called (only to have it discarded the next time the │ │ │ │ garbage collector was run), but the tuple is located in the module's literal │ │ │ │ -pool:

DO

days_in_month(M) ->
│ │ │ │ -    element(M, {31,28,31,30,31,30,31,31,30,31,30,31}).

If a literal, or a term that contains a literal, is inserted into an Ets table, │ │ │ │ +pool:

DO

days_in_month(M) ->
│ │ │ │ +    element(M, {31,28,31,30,31,30,31,31,30,31,30,31}).

If a literal, or a term that contains a literal, is inserted into an Ets table, │ │ │ │ it is copied. The reason is that the module containing the literal can be │ │ │ │ unloaded in the future.

When a literal is sent to another process, it is not copied. When a module │ │ │ │ holding a literal is unloaded, the literal will be copied to the heap of all │ │ │ │ processes that hold references to that literal.

There also exists a global literal pool that is managed by the │ │ │ │ persistent_term module.

By default, 1 GB of virtual address space is reserved for all literal pools (in │ │ │ │ BEAM code and persistent terms). The amount of virtual address space reserved │ │ │ │ for literals can be changed by using the │ │ │ │ +MIscs option when starting the emulator.

Here is an example how the reserved virtual address space for literals can be │ │ │ │ raised to 2 GB (2048 MB):

erl +MIscs 2048

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loss of Sharing │ │ │ │

│ │ │ │ -

An Erlang term can have shared subterms. Here is a simple example:

{SubTerm, SubTerm}

Shared subterms are not preserved in the following cases:

  • When a term is sent to another process
  • When a term is passed as the initial process arguments in the spawn call
  • When a term is stored in an Ets table

That is an optimization. Most applications do not send messages with shared │ │ │ │ -subterms.

The following example shows how a shared subterm can be created:

kilo_byte() ->
│ │ │ │ -    kilo_byte(10, [42]).
│ │ │ │ +

An Erlang term can have shared subterms. Here is a simple example:

{SubTerm, SubTerm}

Shared subterms are not preserved in the following cases:

  • When a term is sent to another process
  • When a term is passed as the initial process arguments in the spawn call
  • When a term is stored in an Ets table

That is an optimization. Most applications do not send messages with shared │ │ │ │ +subterms.

The following example shows how a shared subterm can be created:

kilo_byte() ->
│ │ │ │ +    kilo_byte(10, [42]).
│ │ │ │  
│ │ │ │ -kilo_byte(0, Acc) ->
│ │ │ │ +kilo_byte(0, Acc) ->
│ │ │ │      Acc;
│ │ │ │ -kilo_byte(N, Acc) ->
│ │ │ │ -    kilo_byte(N-1, [Acc|Acc]).

kilo_byte/1 creates a deep list. If list_to_binary/1 │ │ │ │ +kilo_byte(N, Acc) -> │ │ │ │ + kilo_byte(N-1, [Acc|Acc]).

kilo_byte/1 creates a deep list. If list_to_binary/1 │ │ │ │ is called, the deep list can be converted to a binary of 1024 bytes:

1> byte_size(list_to_binary(efficiency_guide:kilo_byte())).
│ │ │ │  1024

Using the erts_debug:size/1 BIF, it can be seen that the deep list only │ │ │ │ -requires 22 words of heap space:

2> erts_debug:size(efficiency_guide:kilo_byte()).
│ │ │ │ +requires 22 words of heap space:

2> erts_debug:size(efficiency_guide:kilo_byte()).
│ │ │ │  22

Using the erts_debug:flat_size/1 BIF, the size of the deep list can be │ │ │ │ calculated if sharing is ignored. It becomes the size of the list when it has │ │ │ │ -been sent to another process or stored in an Ets table:

3> erts_debug:flat_size(efficiency_guide:kilo_byte()).
│ │ │ │ +been sent to another process or stored in an Ets table:

3> erts_debug:flat_size(efficiency_guide:kilo_byte()).
│ │ │ │  4094

It can be verified that sharing will be lost if the data is inserted into an Ets │ │ │ │ -table:

4> T = ets:new(tab, []).
│ │ │ │ +table:

4> T = ets:new(tab, []).
│ │ │ │  #Ref<0.1662103692.2407923716.214181>
│ │ │ │ -5> ets:insert(T, {key,efficiency_guide:kilo_byte()}).
│ │ │ │ +5> ets:insert(T, {key,efficiency_guide:kilo_byte()}).
│ │ │ │  true
│ │ │ │ -6> erts_debug:size(element(2, hd(ets:lookup(T, key)))).
│ │ │ │ +6> erts_debug:size(element(2, hd(ets:lookup(T, key)))).
│ │ │ │  4094
│ │ │ │ -7> erts_debug:flat_size(element(2, hd(ets:lookup(T, key)))).
│ │ │ │ +7> erts_debug:flat_size(element(2, hd(ets:lookup(T, key)))).
│ │ │ │  4094

When the data has passed through an Ets table, erts_debug:size/1 and │ │ │ │ erts_debug:flat_size/1 return the same value. Sharing has been lost.

It is possible to build an experimental variant of the runtime system that │ │ │ │ will preserve sharing when copying terms by giving the │ │ │ │ --enable-sharing-preserving option to the configure script.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/eff_guide_functions.xhtml │ │ │ │ @@ -27,67 +27,67 @@ │ │ │ │ Pattern Matching │ │ │ │

│ │ │ │

Pattern matching in function head as well as in case and receive clauses are │ │ │ │ optimized by the compiler. With a few exceptions, there is nothing to gain by │ │ │ │ rearranging clauses.

One exception is pattern matching of binaries. The compiler does not rearrange │ │ │ │ clauses that match binaries. Placing the clause that matches against the empty │ │ │ │ binary last is usually slightly faster than placing it first.

The following is a rather unnatural example to show another exception where │ │ │ │ -rearranging clauses is beneficial:

DO NOT

atom_map1(one) -> 1;
│ │ │ │ -atom_map1(two) -> 2;
│ │ │ │ -atom_map1(three) -> 3;
│ │ │ │ -atom_map1(Int) when is_integer(Int) -> Int;
│ │ │ │ -atom_map1(four) -> 4;
│ │ │ │ -atom_map1(five) -> 5;
│ │ │ │ -atom_map1(six) -> 6.

The problem is the clause with the variable Int. As a variable can match │ │ │ │ +rearranging clauses is beneficial:

DO NOT

atom_map1(one) -> 1;
│ │ │ │ +atom_map1(two) -> 2;
│ │ │ │ +atom_map1(three) -> 3;
│ │ │ │ +atom_map1(Int) when is_integer(Int) -> Int;
│ │ │ │ +atom_map1(four) -> 4;
│ │ │ │ +atom_map1(five) -> 5;
│ │ │ │ +atom_map1(six) -> 6.

The problem is the clause with the variable Int. As a variable can match │ │ │ │ anything, including the atoms four, five, and six, which the following │ │ │ │ clauses also match, the compiler must generate suboptimal code that executes as │ │ │ │ follows:

  • First, the input value is compared to one, two, and three (using a │ │ │ │ single instruction that does a binary search; thus, quite efficient even if │ │ │ │ there are many values) to select which one of the first three clauses to │ │ │ │ execute (if any).
  • If none of the first three clauses match, the fourth clause match as a │ │ │ │ variable always matches.
  • If the guard test is_integer(Int) succeeds, the fourth │ │ │ │ clause is executed.
  • If the guard test fails, the input value is compared to four, five, and │ │ │ │ six, and the appropriate clause is selected. (There is a function_clause │ │ │ │ -exception if none of the values matched.)

Rewriting to either:

DO

atom_map2(one) -> 1;
│ │ │ │ -atom_map2(two) -> 2;
│ │ │ │ -atom_map2(three) -> 3;
│ │ │ │ -atom_map2(four) -> 4;
│ │ │ │ -atom_map2(five) -> 5;
│ │ │ │ -atom_map2(six) -> 6;
│ │ │ │ -atom_map2(Int) when is_integer(Int) -> Int.

or:

DO

atom_map3(Int) when is_integer(Int) -> Int;
│ │ │ │ -atom_map3(one) -> 1;
│ │ │ │ -atom_map3(two) -> 2;
│ │ │ │ -atom_map3(three) -> 3;
│ │ │ │ -atom_map3(four) -> 4;
│ │ │ │ -atom_map3(five) -> 5;
│ │ │ │ -atom_map3(six) -> 6.

gives slightly more efficient matching code.

Another example:

DO NOT

map_pairs1(_Map, [], Ys) ->
│ │ │ │ +exception if none of the values matched.)

Rewriting to either:

DO

atom_map2(one) -> 1;
│ │ │ │ +atom_map2(two) -> 2;
│ │ │ │ +atom_map2(three) -> 3;
│ │ │ │ +atom_map2(four) -> 4;
│ │ │ │ +atom_map2(five) -> 5;
│ │ │ │ +atom_map2(six) -> 6;
│ │ │ │ +atom_map2(Int) when is_integer(Int) -> Int.

or:

DO

atom_map3(Int) when is_integer(Int) -> Int;
│ │ │ │ +atom_map3(one) -> 1;
│ │ │ │ +atom_map3(two) -> 2;
│ │ │ │ +atom_map3(three) -> 3;
│ │ │ │ +atom_map3(four) -> 4;
│ │ │ │ +atom_map3(five) -> 5;
│ │ │ │ +atom_map3(six) -> 6.

gives slightly more efficient matching code.

Another example:

DO NOT

map_pairs1(_Map, [], Ys) ->
│ │ │ │      Ys;
│ │ │ │ -map_pairs1(_Map, Xs, []) ->
│ │ │ │ +map_pairs1(_Map, Xs, []) ->
│ │ │ │      Xs;
│ │ │ │ -map_pairs1(Map, [X|Xs], [Y|Ys]) ->
│ │ │ │ -    [Map(X, Y)|map_pairs1(Map, Xs, Ys)].

The first argument is not a problem. It is variable, but it is a variable in │ │ │ │ +map_pairs1(Map, [X|Xs], [Y|Ys]) -> │ │ │ │ + [Map(X, Y)|map_pairs1(Map, Xs, Ys)].

The first argument is not a problem. It is variable, but it is a variable in │ │ │ │ all clauses. The problem is the variable in the second argument, Xs, in the │ │ │ │ middle clause. Because the variable can match anything, the compiler is not │ │ │ │ allowed to rearrange the clauses, but must generate code that matches them in │ │ │ │ the order written.

If the function is rewritten as follows, the compiler is free to rearrange the │ │ │ │ -clauses:

DO

map_pairs2(_Map, [], Ys) ->
│ │ │ │ +clauses:

DO

map_pairs2(_Map, [], Ys) ->
│ │ │ │      Ys;
│ │ │ │ -map_pairs2(_Map, [_|_]=Xs, [] ) ->
│ │ │ │ +map_pairs2(_Map, [_|_]=Xs, [] ) ->
│ │ │ │      Xs;
│ │ │ │ -map_pairs2(Map, [X|Xs], [Y|Ys]) ->
│ │ │ │ -    [Map(X, Y)|map_pairs2(Map, Xs, Ys)].

The compiler will generate code similar to this:

DO NOT (already done by the compiler)

explicit_map_pairs(Map, Xs0, Ys0) ->
│ │ │ │ +map_pairs2(Map, [X|Xs], [Y|Ys]) ->
│ │ │ │ +    [Map(X, Y)|map_pairs2(Map, Xs, Ys)].

The compiler will generate code similar to this:

DO NOT (already done by the compiler)

explicit_map_pairs(Map, Xs0, Ys0) ->
│ │ │ │      case Xs0 of
│ │ │ │ -	[X|Xs] ->
│ │ │ │ +	[X|Xs] ->
│ │ │ │  	    case Ys0 of
│ │ │ │ -		[Y|Ys] ->
│ │ │ │ -		    [Map(X, Y)|explicit_map_pairs(Map, Xs, Ys)];
│ │ │ │ -		[] ->
│ │ │ │ +		[Y|Ys] ->
│ │ │ │ +		    [Map(X, Y)|explicit_map_pairs(Map, Xs, Ys)];
│ │ │ │ +		[] ->
│ │ │ │  		    Xs0
│ │ │ │  	    end;
│ │ │ │ -	[] ->
│ │ │ │ +	[] ->
│ │ │ │  	    Ys0
│ │ │ │      end.

This is slightly faster for probably the most common case that the input lists │ │ │ │ are not empty or very short. (Another advantage is that Dialyzer can deduce a │ │ │ │ better type for the Xs variable.)

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/drivers.xhtml │ │ │ │ @@ -27,23 +27,23 @@ │ │ │ │ Drivers and Concurrency │ │ │ │

│ │ │ │

The runtime system always takes a lock before running any code in a driver.

By default, that lock is at the driver level, that is, if several ports have │ │ │ │ been opened to the same driver, only code for one port at the same time can be │ │ │ │ running.

A driver can be configured to have one lock for each port instead.

If a driver is used in a functional way (that is, holds no state, but only does │ │ │ │ some heavy calculation and returns a result), several ports with registered │ │ │ │ names can be opened beforehand, and the port to be used can be chosen based on │ │ │ │ -the scheduler ID as follows:

-define(PORT_NAMES(),
│ │ │ │ -	{some_driver_01, some_driver_02, some_driver_03, some_driver_04,
│ │ │ │ +the scheduler ID as follows:

-define(PORT_NAMES(),
│ │ │ │ +	{some_driver_01, some_driver_02, some_driver_03, some_driver_04,
│ │ │ │  	 some_driver_05, some_driver_06, some_driver_07, some_driver_08,
│ │ │ │  	 some_driver_09, some_driver_10, some_driver_11, some_driver_12,
│ │ │ │ -	 some_driver_13, some_driver_14, some_driver_15, some_driver_16}).
│ │ │ │ +	 some_driver_13, some_driver_14, some_driver_15, some_driver_16}).
│ │ │ │  
│ │ │ │ -client_port() ->
│ │ │ │ -    element(erlang:system_info(scheduler_id) rem tuple_size(?PORT_NAMES()) + 1,
│ │ │ │ -	    ?PORT_NAMES()).

As long as there are no more than 16 schedulers, there will never be any lock │ │ │ │ +client_port() -> │ │ │ │ + element(erlang:system_info(scheduler_id) rem tuple_size(?PORT_NAMES()) + 1, │ │ │ │ + ?PORT_NAMES()).

As long as there are no more than 16 schedulers, there will never be any lock │ │ │ │ contention on the port lock for the driver.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Avoiding Copying Binaries When Calling a Driver │ │ │ │

│ │ │ │

There are basically two ways to avoid copying a binary that is sent to a driver:

  • If the Data argument for port_control/3 is a │ │ │ ├── OEBPS/documentation.xhtml │ │ │ │ @@ -17,23 +17,23 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    │ │ │ │ Documentation │ │ │ │

    │ │ │ │

    Documentation in Erlang is done through the -moduledoc and -doc │ │ │ │ -attributes. For example:

    -module(arith).
    │ │ │ │ +attributes. For example:

    -module(arith).
    │ │ │ │  -moduledoc """
    │ │ │ │  A module for basic arithmetic.
    │ │ │ │  """.
    │ │ │ │  
    │ │ │ │ --export([add/2]).
    │ │ │ │ +-export([add/2]).
    │ │ │ │  
    │ │ │ │  -doc "Adds two numbers.".
    │ │ │ │ -add(One, Two) -> One + Two.

    The -moduledoc attribute has to be located before the first -doc attribute │ │ │ │ +add(One, Two) -> One + Two.

    The -moduledoc attribute has to be located before the first -doc attribute │ │ │ │ or function declaration. It documents the overall purpose of the module.

    The -doc attribute always precedes the function or │ │ │ │ attribute it documents. The │ │ │ │ attributes that can be documented are │ │ │ │ user-defined types │ │ │ │ (-type and -opaque) and │ │ │ │ behaviour module attributes │ │ │ │ (-callback).

    By default the format used for documentation attributes is │ │ │ │ @@ -45,55 +45,55 @@ │ │ │ │ Documentation Attributes.

    -doc attributes have been available since Erlang/OTP 27.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Documentation metadata │ │ │ │

    │ │ │ │

    It is possible to add metadata to the documentation entry. You do this by adding │ │ │ │ -a -moduledoc or -doc attribute with a map as argument. For example:

    -module(arith).
    │ │ │ │ +a -moduledoc or -doc attribute with a map as argument. For example:

    -module(arith).
    │ │ │ │  -moduledoc """
    │ │ │ │  A module for basic arithmetic.
    │ │ │ │  """.
    │ │ │ │ --moduledoc #{since => "1.0"}.
    │ │ │ │ +-moduledoc #{since => "1.0"}.
    │ │ │ │  
    │ │ │ │ --export([add/2]).
    │ │ │ │ +-export([add/2]).
    │ │ │ │  
    │ │ │ │  -doc "Adds two numbers.".
    │ │ │ │ --doc(#{since => "1.0"}).
    │ │ │ │ -add(One, Two) -> One + Two.

    The metadata is used by documentation tools to provide extra information to the │ │ │ │ +-doc(#{since => "1.0"}). │ │ │ │ +add(One, Two) -> One + Two.

    The metadata is used by documentation tools to provide extra information to the │ │ │ │ user. There can be multiple metadata documentation entries, in which case the │ │ │ │ maps will be merged with the latest taking precedence if there are duplicate │ │ │ │ keys. Example:

    -doc "Adds two numbers.".
    │ │ │ │ --doc #{since => "1.0", author => "Joe"}.
    │ │ │ │ --doc #{since => "2.0"}.
    │ │ │ │ -add(One, Two) -> One + Two.

    This will result in a metadata entry of #{since => "2.0", author => "Joe"}.

    The keys and values in the metadata map can be any type, but it is recommended │ │ │ │ +-doc #{since => "1.0", author => "Joe"}. │ │ │ │ +-doc #{since => "2.0"}. │ │ │ │ +add(One, Two) -> One + Two.

This will result in a metadata entry of #{since => "2.0", author => "Joe"}.

The keys and values in the metadata map can be any type, but it is recommended │ │ │ │ that only atoms are used for keys and │ │ │ │ strings for the values.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ External documentation files │ │ │ │

│ │ │ │

The -moduledoc and -doc can also be placed in external files. To do so use │ │ │ │ -doc {file, "path/to/doc.md"} to point to the documentation. The path used is │ │ │ │ relative to the file where the -doc attribute is located. For example:

%% doc/add.md
│ │ │ │  Adds two numbers.

and

%% src/arith.erl
│ │ │ │ --doc({file, "../doc/add.md"}).
│ │ │ │ -add(One, Two) -> One + Two.

│ │ │ │ +-doc({file, "../doc/add.md"}). │ │ │ │ +add(One, Two) -> One + Two.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Documenting a module │ │ │ │

│ │ │ │

The module description should include details on how to use the API and examples │ │ │ │ of the different functions working together. Here is a good place to use images │ │ │ │ and other diagrams to better show the usage of the module. Instead of writing a │ │ │ │ long text in the moduledoc attribute, it could be better to break it out into │ │ │ │ an external page.

The moduledoc attribute should start with a short paragraph describing the │ │ │ │ -module and then go into greater details. For example:

-module(arith).
│ │ │ │ +module and then go into greater details. For example:

-module(arith).
│ │ │ │  -moduledoc """
│ │ │ │     A module for basic arithmetic.
│ │ │ │  
│ │ │ │     This module can be used to add and subtract values. For example:
│ │ │ │  
│ │ │ │     ```erlang
│ │ │ │     1> arith:substract(arith:add(2, 3), 1).
│ │ │ │ @@ -108,94 +108,94 @@
│ │ │ │  

There are three reserved metadata keys for -moduledoc:

  • since - Shows in which version of the application the module was added. │ │ │ │ If this is added, all functions, types, and callbacks within will also receive │ │ │ │ the same since value unless specified in the metadata of the function, type │ │ │ │ or callback.
  • deprecated - Shows a text in the documentation explaining that it is │ │ │ │ deprecated and what to use instead.
  • format - The format to use for all documentation in this module. The │ │ │ │ default is text/markdown. It should be written using the │ │ │ │ mime type │ │ │ │ -of the format.

Example:

-moduledoc {file, "../doc/arith.asciidoc"}.
│ │ │ │ --moduledoc #{since => "0.1", format => "text/asciidoc"}.
│ │ │ │ --moduledoc #{deprecated => "Use the Erlang arithmetic operators instead."}.

│ │ │ │ +of the format.

Example:

-moduledoc {file, "../doc/arith.asciidoc"}.
│ │ │ │ +-moduledoc #{since => "0.1", format => "text/asciidoc"}.
│ │ │ │ +-moduledoc #{deprecated => "Use the Erlang arithmetic operators instead."}.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Documenting functions, user-defined types, and callbacks │ │ │ │

│ │ │ │

Functions, types, and callbacks can be documented using the -doc attribute. │ │ │ │ Each entry should start with a short paragraph describing the purpose of entity, │ │ │ │ and then go into greater detail in needed.

It is not recommended to include images or diagrams in this documentation as it │ │ │ │ is used by IDEs and c:h/1 to show the documentation to the user.

For example:

-doc """
│ │ │ │  A number that can be used by the arith module.
│ │ │ │  
│ │ │ │  We use a special number here so that we know
│ │ │ │  that this number comes from this module.
│ │ │ │  """.
│ │ │ │ --opaque number() :: {arith, erlang:number()}.
│ │ │ │ +-opaque number() :: {arith, erlang:number()}.
│ │ │ │  
│ │ │ │  -doc """
│ │ │ │  Adds two numbers.
│ │ │ │  
│ │ │ │  ### Example:
│ │ │ │  
│ │ │ │  ```
│ │ │ │  1> arith:add(arith:number(1), arith:number(2)). {number, 3}
│ │ │ │  ```
│ │ │ │  """.
│ │ │ │ --spec add(number(), number()) -> number().
│ │ │ │ -add({number, One}, {number, Two}) -> {number, One + Two}.

│ │ │ │ +-spec add(number(), number()) -> number(). │ │ │ │ +add({number, One}, {number, Two}) -> {number, One + Two}.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Doc metadata │ │ │ │

│ │ │ │

There are four reserved metadata keys for -doc:

  • since => unicode:chardata() - Shows which version of the application the │ │ │ │ module was added.

  • deprecated => unicode:chardata() - Shows a text in the documentation │ │ │ │ explaining that it is deprecated and what to use instead. The compiler will │ │ │ │ automatically insert this key if there is a -deprecated attribute marking a │ │ │ │ function as deprecated.

  • equiv => unicode:chardata() | F/A | F(...) - Notes that this function is equivalent to │ │ │ │ another function in this module. The equivalence can be described using either │ │ │ │ -Func/Arity, Func(Args) or a unicode string. For example:

    -doc #{equiv => add/3}.
    │ │ │ │ -add(One, Two) -> add(One, Two, []).
    │ │ │ │ -add(One, Two, Options) -> ...

    or

    -doc #{equiv => add(One, Two, [])}.
    │ │ │ │ --spec add(One :: number(), Two :: number()) -> number().
    │ │ │ │ -add(One, Two) -> add(One, Two, []).
    │ │ │ │ -add(One, Two, Options) -> ...

    The entry into the EEP-48 doc chunk metadata is │ │ │ │ +Func/Arity, Func(Args) or a unicode string. For example:

    -doc #{equiv => add/3}.
    │ │ │ │ +add(One, Two) -> add(One, Two, []).
    │ │ │ │ +add(One, Two, Options) -> ...

    or

    -doc #{equiv => add(One, Two, [])}.
    │ │ │ │ +-spec add(One :: number(), Two :: number()) -> number().
    │ │ │ │ +add(One, Two) -> add(One, Two, []).
    │ │ │ │ +add(One, Two, Options) -> ...

    The entry into the EEP-48 doc chunk metadata is │ │ │ │ the value converted to a string.

  • exported => boolean() - A boolean/0 signifying if the entry is exported │ │ │ │ or not. This value is automatically set by the compiler and should not be set │ │ │ │ by the user.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Doc signatures │ │ │ │

│ │ │ │

The doc signature is a short text shown to describe the function and its arguments. │ │ │ │ By default it is determined by looking at the names of the arguments in the │ │ │ │ --spec or function. For example:

add(One, Two) -> One + Two.
│ │ │ │ +-spec or function. For example:

add(One, Two) -> One + Two.
│ │ │ │  
│ │ │ │ --spec sub(One :: integer(), Two :: integer()) -> integer().
│ │ │ │ -sub(X, Y) -> X - Y.

will have a signature of add(One, Two) and sub(One, Two).

For types or callbacks, the signature is derived from the type or callback │ │ │ │ -specification. For example:

-type number(Value) :: {number, Value}.
│ │ │ │ +-spec sub(One :: integer(), Two :: integer()) -> integer().
│ │ │ │ +sub(X, Y) -> X - Y.

will have a signature of add(One, Two) and sub(One, Two).

For types or callbacks, the signature is derived from the type or callback │ │ │ │ +specification. For example:

-type number(Value) :: {number, Value}.
│ │ │ │  %% signature will be `number(Value)`
│ │ │ │  
│ │ │ │ --opaque number() :: {number, number()}.
│ │ │ │ +-opaque number() :: {number, number()}.
│ │ │ │  %% signature will be `number()`
│ │ │ │  
│ │ │ │ --callback increment(In :: number()) -> Out.
│ │ │ │ +-callback increment(In :: number()) -> Out.
│ │ │ │  %% signature will be `increment(In)`
│ │ │ │  
│ │ │ │ --callback increment(In) -> Out when In :: number().
│ │ │ │ +-callback increment(In) -> Out when In :: number().
│ │ │ │  %% signature will be `increment(In)`

If it is not possible to "easily" figure out a nice signature from the code, the │ │ │ │ MFA syntax is used instead. For example: add/2, number/1, increment/1

It is possible to supply a custom signature by placing it as the first line of the │ │ │ │ -doc attribute. The provided signature must be in the form of a function │ │ │ │ declaration up until the ->. For example:

-doc """
│ │ │ │  add(One, Two)
│ │ │ │  
│ │ │ │  Adds two numbers.
│ │ │ │  """.
│ │ │ │ -add(A, B) -> A + B.

Will create the signature add(One, Two). The signature will be removed from the │ │ │ │ +add(A, B) -> A + B.

Will create the signature add(One, Two). The signature will be removed from the │ │ │ │ documentation string, so in the example above only the text "Adds two numbers" │ │ │ │ will be part of the documentation. This works for functions, types, and │ │ │ │ callbacks.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Compiling and getting documentation │ │ │ │ @@ -280,21 +280,21 @@ │ │ │ │ Using ExDoc to generate HTML/ePub documentation │ │ │ │

│ │ │ │

ExDoc has built-in support to generate │ │ │ │ documentation from Markdown. The simplest way is by using the │ │ │ │ rebar3_ex_doc plugin. To set up a │ │ │ │ rebar3 project to use ExDoc to generate │ │ │ │ documentation add the following to your rebar3.config.

%% Enable the plugin
│ │ │ │ -{plugins, [rebar3_ex_doc]}.
│ │ │ │ +{plugins, [rebar3_ex_doc]}.
│ │ │ │  
│ │ │ │ -{ex_doc, [
│ │ │ │ -  {extras, ["README.md"]},
│ │ │ │ -  {main, "README.md"},
│ │ │ │ -  {source_url, "https://github.com/namespace/your_app"}
│ │ │ │ -]}.

When configured you can run rebar3 ex_doc to generate the │ │ │ │ +{ex_doc, [ │ │ │ │ + {extras, ["README.md"]}, │ │ │ │ + {main, "README.md"}, │ │ │ │ + {source_url, "https://github.com/namespace/your_app"} │ │ │ │ +]}.

When configured you can run rebar3 ex_doc to generate the │ │ │ │ documentation to doc/index.html. For more details and options see │ │ │ │ the rebar3_ex_doc documentation.

You can also download the │ │ │ │ release escript bundle from │ │ │ │ github and run it from the command line. The documentation for using the escript │ │ │ │ is found by running ex_doc --help.

If you are writing documentation that will be using │ │ │ │ ExDoc to generate HTML/ePub it is highly │ │ │ │ recommended to read its documentation.

│ │ │ ├── OEBPS/distributed_applications.xhtml │ │ │ │ @@ -55,36 +55,36 @@ │ │ │ │ (within the time-out specified by sync_nodes_timeout).
  • sync_nodes_timeout = integer() | infinity - Specifies how many milliseconds │ │ │ │ to wait for the other nodes to start.

  • When started, the node waits for all nodes specified by sync_nodes_mandatory │ │ │ │ and sync_nodes_optional to come up. When all nodes are up, or when all │ │ │ │ mandatory nodes are up and the time specified by sync_nodes_timeout has │ │ │ │ elapsed, all applications start. If not all mandatory nodes are up, the node │ │ │ │ terminates.

    Example:

    An application myapp is to run at the node cp1@cave. If this node goes down, │ │ │ │ myapp is to be restarted at cp2@cave or cp3@cave. A system configuration │ │ │ │ -file cp1.config for cp1@cave can look as follows:

    [{kernel,
    │ │ │ │ -  [{distributed, [{myapp, 5000, [cp1@cave, {cp2@cave, cp3@cave}]}]},
    │ │ │ │ -   {sync_nodes_mandatory, [cp2@cave, cp3@cave]},
    │ │ │ │ -   {sync_nodes_timeout, 5000}
    │ │ │ │ -  ]
    │ │ │ │ - }
    │ │ │ │ -].

    The system configuration files for cp2@cave and cp3@cave are identical, │ │ │ │ +file cp1.config for cp1@cave can look as follows:

    [{kernel,
    │ │ │ │ +  [{distributed, [{myapp, 5000, [cp1@cave, {cp2@cave, cp3@cave}]}]},
    │ │ │ │ +   {sync_nodes_mandatory, [cp2@cave, cp3@cave]},
    │ │ │ │ +   {sync_nodes_timeout, 5000}
    │ │ │ │ +  ]
    │ │ │ │ + }
    │ │ │ │ +].

    The system configuration files for cp2@cave and cp3@cave are identical, │ │ │ │ except for the list of mandatory nodes, which is to be [cp1@cave, cp3@cave] │ │ │ │ for cp2@cave and [cp1@cave, cp2@cave] for cp3@cave.

    Note

    All involved nodes must have the same value for distributed and │ │ │ │ sync_nodes_timeout. Otherwise the system behavior is undefined.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Starting and Stopping Distributed Applications │ │ │ │

    │ │ │ │

    When all involved (mandatory) nodes have been started, the distributed │ │ │ │ application can be started by calling application:start(Application) at all │ │ │ │ of these nodes.

    A boot script (see Releases) can be used that │ │ │ │ automatically starts the application.

    The application is started at the first operational node that is listed in the │ │ │ │ list of nodes in the distributed configuration parameter. The application is │ │ │ │ started as usual. That is, an application master is created and calls the │ │ │ │ -application callback function:

    Module:start(normal, StartArgs)

    Example:

    Continuing the example from the previous section, the three nodes are started, │ │ │ │ +application callback function:

    Module:start(normal, StartArgs)

    Example:

    Continuing the example from the previous section, the three nodes are started, │ │ │ │ specifying the system configuration file:

    > erl -sname cp1 -config cp1
    │ │ │ │  > erl -sname cp2 -config cp2
    │ │ │ │  > erl -sname cp3 -config cp3

    When all nodes are operational, myapp can be started. This is achieved by │ │ │ │ calling application:start(myapp) at all three nodes. It is then started at │ │ │ │ cp1, as shown in the following figure:

    Application myapp - Situation 1

    Similarly, the application must be stopped by calling │ │ │ │ application:stop(Application) at all involved nodes.

    │ │ │ │ │ │ │ │ @@ -92,30 +92,30 @@ │ │ │ │ │ │ │ │ Failover │ │ │ │

    │ │ │ │

    If the node where the application is running goes down, the application is │ │ │ │ restarted (after the specified time-out) at the first operational node that is │ │ │ │ listed in the list of nodes in the distributed configuration parameter. This │ │ │ │ is called a failover.

    The application is started the normal way at the new node, that is, by the │ │ │ │ -application master calling:

    Module:start(normal, StartArgs)

    An exception is if the application has the start_phases key defined (see │ │ │ │ +application master calling:

    Module:start(normal, StartArgs)

    An exception is if the application has the start_phases key defined (see │ │ │ │ Included Applications). The application is then │ │ │ │ -instead started by calling:

    Module:start({failover, Node}, StartArgs)

    Here Node is the terminated node.

    Example:

    If cp1 goes down, the system checks which one of the other nodes, cp2 or │ │ │ │ +instead started by calling:

    Module:start({failover, Node}, StartArgs)

    Here Node is the terminated node.

    Example:

    If cp1 goes down, the system checks which one of the other nodes, cp2 or │ │ │ │ cp3, has the least number of running applications, but waits for 5 seconds for │ │ │ │ cp1 to restart. If cp1 does not restart and cp2 runs fewer applications │ │ │ │ than cp3, myapp is restarted on cp2.

    Application myapp - Situation 2

    Suppose now that cp2 goes also down and does not restart within 5 seconds. │ │ │ │ myapp is now restarted on cp3.

    Application myapp - Situation 3

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Takeover │ │ │ │

    │ │ │ │

    If a node is started, which has higher priority according to distributed than │ │ │ │ the node where a distributed application is running, the application is │ │ │ │ restarted at the new node and stopped at the old node. This is called a │ │ │ │ -takeover.

    The application is started by the application master calling:

    Module:start({takeover, Node}, StartArgs)

    Here Node is the old node.

    Example:

    If myapp is running at cp3, and if cp2 now restarts, it does not restart │ │ │ │ +takeover.

    The application is started by the application master calling:

    Module:start({takeover, Node}, StartArgs)

    Here Node is the old node.

    Example:

    If myapp is running at cp3, and if cp2 now restarts, it does not restart │ │ │ │ myapp, as the order between the cp2 and cp3 nodes is undefined.

    Application myapp - Situation 4

    However, if cp1 also restarts, the function application:takeover/2 moves │ │ │ │ myapp to cp1, as cp1 has a higher priority than cp3 for this │ │ │ │ application. In this case, Module:start({takeover, cp3@cave}, StartArgs) is │ │ │ │ executed at cp1 to start the application.

    Application myapp - Situation 5

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/distributed.xhtml │ │ │ │ @@ -47,25 +47,25 @@ │ │ │ │ │ │ │ │

    A node is an executing Erlang runtime system that has been given a name, using │ │ │ │ the command-line flag -name (long names) or │ │ │ │ -sname (short names).

    The format of the node name is an atom name@host. name is the name given by │ │ │ │ the user. host is the full host name if long names are used, or the first part │ │ │ │ of the host name if short names are used. Function node() │ │ │ │ returns the name of the node.

    Example:

    % erl -name dilbert
    │ │ │ │ -(dilbert@uab.ericsson.se)1> node().
    │ │ │ │ +(dilbert@uab.ericsson.se)1> node().
    │ │ │ │  'dilbert@uab.ericsson.se'
    │ │ │ │  
    │ │ │ │  % erl -sname dilbert
    │ │ │ │ -(dilbert@uab)1> node().
    │ │ │ │ +(dilbert@uab)1> node().
    │ │ │ │  dilbert@uab

    The node name can also be given in runtime by calling net_kernel:start/1.

    Example:

    % erl
    │ │ │ │ -1> node().
    │ │ │ │ +1> node().
    │ │ │ │  nonode@nohost
    │ │ │ │ -2> net_kernel:start([dilbert,shortnames]).
    │ │ │ │ -{ok,<0.102.0>}
    │ │ │ │ -(dilbert@uab)3> node().
    │ │ │ │ +2> net_kernel:start([dilbert,shortnames]).
    │ │ │ │ +{ok,<0.102.0>}
    │ │ │ │ +(dilbert@uab)3> node().
    │ │ │ │  dilbert@uab

    Note

    A node with a long node name cannot communicate with a node with a short node │ │ │ │ name.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Node Connections │ │ │ │

    │ │ │ ├── OEBPS/design_principles.xhtml │ │ │ │ @@ -57,135 +57,135 @@ │ │ │ │ the code for a process in a generic part (a behaviour module) and a specific │ │ │ │ part (a callback module).

    The behaviour module is part of Erlang/OTP. To implement a process such as a │ │ │ │ supervisor, the user only needs to implement the callback module, which is to │ │ │ │ export a pre-defined set of functions, the callback functions.

    The following example illustrate how code can be divided into a generic and a │ │ │ │ specific part. Consider the following code (written in plain Erlang) for a │ │ │ │ simple server, which keeps track of a number of "channels". Other processes can │ │ │ │ allocate and free the channels by calling the functions alloc/0 and free/1, │ │ │ │ -respectively.

    -module(ch1).
    │ │ │ │ --export([start/0]).
    │ │ │ │ --export([alloc/0, free/1]).
    │ │ │ │ --export([init/0]).
    │ │ │ │ +respectively.

    -module(ch1).
    │ │ │ │ +-export([start/0]).
    │ │ │ │ +-export([alloc/0, free/1]).
    │ │ │ │ +-export([init/0]).
    │ │ │ │  
    │ │ │ │ -start() ->
    │ │ │ │ -    spawn(ch1, init, []).
    │ │ │ │ +start() ->
    │ │ │ │ +    spawn(ch1, init, []).
    │ │ │ │  
    │ │ │ │ -alloc() ->
    │ │ │ │ -    ch1 ! {self(), alloc},
    │ │ │ │ +alloc() ->
    │ │ │ │ +    ch1 ! {self(), alloc},
    │ │ │ │      receive
    │ │ │ │ -        {ch1, Res} ->
    │ │ │ │ +        {ch1, Res} ->
    │ │ │ │              Res
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -free(Ch) ->
    │ │ │ │ -    ch1 ! {free, Ch},
    │ │ │ │ +free(Ch) ->
    │ │ │ │ +    ch1 ! {free, Ch},
    │ │ │ │      ok.
    │ │ │ │  
    │ │ │ │ -init() ->
    │ │ │ │ -    register(ch1, self()),
    │ │ │ │ -    Chs = channels(),
    │ │ │ │ -    loop(Chs).
    │ │ │ │ +init() ->
    │ │ │ │ +    register(ch1, self()),
    │ │ │ │ +    Chs = channels(),
    │ │ │ │ +    loop(Chs).
    │ │ │ │  
    │ │ │ │ -loop(Chs) ->
    │ │ │ │ +loop(Chs) ->
    │ │ │ │      receive
    │ │ │ │ -        {From, alloc} ->
    │ │ │ │ -            {Ch, Chs2} = alloc(Chs),
    │ │ │ │ -            From ! {ch1, Ch},
    │ │ │ │ -            loop(Chs2);
    │ │ │ │ -        {free, Ch} ->
    │ │ │ │ -            Chs2 = free(Ch, Chs),
    │ │ │ │ -            loop(Chs2)
    │ │ │ │ -    end.

    The code for the server can be rewritten into a generic part server.erl:

    -module(server).
    │ │ │ │ --export([start/1]).
    │ │ │ │ --export([call/2, cast/2]).
    │ │ │ │ --export([init/1]).
    │ │ │ │ +        {From, alloc} ->
    │ │ │ │ +            {Ch, Chs2} = alloc(Chs),
    │ │ │ │ +            From ! {ch1, Ch},
    │ │ │ │ +            loop(Chs2);
    │ │ │ │ +        {free, Ch} ->
    │ │ │ │ +            Chs2 = free(Ch, Chs),
    │ │ │ │ +            loop(Chs2)
    │ │ │ │ +    end.

    The code for the server can be rewritten into a generic part server.erl:

    -module(server).
    │ │ │ │ +-export([start/1]).
    │ │ │ │ +-export([call/2, cast/2]).
    │ │ │ │ +-export([init/1]).
    │ │ │ │  
    │ │ │ │ -start(Mod) ->
    │ │ │ │ -    spawn(server, init, [Mod]).
    │ │ │ │ +start(Mod) ->
    │ │ │ │ +    spawn(server, init, [Mod]).
    │ │ │ │  
    │ │ │ │ -call(Name, Req) ->
    │ │ │ │ -    Name ! {call, self(), Req},
    │ │ │ │ +call(Name, Req) ->
    │ │ │ │ +    Name ! {call, self(), Req},
    │ │ │ │      receive
    │ │ │ │ -        {Name, Res} ->
    │ │ │ │ +        {Name, Res} ->
    │ │ │ │              Res
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -cast(Name, Req) ->
    │ │ │ │ -    Name ! {cast, Req},
    │ │ │ │ +cast(Name, Req) ->
    │ │ │ │ +    Name ! {cast, Req},
    │ │ │ │      ok.
    │ │ │ │  
    │ │ │ │ -init(Mod) ->
    │ │ │ │ -    register(Mod, self()),
    │ │ │ │ -    State = Mod:init(),
    │ │ │ │ -    loop(Mod, State).
    │ │ │ │ +init(Mod) ->
    │ │ │ │ +    register(Mod, self()),
    │ │ │ │ +    State = Mod:init(),
    │ │ │ │ +    loop(Mod, State).
    │ │ │ │  
    │ │ │ │ -loop(Mod, State) ->
    │ │ │ │ +loop(Mod, State) ->
    │ │ │ │      receive
    │ │ │ │ -        {call, From, Req} ->
    │ │ │ │ -            {Res, State2} = Mod:handle_call(Req, State),
    │ │ │ │ -            From ! {Mod, Res},
    │ │ │ │ -            loop(Mod, State2);
    │ │ │ │ -        {cast, Req} ->
    │ │ │ │ -            State2 = Mod:handle_cast(Req, State),
    │ │ │ │ -            loop(Mod, State2)
    │ │ │ │ -    end.

    And a callback module ch2.erl:

    -module(ch2).
    │ │ │ │ --export([start/0]).
    │ │ │ │ --export([alloc/0, free/1]).
    │ │ │ │ --export([init/0, handle_call/2, handle_cast/2]).
    │ │ │ │ -
    │ │ │ │ -start() ->
    │ │ │ │ -    server:start(ch2).
    │ │ │ │ -
    │ │ │ │ -alloc() ->
    │ │ │ │ -    server:call(ch2, alloc).
    │ │ │ │ -
    │ │ │ │ -free(Ch) ->
    │ │ │ │ -    server:cast(ch2, {free, Ch}).
    │ │ │ │ +        {call, From, Req} ->
    │ │ │ │ +            {Res, State2} = Mod:handle_call(Req, State),
    │ │ │ │ +            From ! {Mod, Res},
    │ │ │ │ +            loop(Mod, State2);
    │ │ │ │ +        {cast, Req} ->
    │ │ │ │ +            State2 = Mod:handle_cast(Req, State),
    │ │ │ │ +            loop(Mod, State2)
    │ │ │ │ +    end.

    And a callback module ch2.erl:

    -module(ch2).
    │ │ │ │ +-export([start/0]).
    │ │ │ │ +-export([alloc/0, free/1]).
    │ │ │ │ +-export([init/0, handle_call/2, handle_cast/2]).
    │ │ │ │ +
    │ │ │ │ +start() ->
    │ │ │ │ +    server:start(ch2).
    │ │ │ │ +
    │ │ │ │ +alloc() ->
    │ │ │ │ +    server:call(ch2, alloc).
    │ │ │ │ +
    │ │ │ │ +free(Ch) ->
    │ │ │ │ +    server:cast(ch2, {free, Ch}).
    │ │ │ │  
    │ │ │ │ -init() ->
    │ │ │ │ -    channels().
    │ │ │ │ +init() ->
    │ │ │ │ +    channels().
    │ │ │ │  
    │ │ │ │ -handle_call(alloc, Chs) ->
    │ │ │ │ -    alloc(Chs). % => {Ch,Chs2}
    │ │ │ │ +handle_call(alloc, Chs) ->
    │ │ │ │ +    alloc(Chs). % => {Ch,Chs2}
    │ │ │ │  
    │ │ │ │ -handle_cast({free, Ch}, Chs) ->
    │ │ │ │ -    free(Ch, Chs). % => Chs2

    Notice the following:

    • The code in server can be reused to build many different servers.
    • The server name, in this example the atom ch2, is hidden from the users of │ │ │ │ +handle_cast({free, Ch}, Chs) -> │ │ │ │ + free(Ch, Chs). % => Chs2

    Notice the following:

    • The code in server can be reused to build many different servers.
    • The server name, in this example the atom ch2, is hidden from the users of │ │ │ │ the client functions. This means that the name can be changed without │ │ │ │ affecting them.
    • The protocol (messages sent to and received from the server) is also hidden. │ │ │ │ This is good programming practice and allows one to change the protocol │ │ │ │ without changing the code using the interface functions.
    • The functionality of server can be extended without having to change ch2 │ │ │ │ or any other callback module.

    In ch1.erl and ch2.erl above, the implementation of channels/0, alloc/1, │ │ │ │ and free/2 has been intentionally left out, as it is not relevant to the │ │ │ │ example. For completeness, one way to write these functions is given below. This │ │ │ │ is an example only, a realistic implementation must be able to handle situations │ │ │ │ -like running out of channels to allocate, and so on.

    channels() ->
    │ │ │ │ -   {_Allocated = [], _Free = lists:seq(1, 100)}.
    │ │ │ │ +like running out of channels to allocate, and so on.

    channels() ->
    │ │ │ │ +   {_Allocated = [], _Free = lists:seq(1, 100)}.
    │ │ │ │  
    │ │ │ │ -alloc({Allocated, [H|T] = _Free}) ->
    │ │ │ │ -   {H, {[H|Allocated], T}}.
    │ │ │ │ +alloc({Allocated, [H|T] = _Free}) ->
    │ │ │ │ +   {H, {[H|Allocated], T}}.
    │ │ │ │  
    │ │ │ │ -free(Ch, {Alloc, Free} = Channels) ->
    │ │ │ │ -   case lists:member(Ch, Alloc) of
    │ │ │ │ +free(Ch, {Alloc, Free} = Channels) ->
    │ │ │ │ +   case lists:member(Ch, Alloc) of
    │ │ │ │        true ->
    │ │ │ │ -         {lists:delete(Ch, Alloc), [Ch|Free]};
    │ │ │ │ +         {lists:delete(Ch, Alloc), [Ch|Free]};
    │ │ │ │        false ->
    │ │ │ │           Channels
    │ │ │ │     end.

    Code written without using behaviours can be more efficient, but the increased │ │ │ │ efficiency is at the expense of generality. The ability to manage all │ │ │ │ applications in the system in a consistent manner is important.

    Using behaviours also makes it easier to read and understand code written by │ │ │ │ other programmers. Improvised programming structures, while possibly more │ │ │ │ efficient, are always more difficult to understand.

    The server module corresponds, greatly simplified, to the Erlang/OTP behaviour │ │ │ │ gen_server.

    The standard Erlang/OTP behaviours are:

    • gen_server

      For implementing the server of a client-server relation

    • gen_statem

      For implementing state machines

    • gen_event

      For implementing event handling functionality

    • supervisor

      For implementing a supervisor in a supervision tree

    The compiler understands the module attribute -behaviour(Behaviour) and issues │ │ │ │ -warnings about missing callback functions, for example:

    -module(chs3).
    │ │ │ │ --behaviour(gen_server).
    │ │ │ │ +warnings about missing callback functions, for example:

    -module(chs3).
    │ │ │ │ +-behaviour(gen_server).
    │ │ │ │  ...
    │ │ │ │  
    │ │ │ │ -3> c(chs3).
    │ │ │ │ +3> c(chs3).
    │ │ │ │  ./chs3.erl:10: Warning: undefined call-back function handle_call/3
    │ │ │ │ -{ok,chs3}

    │ │ │ │ +{ok,chs3}

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Applications │ │ │ │

    │ │ │ │

    Erlang/OTP comes with a number of components, each implementing some specific │ │ │ │ functionality. Components are with Erlang/OTP terminology called applications. │ │ │ ├── OEBPS/data_types.xhtml │ │ │ │ @@ -97,18 +97,18 @@ │ │ │ │ │ │ │ │ Representation of Floating Point Numbers │ │ │ │ │ │ │ │

    When working with floats you may not see what you expect when printing or doing │ │ │ │ arithmetic operations. This is because floats are represented by a fixed number │ │ │ │ of bits in a base-2 system while printed floats are represented with a base-10 │ │ │ │ system. Erlang uses 64-bit floats. Here are examples of this phenomenon:

    1> 0.1+0.2.
    │ │ │ │ -0.30000000000000004

    The real numbers 0.1 and 0.2 cannot be represented exactly as floats.

    1> {36028797018963968.0, 36028797018963968 == 36028797018963968.0,
    │ │ │ │ -  36028797018963970.0, 36028797018963970 == 36028797018963970.0}.
    │ │ │ │ -{3.602879701896397e16, true,
    │ │ │ │ - 3.602879701896397e16, false}.

    The value 36028797018963968 can be represented exactly as a float value but │ │ │ │ +0.30000000000000004

    The real numbers 0.1 and 0.2 cannot be represented exactly as floats.

    1> {36028797018963968.0, 36028797018963968 == 36028797018963968.0,
    │ │ │ │ +  36028797018963970.0, 36028797018963970 == 36028797018963970.0}.
    │ │ │ │ +{3.602879701896397e16, true,
    │ │ │ │ + 3.602879701896397e16, false}.

    The value 36028797018963968 can be represented exactly as a float value but │ │ │ │ Erlang's pretty printer rounds 36028797018963968.0 to 3.602879701896397e16 │ │ │ │ (=36028797018963970.0) as all values in the range │ │ │ │ [36028797018963966.0, 36028797018963972.0] are represented by │ │ │ │ 36028797018963968.0.

    For more information about floats and issues with them see:

    If you need to work with exact decimal fractions, for instance to represent │ │ │ │ money, it is recommended to use a library that handles that, or work in │ │ │ │ cents instead of dollars or euros so that decimal fractions are not needed.

    Also note that Erlang's floats do not exactly match IEEE 754 floats, │ │ │ │ in that neither Inf nor NaN are supported in Erlang. Any │ │ │ │ @@ -142,52 +142,52 @@ │ │ │ │ by eight are called binaries.

    Examples:

    1> <<10,20>>.
    │ │ │ │  <<10,20>>
    │ │ │ │  2> <<"ABC">>.
    │ │ │ │  <<"ABC">>
    │ │ │ │  3> <<1:1,0:1>>.
    │ │ │ │  <<2:2>>

    The is_bitstring/1 BIF tests whether a │ │ │ │ term is a bit string, and the is_binary/1 │ │ │ │ -BIF tests whether a term is a binary.

    Examples:

    1> is_bitstring(<<1:1>>).
    │ │ │ │ +BIF tests whether a term is a binary.

    Examples:

    1> is_bitstring(<<1:1>>).
    │ │ │ │  true
    │ │ │ │ -2> is_binary(<<1:1>>).
    │ │ │ │ +2> is_binary(<<1:1>>).
    │ │ │ │  false
    │ │ │ │ -3> is_binary(<<42>>).
    │ │ │ │ +3> is_binary(<<42>>).
    │ │ │ │  true
    │ │ │ │  

    For more examples, see Programming Examples.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Reference │ │ │ │

    │ │ │ │

    A term that is unique │ │ │ │ among connected nodes. A reference is created by calling the │ │ │ │ make_ref/0 BIF. The │ │ │ │ is_reference/1 BIF tests whether a term │ │ │ │ -is a reference.

    Examples:

    1> Ref = make_ref().
    │ │ │ │ +is a reference.

    Examples:

    1> Ref = make_ref().
    │ │ │ │  #Ref<0.76482849.3801088007.198204>
    │ │ │ │ -2> is_reference(Ref).
    │ │ │ │ +2> is_reference(Ref).
    │ │ │ │  true

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Fun │ │ │ │

    │ │ │ │

    A fun is a functional object. Funs make it possible to create an anonymous │ │ │ │ function and pass the function itself — not its name — as argument to other │ │ │ │ -functions.

    Examples:

    1> Fun1 = fun (X) -> X+1 end.
    │ │ │ │ +functions.

    Examples:

    1> Fun1 = fun (X) -> X+1 end.
    │ │ │ │  #Fun<erl_eval.6.39074546>
    │ │ │ │ -2> Fun1(2).
    │ │ │ │ +2> Fun1(2).
    │ │ │ │  3

    The is_function/1 and is_function/2 │ │ │ │ -BIFs tests whether a term is a fun.

    Examples:

    1> F = fun() -> ok end.
    │ │ │ │ +BIFs tests whether a term is a fun.

    Examples:

    1> F = fun() -> ok end.
    │ │ │ │  #Fun<erl_eval.43.105768164>
    │ │ │ │ -2> is_function(F).
    │ │ │ │ +2> is_function(F).
    │ │ │ │  true
    │ │ │ │ -3> is_function(F, 0).
    │ │ │ │ +3> is_function(F, 0).
    │ │ │ │  true
    │ │ │ │ -4> is_function(F, 1).
    │ │ │ │ +4> is_function(F, 1).
    │ │ │ │  false

    Read more about funs in Fun Expressions. For more │ │ │ │ examples, see Programming Examples.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Port Identifier │ │ │ │

    │ │ │ │ @@ -205,94 +205,94 @@ │ │ │ │ for a new process after a while.

    The BIF self/0 returns the Pid of the calling process. When │ │ │ │ creating a new process, the parent │ │ │ │ process will be able to get the Pid of the child process either via the return │ │ │ │ value, as is the case when calling the spawn/3 BIF, or via │ │ │ │ a message, which is the case when calling the │ │ │ │ spawn_request/5 BIF. A Pid is typically used when │ │ │ │ when sending a process a signal. The │ │ │ │ -is_pid/1 BIF tests whether a term is a Pid.

    Example:

    -module(m).
    │ │ │ │ --export([loop/0]).
    │ │ │ │ +is_pid/1 BIF tests whether a term is a Pid.

    Example:

    -module(m).
    │ │ │ │ +-export([loop/0]).
    │ │ │ │  
    │ │ │ │ -loop() ->
    │ │ │ │ +loop() ->
    │ │ │ │      receive
    │ │ │ │          who_are_you ->
    │ │ │ │ -            io:format("I am ~p~n", [self()]),
    │ │ │ │ -            loop()
    │ │ │ │ +            io:format("I am ~p~n", [self()]),
    │ │ │ │ +            loop()
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -1> P = spawn(m, loop, []).
    │ │ │ │ +1> P = spawn(m, loop, []).
    │ │ │ │  <0.58.0>
    │ │ │ │  2> P ! who_are_you.
    │ │ │ │  I am <0.58.0>
    │ │ │ │  who_are_you

    Read more about processes in Processes.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Tuple │ │ │ │

    │ │ │ │

    A tuple is a compound data type with a fixed number of terms:

    {Term1,...,TermN}

    Each term Term in the tuple is called an element. The number of elements is │ │ │ │ -said to be the size of the tuple.

    There exists a number of BIFs to manipulate tuples.

    Examples:

    1> P = {adam,24,{july,29}}.
    │ │ │ │ -{adam,24,{july,29}}
    │ │ │ │ -2> element(1,P).
    │ │ │ │ +said to be the size of the tuple.

    There exists a number of BIFs to manipulate tuples.

    Examples:

    1> P = {adam,24,{july,29}}.
    │ │ │ │ +{adam,24,{july,29}}
    │ │ │ │ +2> element(1,P).
    │ │ │ │  adam
    │ │ │ │ -3> element(3,P).
    │ │ │ │ -{july,29}
    │ │ │ │ -4> P2 = setelement(2,P,25).
    │ │ │ │ -{adam,25,{july,29}}
    │ │ │ │ -5> tuple_size(P).
    │ │ │ │ +3> element(3,P).
    │ │ │ │ +{july,29}
    │ │ │ │ +4> P2 = setelement(2,P,25).
    │ │ │ │ +{adam,25,{july,29}}
    │ │ │ │ +5> tuple_size(P).
    │ │ │ │  3
    │ │ │ │ -6> tuple_size({}).
    │ │ │ │ +6> tuple_size({}).
    │ │ │ │  0
    │ │ │ │ -7> is_tuple({a,b,c}).
    │ │ │ │ +7> is_tuple({a,b,c}).
    │ │ │ │  true

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Map │ │ │ │

    │ │ │ │

    A map is a compound data type with a variable number of key-value associations:

    #{Key1 => Value1, ..., KeyN => ValueN}

    Each key-value association in the map is called an association pair. The key │ │ │ │ and value parts of the pair are called elements. The number of association │ │ │ │ -pairs is said to be the size of the map.

    There exists a number of BIFs to manipulate maps.

    Examples:

    1> M1 = #{name => adam, age => 24, date => {july,29}}.
    │ │ │ │ -#{age => 24,date => {july,29},name => adam}
    │ │ │ │ -2> maps:get(name, M1).
    │ │ │ │ +pairs is said to be the size of the map.

    There exists a number of BIFs to manipulate maps.

    Examples:

    1> M1 = #{name => adam, age => 24, date => {july,29}}.
    │ │ │ │ +#{age => 24,date => {july,29},name => adam}
    │ │ │ │ +2> maps:get(name, M1).
    │ │ │ │  adam
    │ │ │ │ -3> maps:get(date, M1).
    │ │ │ │ -{july,29}
    │ │ │ │ -4> M2 = maps:update(age, 25, M1).
    │ │ │ │ -#{age => 25,date => {july,29},name => adam}
    │ │ │ │ -5> map_size(M).
    │ │ │ │ +3> maps:get(date, M1).
    │ │ │ │ +{july,29}
    │ │ │ │ +4> M2 = maps:update(age, 25, M1).
    │ │ │ │ +#{age => 25,date => {july,29},name => adam}
    │ │ │ │ +5> map_size(M).
    │ │ │ │  3
    │ │ │ │ -6> map_size(#{}).
    │ │ │ │ +6> map_size(#{}).
    │ │ │ │  0

    A collection of maps processing functions are found in module maps │ │ │ │ in STDLIB.

    Read more about maps in Map Expressions.

    Change

    Maps were introduced as an experimental feature in Erlang/OTP R17. Their │ │ │ │ functionality was extended and became fully supported in Erlang/OTP 18.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ List │ │ │ │

    │ │ │ │

    A list is a compound data type with a variable number of terms.

    [Term1,...,TermN]

    Each term Term in the list is called an element. The number of elements is │ │ │ │ said to be the length of the list.

    Formally, a list is either the empty list [] or consists of a head (first │ │ │ │ element) and a tail (remainder of the list). The tail is also a list. The │ │ │ │ latter can be expressed as [H|T]. The notation [Term1,...,TermN] above is │ │ │ │ equivalent with the list [Term1|[...|[TermN|[]]]].

    Example:

    [] is a list, thus
    [c|[]] is a list, thus
    [b|[c|[]]] is a list, thus
    [a|[b|[c|[]]]] is a list, or in short [a,b,c]

    A list where the tail is a list is sometimes called a proper list. It is │ │ │ │ allowed to have a list where the tail is not a list, for example, [a|b]. │ │ │ │ -However, this type of list is of little practical use.

    Examples:

    1> L1 = [a,2,{c,4}].
    │ │ │ │ -[a,2,{c,4}]
    │ │ │ │ -2> [H|T] = L1.
    │ │ │ │ -[a,2,{c,4}]
    │ │ │ │ +However, this type of list is of little practical use.

    Examples:

    1> L1 = [a,2,{c,4}].
    │ │ │ │ +[a,2,{c,4}]
    │ │ │ │ +2> [H|T] = L1.
    │ │ │ │ +[a,2,{c,4}]
    │ │ │ │  3> H.
    │ │ │ │  a
    │ │ │ │  4> T.
    │ │ │ │ -[2,{c,4}]
    │ │ │ │ -5> L2 = [d|T].
    │ │ │ │ -[d,2,{c,4}]
    │ │ │ │ -6> length(L1).
    │ │ │ │ +[2,{c,4}]
    │ │ │ │ +5> L2 = [d|T].
    │ │ │ │ +[d,2,{c,4}]
    │ │ │ │ +6> length(L1).
    │ │ │ │  3
    │ │ │ │ -7> length([]).
    │ │ │ │ +7> length([]).
    │ │ │ │  0

    A collection of list processing functions are found in module │ │ │ │ lists in STDLIB.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ String │ │ │ │

    │ │ │ │ @@ -412,41 +412,41 @@ │ │ │ │ Record │ │ │ │ │ │ │ │

    A record is a data structure for storing a fixed number of elements. It has │ │ │ │ named fields and is similar to a struct in C. However, a record is not a true │ │ │ │ data type. Instead, record expressions are translated to tuple expressions │ │ │ │ during compilation. Therefore, record expressions are not understood by the │ │ │ │ shell unless special actions are taken. For details, see module shell │ │ │ │ -in STDLIB.

    Examples:

    -module(person).
    │ │ │ │ --export([new/2]).
    │ │ │ │ +in STDLIB.

    Examples:

    -module(person).
    │ │ │ │ +-export([new/2]).
    │ │ │ │  
    │ │ │ │ --record(person, {name, age}).
    │ │ │ │ +-record(person, {name, age}).
    │ │ │ │  
    │ │ │ │ -new(Name, Age) ->
    │ │ │ │ -    #person{name=Name, age=Age}.
    │ │ │ │ +new(Name, Age) ->
    │ │ │ │ +    #person{name=Name, age=Age}.
    │ │ │ │  
    │ │ │ │ -1> person:new(ernie, 44).
    │ │ │ │ -{person,ernie,44}

    Read more about records in Records. More examples are │ │ │ │ +1> person:new(ernie, 44). │ │ │ │ +{person,ernie,44}

    Read more about records in Records. More examples are │ │ │ │ found in Programming Examples.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Boolean │ │ │ │

    │ │ │ │

    There is no Boolean data type in Erlang. Instead the atoms true and false │ │ │ │ are used to denote Boolean values. The is_boolean/1 │ │ │ │ BIF tests whether a term is a boolean.

    Examples:

    1> 2 =< 3.
    │ │ │ │  true
    │ │ │ │  2> true or false.
    │ │ │ │  true
    │ │ │ │ -3> is_boolean(true).
    │ │ │ │ +3> is_boolean(true).
    │ │ │ │  true
    │ │ │ │ -4> is_boolean(false).
    │ │ │ │ +4> is_boolean(false).
    │ │ │ │  true
    │ │ │ │ -5> is_boolean(ok).
    │ │ │ │ +5> is_boolean(ok).
    │ │ │ │  false

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Escape Sequences │ │ │ │

    │ │ │ │

    Within strings ("-delimited), quoted atoms, and the content of │ │ │ │ @@ -464,44 +464,44 @@ │ │ │ │ ~b or ~s sigils the escape sequences for normal │ │ │ │ strings, above, are used.

    Change

    Triple-quoted strings and sigils were introduced in Erlang/OTP 27.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Type Conversions │ │ │ │

    │ │ │ │ -

    There are a number of BIFs for type conversions.

    Examples:

    1> atom_to_list(hello).
    │ │ │ │ +

    There are a number of BIFs for type conversions.

    Examples:

    1> atom_to_list(hello).
    │ │ │ │  "hello"
    │ │ │ │ -2> list_to_atom("hello").
    │ │ │ │ +2> list_to_atom("hello").
    │ │ │ │  hello
    │ │ │ │ -3> binary_to_list(<<"hello">>).
    │ │ │ │ +3> binary_to_list(<<"hello">>).
    │ │ │ │  "hello"
    │ │ │ │ -4> binary_to_list(<<104,101,108,108,111>>).
    │ │ │ │ +4> binary_to_list(<<104,101,108,108,111>>).
    │ │ │ │  "hello"
    │ │ │ │ -5> list_to_binary("hello").
    │ │ │ │ -<<104,101,108,108,111>>
    │ │ │ │ -6> float_to_list(7.0).
    │ │ │ │ +5> list_to_binary("hello").
    │ │ │ │ +<<104,101,108,108,111>>
    │ │ │ │ +6> float_to_list(7.0).
    │ │ │ │  "7.00000000000000000000e+00"
    │ │ │ │ -7> list_to_float("7.000e+00").
    │ │ │ │ +7> list_to_float("7.000e+00").
    │ │ │ │  7.0
    │ │ │ │ -8> integer_to_list(77).
    │ │ │ │ +8> integer_to_list(77).
    │ │ │ │  "77"
    │ │ │ │ -9> list_to_integer("77").
    │ │ │ │ +9> list_to_integer("77").
    │ │ │ │  77
    │ │ │ │ -10> tuple_to_list({a,b,c}).
    │ │ │ │ -[a,b,c]
    │ │ │ │ -11> list_to_tuple([a,b,c]).
    │ │ │ │ -{a,b,c}
    │ │ │ │ -12> term_to_binary({a,b,c}).
    │ │ │ │ -<<131,104,3,100,0,1,97,100,0,1,98,100,0,1,99>>
    │ │ │ │ -13> binary_to_term(<<131,104,3,100,0,1,97,100,0,1,98,100,0,1,99>>).
    │ │ │ │ -{a,b,c}
    │ │ │ │ -14> binary_to_integer(<<"77">>).
    │ │ │ │ +10> tuple_to_list({a,b,c}).
    │ │ │ │ +[a,b,c]
    │ │ │ │ +11> list_to_tuple([a,b,c]).
    │ │ │ │ +{a,b,c}
    │ │ │ │ +12> term_to_binary({a,b,c}).
    │ │ │ │ +<<131,104,3,100,0,1,97,100,0,1,98,100,0,1,99>>
    │ │ │ │ +13> binary_to_term(<<131,104,3,100,0,1,97,100,0,1,98,100,0,1,99>>).
    │ │ │ │ +{a,b,c}
    │ │ │ │ +14> binary_to_integer(<<"77">>).
    │ │ │ │  77
    │ │ │ │ -15> integer_to_binary(77).
    │ │ │ │ -<<"77">>
    │ │ │ │ -16> float_to_binary(7.0).
    │ │ │ │ -<<"7.00000000000000000000e+00">>
    │ │ │ │ -17> binary_to_float(<<"7.000e+00">>).
    │ │ │ │ +15> integer_to_binary(77).
    │ │ │ │ +<<"77">>
    │ │ │ │ +16> float_to_binary(7.0).
    │ │ │ │ +<<"7.00000000000000000000e+00">>
    │ │ │ │ +17> binary_to_float(<<"7.000e+00">>).
    │ │ │ │  7.0
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/create_target.xhtml │ │ │ │ @@ -43,21 +43,21 @@ │ │ │ │ Creating a Target System │ │ │ │ │ │ │ │

    It is assumed that you have a working Erlang/OTP system structured according to │ │ │ │ the OTP design principles.

    Step 1. Create a .rel file (see the rel(4) manual page in │ │ │ │ SASL), which specifies the ERTS version and lists all applications that are to │ │ │ │ be included in the new basic target system. An example is the following │ │ │ │ mysystem.rel file:

    %% mysystem.rel
    │ │ │ │ -{release,
    │ │ │ │ - {"MYSYSTEM", "FIRST"},
    │ │ │ │ - {erts, "5.10.4"},
    │ │ │ │ - [{kernel, "2.16.4"},
    │ │ │ │ -  {stdlib, "1.19.4"},
    │ │ │ │ -  {sasl, "2.3.4"},
    │ │ │ │ -  {pea, "1.0"}]}.

    The listed applications are not only original Erlang/OTP applications but │ │ │ │ +{release, │ │ │ │ + {"MYSYSTEM", "FIRST"}, │ │ │ │ + {erts, "5.10.4"}, │ │ │ │ + [{kernel, "2.16.4"}, │ │ │ │ + {stdlib, "1.19.4"}, │ │ │ │ + {sasl, "2.3.4"}, │ │ │ │ + {pea, "1.0"}]}.

    The listed applications are not only original Erlang/OTP applications but │ │ │ │ possibly also new applications that you have written (here exemplified by the │ │ │ │ application Pea (pea)).

    Step 2. Start Erlang/OTP from the directory where the mysystem.rel file │ │ │ │ resides:

    % erl -pa /home/user/target_system/myapps/pea-1.0/ebin

    The -pa argument prepends the path to the ebin directory for │ │ │ │ the Pea application to the code path.

    Step 3. Create the target system:

    1> target_system:create("mysystem").

    The function target_system:create/1 performs the following:

    1. Reads the file mysystem.rel and creates a new file plain.rel. │ │ │ │ The new file is identical to the original, except that it only │ │ │ │ lists the Kernel and STDLIB applications.

    2. From the files mysystem.rel and plain.rel creates the files │ │ │ │ mysystem.script, mysystem.boot, plain.script, and plain.boot │ │ │ │ @@ -147,25 +147,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Creating the Next Version │ │ │ │ │ │ │ │

      In this example the Pea application has been changed, and so are the │ │ │ │ applications ERTS, Kernel, STDLIB and SASL.

      Step 1. Create the file .rel:

      %% mysystem2.rel
      │ │ │ │ -{release,
      │ │ │ │ - {"MYSYSTEM", "SECOND"},
      │ │ │ │ - {erts, "6.0"},
      │ │ │ │ - [{kernel, "3.0"},
      │ │ │ │ -  {stdlib, "2.0"},
      │ │ │ │ -  {sasl, "2.4"},
      │ │ │ │ -  {pea, "2.0"}]}.

      Step 2. Create the application upgrade file (see │ │ │ │ +{release, │ │ │ │ + {"MYSYSTEM", "SECOND"}, │ │ │ │ + {erts, "6.0"}, │ │ │ │ + [{kernel, "3.0"}, │ │ │ │ + {stdlib, "2.0"}, │ │ │ │ + {sasl, "2.4"}, │ │ │ │ + {pea, "2.0"}]}.

    Step 2. Create the application upgrade file (see │ │ │ │ appup in SASL) for Pea, for example:

    %% pea.appup
    │ │ │ │ -{"2.0",
    │ │ │ │ - [{"1.0",[{load_module,pea_lib}]}],
    │ │ │ │ - [{"1.0",[{load_module,pea_lib}]}]}.

    Step 3. From the directory where the file mysystem2.rel resides, start the │ │ │ │ +{"2.0", │ │ │ │ + [{"1.0",[{load_module,pea_lib}]}], │ │ │ │ + [{"1.0",[{load_module,pea_lib}]}]}.

    Step 3. From the directory where the file mysystem2.rel resides, start the │ │ │ │ Erlang/OTP system, giving the path to the new version of Pea:

    % erl -pa /home/user/target_system/myapps/pea-2.0/ebin

    Step 4. Create the release upgrade file (see relup │ │ │ │ in SASL):

    1> systools:make_relup("mysystem2",["mysystem"],["mysystem"],
    │ │ │ │      [{path,["/home/user/target_system/myapps/pea-1.0/ebin",
    │ │ │ │      "/my/old/erlang/lib/*/ebin"]}]).

    Here "mysystem" is the base release and "mysystem2" is the release to │ │ │ │ upgrade to.

    The path option is used for pointing out the old version of all applications. │ │ │ │ (The new versions are already in the code path - assuming of course that the │ │ │ │ Erlang node on which this is executed is running the correct version of │ │ │ │ @@ -197,21 +197,21 @@ │ │ │ │ {continue_after_restart,"FIRST",[]} │ │ │ │ heart: Tue Apr 1 12:15:10 2014: Erlang has closed. │ │ │ │ heart: Tue Apr 1 12:15:11 2014: Executed "/usr/local/erl-target/bin/start /usr/local/erl-target/releases/new_start_erl.data" -> 0. Terminating. │ │ │ │ [End]

    The above return value and output after the call to │ │ │ │ release_handler:install_release/1 means that the release_handler has │ │ │ │ restarted the node by using heart. This is always done when the upgrade │ │ │ │ involves a change of the applications ERTS, Kernel, STDLIB, or SASL. For more │ │ │ │ -information, see Upgrade when Erlang/OTP has Changed.

    The node is accessible through a new pipe:

    % /usr/local/erl-target/bin/to_erl /tmp/erlang.pipe.2

    List the available releases in the system:

    1> release_handler:which_releases().
    │ │ │ │ -[{"MYSYSTEM","SECOND",
    │ │ │ │ -  ["kernel-3.0","stdlib-2.0","sasl-2.4","pea-2.0"],
    │ │ │ │ -  current},
    │ │ │ │ - {"MYSYSTEM","FIRST",
    │ │ │ │ -  ["kernel-2.16.4","stdlib-1.19.4","sasl-2.3.4","pea-1.0"],
    │ │ │ │ -  permanent}]

    Our new release, "SECOND", is now the current release, but we can also see that │ │ │ │ +information, see Upgrade when Erlang/OTP has Changed.

    The node is accessible through a new pipe:

    % /usr/local/erl-target/bin/to_erl /tmp/erlang.pipe.2

    List the available releases in the system:

    1> release_handler:which_releases().
    │ │ │ │ +[{"MYSYSTEM","SECOND",
    │ │ │ │ +  ["kernel-3.0","stdlib-2.0","sasl-2.4","pea-2.0"],
    │ │ │ │ +  current},
    │ │ │ │ + {"MYSYSTEM","FIRST",
    │ │ │ │ +  ["kernel-2.16.4","stdlib-1.19.4","sasl-2.3.4","pea-1.0"],
    │ │ │ │ +  permanent}]

    Our new release, "SECOND", is now the current release, but we can also see that │ │ │ │ our "FIRST" release is still permanent. This means that if the node would be │ │ │ │ restarted now, it would come up running the "FIRST" release again.

    Step 3. Make the new release permanent:

    2> release_handler:make_permanent("SECOND").

    Check the releases again:

    3> release_handler:which_releases().
    │ │ │ │  [{"MYSYSTEM","SECOND",
    │ │ │ │    ["kernel-3.0","stdlib-2.0","sasl-2.4","pea-2.0"],
    │ │ │ │    permanent},
    │ │ │ │   {"MYSYSTEM","FIRST",
    │ │ │ │    ["kernel-2.16.4","stdlib-1.19.4","sasl-2.3.4","pea-1.0"],
    │ │ │ │ @@ -220,264 +220,264 @@
    │ │ │ │    
    │ │ │ │      
    │ │ │ │    
    │ │ │ │    Listing of target_system.erl
    │ │ │ │  
    │ │ │ │  

    This module can also be found in the examples directory of the SASL │ │ │ │ application.

    
    │ │ │ │ --module(target_system).
    │ │ │ │ --export([create/1, create/2, install/2]).
    │ │ │ │ +-module(target_system).
    │ │ │ │ +-export([create/1, create/2, install/2]).
    │ │ │ │  
    │ │ │ │  %% Note: RelFileName below is the *stem* without trailing .rel,
    │ │ │ │  %% .script etc.
    │ │ │ │  %%
    │ │ │ │  
    │ │ │ │  %% create(RelFileName)
    │ │ │ │  %%
    │ │ │ │ -create(RelFileName) ->
    │ │ │ │ -    create(RelFileName,[]).
    │ │ │ │ +create(RelFileName) ->
    │ │ │ │ +    create(RelFileName,[]).
    │ │ │ │  
    │ │ │ │ -create(RelFileName,SystoolsOpts) ->
    │ │ │ │ +create(RelFileName,SystoolsOpts) ->
    │ │ │ │      RelFile = RelFileName ++ ".rel",
    │ │ │ │ -    Dir = filename:dirname(RelFileName),
    │ │ │ │ -    PlainRelFileName = filename:join(Dir,"plain"),
    │ │ │ │ +    Dir = filename:dirname(RelFileName),
    │ │ │ │ +    PlainRelFileName = filename:join(Dir,"plain"),
    │ │ │ │      PlainRelFile = PlainRelFileName ++ ".rel",
    │ │ │ │ -    io:fwrite("Reading file: ~ts ...~n", [RelFile]),
    │ │ │ │ -    {ok, [RelSpec]} = file:consult(RelFile),
    │ │ │ │ -    io:fwrite("Creating file: ~ts from ~ts ...~n",
    │ │ │ │ -              [PlainRelFile, RelFile]),
    │ │ │ │ -    {release,
    │ │ │ │ -     {RelName, RelVsn},
    │ │ │ │ -     {erts, ErtsVsn},
    │ │ │ │ -     AppVsns} = RelSpec,
    │ │ │ │ -    PlainRelSpec = {release,
    │ │ │ │ -                    {RelName, RelVsn},
    │ │ │ │ -                    {erts, ErtsVsn},
    │ │ │ │ -                    lists:filter(fun({kernel, _}) ->
    │ │ │ │ +    io:fwrite("Reading file: ~ts ...~n", [RelFile]),
    │ │ │ │ +    {ok, [RelSpec]} = file:consult(RelFile),
    │ │ │ │ +    io:fwrite("Creating file: ~ts from ~ts ...~n",
    │ │ │ │ +              [PlainRelFile, RelFile]),
    │ │ │ │ +    {release,
    │ │ │ │ +     {RelName, RelVsn},
    │ │ │ │ +     {erts, ErtsVsn},
    │ │ │ │ +     AppVsns} = RelSpec,
    │ │ │ │ +    PlainRelSpec = {release,
    │ │ │ │ +                    {RelName, RelVsn},
    │ │ │ │ +                    {erts, ErtsVsn},
    │ │ │ │ +                    lists:filter(fun({kernel, _}) ->
    │ │ │ │                                           true;
    │ │ │ │ -                                    ({stdlib, _}) ->
    │ │ │ │ +                                    ({stdlib, _}) ->
    │ │ │ │                                           true;
    │ │ │ │ -                                    (_) ->
    │ │ │ │ +                                    (_) ->
    │ │ │ │                                           false
    │ │ │ │ -                                 end, AppVsns)
    │ │ │ │ -                   },
    │ │ │ │ -    {ok, Fd} = file:open(PlainRelFile, [write]),
    │ │ │ │ -    io:fwrite(Fd, "~p.~n", [PlainRelSpec]),
    │ │ │ │ -    file:close(Fd),
    │ │ │ │ -
    │ │ │ │ -    io:fwrite("Making \"~ts.script\" and \"~ts.boot\" files ...~n",
    │ │ │ │ -	      [PlainRelFileName,PlainRelFileName]),
    │ │ │ │ -    make_script(PlainRelFileName,SystoolsOpts),
    │ │ │ │ -
    │ │ │ │ -    io:fwrite("Making \"~ts.script\" and \"~ts.boot\" files ...~n",
    │ │ │ │ -              [RelFileName, RelFileName]),
    │ │ │ │ -    make_script(RelFileName,SystoolsOpts),
    │ │ │ │ +                                 end, AppVsns)
    │ │ │ │ +                   },
    │ │ │ │ +    {ok, Fd} = file:open(PlainRelFile, [write]),
    │ │ │ │ +    io:fwrite(Fd, "~p.~n", [PlainRelSpec]),
    │ │ │ │ +    file:close(Fd),
    │ │ │ │ +
    │ │ │ │ +    io:fwrite("Making \"~ts.script\" and \"~ts.boot\" files ...~n",
    │ │ │ │ +	      [PlainRelFileName,PlainRelFileName]),
    │ │ │ │ +    make_script(PlainRelFileName,SystoolsOpts),
    │ │ │ │ +
    │ │ │ │ +    io:fwrite("Making \"~ts.script\" and \"~ts.boot\" files ...~n",
    │ │ │ │ +              [RelFileName, RelFileName]),
    │ │ │ │ +    make_script(RelFileName,SystoolsOpts),
    │ │ │ │  
    │ │ │ │      TarFileName = RelFileName ++ ".tar.gz",
    │ │ │ │ -    io:fwrite("Creating tar file ~ts ...~n", [TarFileName]),
    │ │ │ │ -    make_tar(RelFileName,SystoolsOpts),
    │ │ │ │ +    io:fwrite("Creating tar file ~ts ...~n", [TarFileName]),
    │ │ │ │ +    make_tar(RelFileName,SystoolsOpts),
    │ │ │ │  
    │ │ │ │ -    TmpDir = filename:join(Dir,"tmp"),
    │ │ │ │ -    io:fwrite("Creating directory ~tp ...~n",[TmpDir]),
    │ │ │ │ -    file:make_dir(TmpDir),
    │ │ │ │ -
    │ │ │ │ -    io:fwrite("Extracting ~ts into directory ~ts ...~n", [TarFileName,TmpDir]),
    │ │ │ │ -    extract_tar(TarFileName, TmpDir),
    │ │ │ │ -
    │ │ │ │ -    TmpBinDir = filename:join([TmpDir, "bin"]),
    │ │ │ │ -    ErtsBinDir = filename:join([TmpDir, "erts-" ++ ErtsVsn, "bin"]),
    │ │ │ │ -    io:fwrite("Deleting \"erl\" and \"start\" in directory ~ts ...~n",
    │ │ │ │ -              [ErtsBinDir]),
    │ │ │ │ -    file:delete(filename:join([ErtsBinDir, "erl"])),
    │ │ │ │ -    file:delete(filename:join([ErtsBinDir, "start"])),
    │ │ │ │ -
    │ │ │ │ -    io:fwrite("Creating temporary directory ~ts ...~n", [TmpBinDir]),
    │ │ │ │ -    file:make_dir(TmpBinDir),
    │ │ │ │ -
    │ │ │ │ -    io:fwrite("Copying file \"~ts.boot\" to ~ts ...~n",
    │ │ │ │ -              [PlainRelFileName, filename:join([TmpBinDir, "start.boot"])]),
    │ │ │ │ -    copy_file(PlainRelFileName++".boot",filename:join([TmpBinDir, "start.boot"])),
    │ │ │ │ +    TmpDir = filename:join(Dir,"tmp"),
    │ │ │ │ +    io:fwrite("Creating directory ~tp ...~n",[TmpDir]),
    │ │ │ │ +    file:make_dir(TmpDir),
    │ │ │ │ +
    │ │ │ │ +    io:fwrite("Extracting ~ts into directory ~ts ...~n", [TarFileName,TmpDir]),
    │ │ │ │ +    extract_tar(TarFileName, TmpDir),
    │ │ │ │ +
    │ │ │ │ +    TmpBinDir = filename:join([TmpDir, "bin"]),
    │ │ │ │ +    ErtsBinDir = filename:join([TmpDir, "erts-" ++ ErtsVsn, "bin"]),
    │ │ │ │ +    io:fwrite("Deleting \"erl\" and \"start\" in directory ~ts ...~n",
    │ │ │ │ +              [ErtsBinDir]),
    │ │ │ │ +    file:delete(filename:join([ErtsBinDir, "erl"])),
    │ │ │ │ +    file:delete(filename:join([ErtsBinDir, "start"])),
    │ │ │ │ +
    │ │ │ │ +    io:fwrite("Creating temporary directory ~ts ...~n", [TmpBinDir]),
    │ │ │ │ +    file:make_dir(TmpBinDir),
    │ │ │ │ +
    │ │ │ │ +    io:fwrite("Copying file \"~ts.boot\" to ~ts ...~n",
    │ │ │ │ +              [PlainRelFileName, filename:join([TmpBinDir, "start.boot"])]),
    │ │ │ │ +    copy_file(PlainRelFileName++".boot",filename:join([TmpBinDir, "start.boot"])),
    │ │ │ │  
    │ │ │ │ -    io:fwrite("Copying files \"epmd\", \"run_erl\" and \"to_erl\" from \n"
    │ │ │ │ +    io:fwrite("Copying files \"epmd\", \"run_erl\" and \"to_erl\" from \n"
    │ │ │ │                "~ts to ~ts ...~n",
    │ │ │ │ -              [ErtsBinDir, TmpBinDir]),
    │ │ │ │ -    copy_file(filename:join([ErtsBinDir, "epmd"]),
    │ │ │ │ -              filename:join([TmpBinDir, "epmd"]), [preserve]),
    │ │ │ │ -    copy_file(filename:join([ErtsBinDir, "run_erl"]),
    │ │ │ │ -              filename:join([TmpBinDir, "run_erl"]), [preserve]),
    │ │ │ │ -    copy_file(filename:join([ErtsBinDir, "to_erl"]),
    │ │ │ │ -              filename:join([TmpBinDir, "to_erl"]), [preserve]),
    │ │ │ │ +              [ErtsBinDir, TmpBinDir]),
    │ │ │ │ +    copy_file(filename:join([ErtsBinDir, "epmd"]),
    │ │ │ │ +              filename:join([TmpBinDir, "epmd"]), [preserve]),
    │ │ │ │ +    copy_file(filename:join([ErtsBinDir, "run_erl"]),
    │ │ │ │ +              filename:join([TmpBinDir, "run_erl"]), [preserve]),
    │ │ │ │ +    copy_file(filename:join([ErtsBinDir, "to_erl"]),
    │ │ │ │ +              filename:join([TmpBinDir, "to_erl"]), [preserve]),
    │ │ │ │  
    │ │ │ │      %% This is needed if 'start' script created from 'start.src' shall
    │ │ │ │      %% be used as it points out this directory as log dir for 'run_erl'
    │ │ │ │ -    TmpLogDir = filename:join([TmpDir, "log"]),
    │ │ │ │ -    io:fwrite("Creating temporary directory ~ts ...~n", [TmpLogDir]),
    │ │ │ │ -    ok = file:make_dir(TmpLogDir),
    │ │ │ │ -
    │ │ │ │ -    StartErlDataFile = filename:join([TmpDir, "releases", "start_erl.data"]),
    │ │ │ │ -    io:fwrite("Creating ~ts ...~n", [StartErlDataFile]),
    │ │ │ │ -    StartErlData = io_lib:fwrite("~s ~s~n", [ErtsVsn, RelVsn]),
    │ │ │ │ -    write_file(StartErlDataFile, StartErlData),
    │ │ │ │ -
    │ │ │ │ -    io:fwrite("Recreating tar file ~ts from contents in directory ~ts ...~n",
    │ │ │ │ -	      [TarFileName,TmpDir]),
    │ │ │ │ -    {ok, Tar} = erl_tar:open(TarFileName, [write, compressed]),
    │ │ │ │ +    TmpLogDir = filename:join([TmpDir, "log"]),
    │ │ │ │ +    io:fwrite("Creating temporary directory ~ts ...~n", [TmpLogDir]),
    │ │ │ │ +    ok = file:make_dir(TmpLogDir),
    │ │ │ │ +
    │ │ │ │ +    StartErlDataFile = filename:join([TmpDir, "releases", "start_erl.data"]),
    │ │ │ │ +    io:fwrite("Creating ~ts ...~n", [StartErlDataFile]),
    │ │ │ │ +    StartErlData = io_lib:fwrite("~s ~s~n", [ErtsVsn, RelVsn]),
    │ │ │ │ +    write_file(StartErlDataFile, StartErlData),
    │ │ │ │ +
    │ │ │ │ +    io:fwrite("Recreating tar file ~ts from contents in directory ~ts ...~n",
    │ │ │ │ +	      [TarFileName,TmpDir]),
    │ │ │ │ +    {ok, Tar} = erl_tar:open(TarFileName, [write, compressed]),
    │ │ │ │      %% {ok, Cwd} = file:get_cwd(),
    │ │ │ │      %% file:set_cwd("tmp"),
    │ │ │ │      ErtsDir = "erts-"++ErtsVsn,
    │ │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,"bin"), "bin", []),
    │ │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,ErtsDir), ErtsDir, []),
    │ │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,"releases"), "releases", []),
    │ │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,"lib"), "lib", []),
    │ │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,"log"), "log", []),
    │ │ │ │ -    erl_tar:close(Tar),
    │ │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,"bin"), "bin", []),
    │ │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,ErtsDir), ErtsDir, []),
    │ │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,"releases"), "releases", []),
    │ │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,"lib"), "lib", []),
    │ │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,"log"), "log", []),
    │ │ │ │ +    erl_tar:close(Tar),
    │ │ │ │      %% file:set_cwd(Cwd),
    │ │ │ │ -    io:fwrite("Removing directory ~ts ...~n",[TmpDir]),
    │ │ │ │ -    remove_dir_tree(TmpDir),
    │ │ │ │ +    io:fwrite("Removing directory ~ts ...~n",[TmpDir]),
    │ │ │ │ +    remove_dir_tree(TmpDir),
    │ │ │ │      ok.
    │ │ │ │  
    │ │ │ │  
    │ │ │ │ -install(RelFileName, RootDir) ->
    │ │ │ │ +install(RelFileName, RootDir) ->
    │ │ │ │      TarFile = RelFileName ++ ".tar.gz",
    │ │ │ │ -    io:fwrite("Extracting ~ts ...~n", [TarFile]),
    │ │ │ │ -    extract_tar(TarFile, RootDir),
    │ │ │ │ -    StartErlDataFile = filename:join([RootDir, "releases", "start_erl.data"]),
    │ │ │ │ -    {ok, StartErlData} = read_txt_file(StartErlDataFile),
    │ │ │ │ -    [ErlVsn, _RelVsn| _] = string:tokens(StartErlData, " \n"),
    │ │ │ │ -    ErtsBinDir = filename:join([RootDir, "erts-" ++ ErlVsn, "bin"]),
    │ │ │ │ -    BinDir = filename:join([RootDir, "bin"]),
    │ │ │ │ -    io:fwrite("Substituting in erl.src, start.src and start_erl.src to "
    │ │ │ │ -              "form erl, start and start_erl ...\n"),
    │ │ │ │ -    subst_src_scripts(["erl", "start", "start_erl"], ErtsBinDir, BinDir,
    │ │ │ │ -                      [{"FINAL_ROOTDIR", RootDir}, {"EMU", "beam"}],
    │ │ │ │ -                      [preserve]),
    │ │ │ │ +    io:fwrite("Extracting ~ts ...~n", [TarFile]),
    │ │ │ │ +    extract_tar(TarFile, RootDir),
    │ │ │ │ +    StartErlDataFile = filename:join([RootDir, "releases", "start_erl.data"]),
    │ │ │ │ +    {ok, StartErlData} = read_txt_file(StartErlDataFile),
    │ │ │ │ +    [ErlVsn, _RelVsn| _] = string:tokens(StartErlData, " \n"),
    │ │ │ │ +    ErtsBinDir = filename:join([RootDir, "erts-" ++ ErlVsn, "bin"]),
    │ │ │ │ +    BinDir = filename:join([RootDir, "bin"]),
    │ │ │ │ +    io:fwrite("Substituting in erl.src, start.src and start_erl.src to "
    │ │ │ │ +              "form erl, start and start_erl ...\n"),
    │ │ │ │ +    subst_src_scripts(["erl", "start", "start_erl"], ErtsBinDir, BinDir,
    │ │ │ │ +                      [{"FINAL_ROOTDIR", RootDir}, {"EMU", "beam"}],
    │ │ │ │ +                      [preserve]),
    │ │ │ │      %%! Workaround for pre OTP 17.0: start.src and start_erl.src did
    │ │ │ │      %%! not have correct permissions, so the above 'preserve' option did not help
    │ │ │ │ -    ok = file:change_mode(filename:join(BinDir,"start"),8#0755),
    │ │ │ │ -    ok = file:change_mode(filename:join(BinDir,"start_erl"),8#0755),
    │ │ │ │ +    ok = file:change_mode(filename:join(BinDir,"start"),8#0755),
    │ │ │ │ +    ok = file:change_mode(filename:join(BinDir,"start_erl"),8#0755),
    │ │ │ │  
    │ │ │ │ -    io:fwrite("Creating the RELEASES file ...\n"),
    │ │ │ │ -    create_RELEASES(RootDir, filename:join([RootDir, "releases",
    │ │ │ │ -					    filename:basename(RelFileName)])).
    │ │ │ │ +    io:fwrite("Creating the RELEASES file ...\n"),
    │ │ │ │ +    create_RELEASES(RootDir, filename:join([RootDir, "releases",
    │ │ │ │ +					    filename:basename(RelFileName)])).
    │ │ │ │  
    │ │ │ │  %% LOCALS
    │ │ │ │  
    │ │ │ │  %% make_script(RelFileName,Opts)
    │ │ │ │  %%
    │ │ │ │ -make_script(RelFileName,Opts) ->
    │ │ │ │ -    systools:make_script(RelFileName, [no_module_tests,
    │ │ │ │ -				       {outdir,filename:dirname(RelFileName)}
    │ │ │ │ -				       |Opts]).
    │ │ │ │ +make_script(RelFileName,Opts) ->
    │ │ │ │ +    systools:make_script(RelFileName, [no_module_tests,
    │ │ │ │ +				       {outdir,filename:dirname(RelFileName)}
    │ │ │ │ +				       |Opts]).
    │ │ │ │  
    │ │ │ │  %% make_tar(RelFileName,Opts)
    │ │ │ │  %%
    │ │ │ │ -make_tar(RelFileName,Opts) ->
    │ │ │ │ -    RootDir = code:root_dir(),
    │ │ │ │ -    systools:make_tar(RelFileName, [{erts, RootDir},
    │ │ │ │ -				    {outdir,filename:dirname(RelFileName)}
    │ │ │ │ -				    |Opts]).
    │ │ │ │ +make_tar(RelFileName,Opts) ->
    │ │ │ │ +    RootDir = code:root_dir(),
    │ │ │ │ +    systools:make_tar(RelFileName, [{erts, RootDir},
    │ │ │ │ +				    {outdir,filename:dirname(RelFileName)}
    │ │ │ │ +				    |Opts]).
    │ │ │ │  
    │ │ │ │  %% extract_tar(TarFile, DestDir)
    │ │ │ │  %%
    │ │ │ │ -extract_tar(TarFile, DestDir) ->
    │ │ │ │ -    erl_tar:extract(TarFile, [{cwd, DestDir}, compressed]).
    │ │ │ │ +extract_tar(TarFile, DestDir) ->
    │ │ │ │ +    erl_tar:extract(TarFile, [{cwd, DestDir}, compressed]).
    │ │ │ │  
    │ │ │ │ -create_RELEASES(DestDir, RelFileName) ->
    │ │ │ │ -    release_handler:create_RELEASES(DestDir, RelFileName ++ ".rel").
    │ │ │ │ +create_RELEASES(DestDir, RelFileName) ->
    │ │ │ │ +    release_handler:create_RELEASES(DestDir, RelFileName ++ ".rel").
    │ │ │ │  
    │ │ │ │ -subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) ->
    │ │ │ │ -    lists:foreach(fun(Script) ->
    │ │ │ │ -                          subst_src_script(Script, SrcDir, DestDir,
    │ │ │ │ -                                           Vars, Opts)
    │ │ │ │ -                  end, Scripts).
    │ │ │ │ -
    │ │ │ │ -subst_src_script(Script, SrcDir, DestDir, Vars, Opts) ->
    │ │ │ │ -    subst_file(filename:join([SrcDir, Script ++ ".src"]),
    │ │ │ │ -               filename:join([DestDir, Script]),
    │ │ │ │ -               Vars, Opts).
    │ │ │ │ -
    │ │ │ │ -subst_file(Src, Dest, Vars, Opts) ->
    │ │ │ │ -    {ok, Conts} = read_txt_file(Src),
    │ │ │ │ -    NConts = subst(Conts, Vars),
    │ │ │ │ -    write_file(Dest, NConts),
    │ │ │ │ -    case lists:member(preserve, Opts) of
    │ │ │ │ +subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) ->
    │ │ │ │ +    lists:foreach(fun(Script) ->
    │ │ │ │ +                          subst_src_script(Script, SrcDir, DestDir,
    │ │ │ │ +                                           Vars, Opts)
    │ │ │ │ +                  end, Scripts).
    │ │ │ │ +
    │ │ │ │ +subst_src_script(Script, SrcDir, DestDir, Vars, Opts) ->
    │ │ │ │ +    subst_file(filename:join([SrcDir, Script ++ ".src"]),
    │ │ │ │ +               filename:join([DestDir, Script]),
    │ │ │ │ +               Vars, Opts).
    │ │ │ │ +
    │ │ │ │ +subst_file(Src, Dest, Vars, Opts) ->
    │ │ │ │ +    {ok, Conts} = read_txt_file(Src),
    │ │ │ │ +    NConts = subst(Conts, Vars),
    │ │ │ │ +    write_file(Dest, NConts),
    │ │ │ │ +    case lists:member(preserve, Opts) of
    │ │ │ │          true ->
    │ │ │ │ -            {ok, FileInfo} = file:read_file_info(Src),
    │ │ │ │ -            file:write_file_info(Dest, FileInfo);
    │ │ │ │ +            {ok, FileInfo} = file:read_file_info(Src),
    │ │ │ │ +            file:write_file_info(Dest, FileInfo);
    │ │ │ │          false ->
    │ │ │ │              ok
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │  %% subst(Str, Vars)
    │ │ │ │  %% Vars = [{Var, Val}]
    │ │ │ │  %% Var = Val = string()
    │ │ │ │  %% Substitute all occurrences of %Var% for Val in Str, using the list
    │ │ │ │  %% of variables in Vars.
    │ │ │ │  %%
    │ │ │ │ -subst(Str, Vars) ->
    │ │ │ │ -    subst(Str, Vars, []).
    │ │ │ │ +subst(Str, Vars) ->
    │ │ │ │ +    subst(Str, Vars, []).
    │ │ │ │  
    │ │ │ │ -subst([$%, C| Rest], Vars, Result) when $A =< C, C =< $Z ->
    │ │ │ │ -    subst_var([C| Rest], Vars, Result, []);
    │ │ │ │ -subst([$%, C| Rest], Vars, Result) when $a =< C, C =< $z ->
    │ │ │ │ -    subst_var([C| Rest], Vars, Result, []);
    │ │ │ │ -subst([$%, C| Rest], Vars, Result) when  C == $_ ->
    │ │ │ │ -    subst_var([C| Rest], Vars, Result, []);
    │ │ │ │ -subst([C| Rest], Vars, Result) ->
    │ │ │ │ -    subst(Rest, Vars, [C| Result]);
    │ │ │ │ -subst([], _Vars, Result) ->
    │ │ │ │ -    lists:reverse(Result).
    │ │ │ │ -
    │ │ │ │ -subst_var([$%| Rest], Vars, Result, VarAcc) ->
    │ │ │ │ -    Key = lists:reverse(VarAcc),
    │ │ │ │ -    case lists:keysearch(Key, 1, Vars) of
    │ │ │ │ -        {value, {Key, Value}} ->
    │ │ │ │ -            subst(Rest, Vars, lists:reverse(Value, Result));
    │ │ │ │ +subst([$%, C| Rest], Vars, Result) when $A =< C, C =< $Z ->
    │ │ │ │ +    subst_var([C| Rest], Vars, Result, []);
    │ │ │ │ +subst([$%, C| Rest], Vars, Result) when $a =< C, C =< $z ->
    │ │ │ │ +    subst_var([C| Rest], Vars, Result, []);
    │ │ │ │ +subst([$%, C| Rest], Vars, Result) when  C == $_ ->
    │ │ │ │ +    subst_var([C| Rest], Vars, Result, []);
    │ │ │ │ +subst([C| Rest], Vars, Result) ->
    │ │ │ │ +    subst(Rest, Vars, [C| Result]);
    │ │ │ │ +subst([], _Vars, Result) ->
    │ │ │ │ +    lists:reverse(Result).
    │ │ │ │ +
    │ │ │ │ +subst_var([$%| Rest], Vars, Result, VarAcc) ->
    │ │ │ │ +    Key = lists:reverse(VarAcc),
    │ │ │ │ +    case lists:keysearch(Key, 1, Vars) of
    │ │ │ │ +        {value, {Key, Value}} ->
    │ │ │ │ +            subst(Rest, Vars, lists:reverse(Value, Result));
    │ │ │ │          false ->
    │ │ │ │ -            subst(Rest, Vars, [$%| VarAcc ++ [$%| Result]])
    │ │ │ │ +            subst(Rest, Vars, [$%| VarAcc ++ [$%| Result]])
    │ │ │ │      end;
    │ │ │ │ -subst_var([C| Rest], Vars, Result, VarAcc) ->
    │ │ │ │ -    subst_var(Rest, Vars, Result, [C| VarAcc]);
    │ │ │ │ -subst_var([], Vars, Result, VarAcc) ->
    │ │ │ │ -    subst([], Vars, [VarAcc ++ [$%| Result]]).
    │ │ │ │ -
    │ │ │ │ -copy_file(Src, Dest) ->
    │ │ │ │ -    copy_file(Src, Dest, []).
    │ │ │ │ -
    │ │ │ │ -copy_file(Src, Dest, Opts) ->
    │ │ │ │ -    {ok,_} = file:copy(Src, Dest),
    │ │ │ │ -    case lists:member(preserve, Opts) of
    │ │ │ │ +subst_var([C| Rest], Vars, Result, VarAcc) ->
    │ │ │ │ +    subst_var(Rest, Vars, Result, [C| VarAcc]);
    │ │ │ │ +subst_var([], Vars, Result, VarAcc) ->
    │ │ │ │ +    subst([], Vars, [VarAcc ++ [$%| Result]]).
    │ │ │ │ +
    │ │ │ │ +copy_file(Src, Dest) ->
    │ │ │ │ +    copy_file(Src, Dest, []).
    │ │ │ │ +
    │ │ │ │ +copy_file(Src, Dest, Opts) ->
    │ │ │ │ +    {ok,_} = file:copy(Src, Dest),
    │ │ │ │ +    case lists:member(preserve, Opts) of
    │ │ │ │          true ->
    │ │ │ │ -            {ok, FileInfo} = file:read_file_info(Src),
    │ │ │ │ -            file:write_file_info(Dest, FileInfo);
    │ │ │ │ +            {ok, FileInfo} = file:read_file_info(Src),
    │ │ │ │ +            file:write_file_info(Dest, FileInfo);
    │ │ │ │          false ->
    │ │ │ │              ok
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -write_file(FName, Conts) ->
    │ │ │ │ -    Enc = file:native_name_encoding(),
    │ │ │ │ -    {ok, Fd} = file:open(FName, [write]),
    │ │ │ │ -    file:write(Fd, unicode:characters_to_binary(Conts,Enc,Enc)),
    │ │ │ │ -    file:close(Fd).
    │ │ │ │ -
    │ │ │ │ -read_txt_file(File) ->
    │ │ │ │ -    {ok, Bin} = file:read_file(File),
    │ │ │ │ -    {ok, binary_to_list(Bin)}.
    │ │ │ │ -
    │ │ │ │ -remove_dir_tree(Dir) ->
    │ │ │ │ -    remove_all_files(".", [Dir]).
    │ │ │ │ -
    │ │ │ │ -remove_all_files(Dir, Files) ->
    │ │ │ │ -    lists:foreach(fun(File) ->
    │ │ │ │ -                          FilePath = filename:join([Dir, File]),
    │ │ │ │ -                          case filelib:is_dir(FilePath) of
    │ │ │ │ +write_file(FName, Conts) ->
    │ │ │ │ +    Enc = file:native_name_encoding(),
    │ │ │ │ +    {ok, Fd} = file:open(FName, [write]),
    │ │ │ │ +    file:write(Fd, unicode:characters_to_binary(Conts,Enc,Enc)),
    │ │ │ │ +    file:close(Fd).
    │ │ │ │ +
    │ │ │ │ +read_txt_file(File) ->
    │ │ │ │ +    {ok, Bin} = file:read_file(File),
    │ │ │ │ +    {ok, binary_to_list(Bin)}.
    │ │ │ │ +
    │ │ │ │ +remove_dir_tree(Dir) ->
    │ │ │ │ +    remove_all_files(".", [Dir]).
    │ │ │ │ +
    │ │ │ │ +remove_all_files(Dir, Files) ->
    │ │ │ │ +    lists:foreach(fun(File) ->
    │ │ │ │ +                          FilePath = filename:join([Dir, File]),
    │ │ │ │ +                          case filelib:is_dir(FilePath) of
    │ │ │ │                                true ->
    │ │ │ │ -                                  {ok, DirFiles} = file:list_dir(FilePath),
    │ │ │ │ -                                  remove_all_files(FilePath, DirFiles),
    │ │ │ │ -                                  file:del_dir(FilePath);
    │ │ │ │ +                                  {ok, DirFiles} = file:list_dir(FilePath),
    │ │ │ │ +                                  remove_all_files(FilePath, DirFiles),
    │ │ │ │ +                                  file:del_dir(FilePath);
    │ │ │ │                                _ ->
    │ │ │ │ -                                  file:delete(FilePath)
    │ │ │ │ +                                  file:delete(FilePath)
    │ │ │ │                            end
    │ │ │ │ -                  end, Files).
    │ │ │ │ + end, Files).
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/content.opf │ │ │ │ ├── OEBPS/content.opf │ │ │ │ │ @@ -1,14 +1,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Erlang System Documentation - 27.3.4.6 │ │ │ │ │ - urn:uuid:65dae6e1-365a-dee3-7bf2-69ed833f232b │ │ │ │ │ + urn:uuid:b1de339c-d624-97d8-7963-5481e66feb70 │ │ │ │ │ en │ │ │ │ │ - 2025-11-27T13:07:25Z │ │ │ │ │ + 2025-12-18T10:50:47Z │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -82,21 +82,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ │ │ │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/conc_prog.xhtml │ │ │ │ @@ -37,107 +37,107 @@ │ │ │ │ threads of execution in an Erlang program and to allow these threads to │ │ │ │ communicate with each other. In Erlang, each thread of execution is called a │ │ │ │ process.

    (Aside: the term "process" is usually used when the threads of execution share │ │ │ │ no data with each other and the term "thread" when they share data in some way. │ │ │ │ Threads of execution in Erlang share no data, that is why they are called │ │ │ │ processes).

    The Erlang BIF spawn is used to create a new process: │ │ │ │ spawn(Module, Exported_Function, List of Arguments). Consider the following │ │ │ │ -module:

    -module(tut14).
    │ │ │ │ +module:

    -module(tut14).
    │ │ │ │  
    │ │ │ │ --export([start/0, say_something/2]).
    │ │ │ │ +-export([start/0, say_something/2]).
    │ │ │ │  
    │ │ │ │ -say_something(What, 0) ->
    │ │ │ │ +say_something(What, 0) ->
    │ │ │ │      done;
    │ │ │ │ -say_something(What, Times) ->
    │ │ │ │ -    io:format("~p~n", [What]),
    │ │ │ │ -    say_something(What, Times - 1).
    │ │ │ │ -
    │ │ │ │ -start() ->
    │ │ │ │ -    spawn(tut14, say_something, [hello, 3]),
    │ │ │ │ -    spawn(tut14, say_something, [goodbye, 3]).
    5> c(tut14).
    │ │ │ │ -{ok,tut14}
    │ │ │ │ -6> tut14:say_something(hello, 3).
    │ │ │ │ +say_something(What, Times) ->
    │ │ │ │ +    io:format("~p~n", [What]),
    │ │ │ │ +    say_something(What, Times - 1).
    │ │ │ │ +
    │ │ │ │ +start() ->
    │ │ │ │ +    spawn(tut14, say_something, [hello, 3]),
    │ │ │ │ +    spawn(tut14, say_something, [goodbye, 3]).
    5> c(tut14).
    │ │ │ │ +{ok,tut14}
    │ │ │ │ +6> tut14:say_something(hello, 3).
    │ │ │ │  hello
    │ │ │ │  hello
    │ │ │ │  hello
    │ │ │ │  done

    As shown, the function say_something writes its first argument the number of │ │ │ │ times specified by second argument. The function start starts two Erlang │ │ │ │ processes, one that writes "hello" three times and one that writes "goodbye" │ │ │ │ three times. Both processes use the function say_something. Notice that a │ │ │ │ function used in this way by spawn, to start a process, must be exported from │ │ │ │ -the module (that is, in the -export at the start of the module).

    9> tut14:start().
    │ │ │ │ +the module (that is, in the -export at the start of the module).

    9> tut14:start().
    │ │ │ │  hello
    │ │ │ │  goodbye
    │ │ │ │  <0.63.0>
    │ │ │ │  hello
    │ │ │ │  goodbye
    │ │ │ │  hello
    │ │ │ │  goodbye

    Notice that it did not write "hello" three times and then "goodbye" three times. │ │ │ │ Instead, the first process wrote a "hello", the second a "goodbye", the first │ │ │ │ another "hello" and so forth. But where did the <0.63.0> come from? The return │ │ │ │ value of a function is the return value of the last "thing" in the function. The │ │ │ │ -last thing in the function start is

    spawn(tut14, say_something, [goodbye, 3]).

    spawn returns a process identifier, or pid, which uniquely identifies the │ │ │ │ +last thing in the function start is

    spawn(tut14, say_something, [goodbye, 3]).

    spawn returns a process identifier, or pid, which uniquely identifies the │ │ │ │ process. So <0.63.0> is the pid of the spawn function call above. The next │ │ │ │ example shows how to use pids.

    Notice also that ~p is used instead of ~w in io:format/2. To quote the manual:

    ~p Writes the data with standard syntax in the same way as ~w, but breaks terms │ │ │ │ whose printed representation is longer than one line into many lines and indents │ │ │ │ each line sensibly. It also tries to detect flat lists of printable characters and │ │ │ │ to output these as strings

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Message Passing │ │ │ │

    │ │ │ │

    In the following example two processes are created and they send messages to │ │ │ │ -each other a number of times.

    -module(tut15).
    │ │ │ │ +each other a number of times.

    -module(tut15).
    │ │ │ │  
    │ │ │ │ --export([start/0, ping/2, pong/0]).
    │ │ │ │ +-export([start/0, ping/2, pong/0]).
    │ │ │ │  
    │ │ │ │ -ping(0, Pong_PID) ->
    │ │ │ │ +ping(0, Pong_PID) ->
    │ │ │ │      Pong_PID ! finished,
    │ │ │ │ -    io:format("ping finished~n", []);
    │ │ │ │ +    io:format("ping finished~n", []);
    │ │ │ │  
    │ │ │ │ -ping(N, Pong_PID) ->
    │ │ │ │ -    Pong_PID ! {ping, self()},
    │ │ │ │ +ping(N, Pong_PID) ->
    │ │ │ │ +    Pong_PID ! {ping, self()},
    │ │ │ │      receive
    │ │ │ │          pong ->
    │ │ │ │ -            io:format("Ping received pong~n", [])
    │ │ │ │ +            io:format("Ping received pong~n", [])
    │ │ │ │      end,
    │ │ │ │ -    ping(N - 1, Pong_PID).
    │ │ │ │ +    ping(N - 1, Pong_PID).
    │ │ │ │  
    │ │ │ │ -pong() ->
    │ │ │ │ +pong() ->
    │ │ │ │      receive
    │ │ │ │          finished ->
    │ │ │ │ -            io:format("Pong finished~n", []);
    │ │ │ │ -        {ping, Ping_PID} ->
    │ │ │ │ -            io:format("Pong received ping~n", []),
    │ │ │ │ +            io:format("Pong finished~n", []);
    │ │ │ │ +        {ping, Ping_PID} ->
    │ │ │ │ +            io:format("Pong received ping~n", []),
    │ │ │ │              Ping_PID ! pong,
    │ │ │ │ -            pong()
    │ │ │ │ +            pong()
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -start() ->
    │ │ │ │ -    Pong_PID = spawn(tut15, pong, []),
    │ │ │ │ -    spawn(tut15, ping, [3, Pong_PID]).
    1> c(tut15).
    │ │ │ │ -{ok,tut15}
    │ │ │ │ -2> tut15: start().
    │ │ │ │ +start() ->
    │ │ │ │ +    Pong_PID = spawn(tut15, pong, []),
    │ │ │ │ +    spawn(tut15, ping, [3, Pong_PID]).
    1> c(tut15).
    │ │ │ │ +{ok,tut15}
    │ │ │ │ +2> tut15: start().
    │ │ │ │  <0.36.0>
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │  ping finished
    │ │ │ │ -Pong finished

    The function start first creates a process, let us call it "pong":

    Pong_PID = spawn(tut15, pong, [])

    This process executes tut15:pong(). Pong_PID is the process identity of the │ │ │ │ -"pong" process. The function start now creates another process "ping":

    spawn(tut15, ping, [3, Pong_PID]),

    This process executes:

    tut15:ping(3, Pong_PID)

    <0.36.0> is the return value from the start function.

    The process "pong" now does:

    receive
    │ │ │ │ +Pong finished

    The function start first creates a process, let us call it "pong":

    Pong_PID = spawn(tut15, pong, [])

    This process executes tut15:pong(). Pong_PID is the process identity of the │ │ │ │ +"pong" process. The function start now creates another process "ping":

    spawn(tut15, ping, [3, Pong_PID]),

    This process executes:

    tut15:ping(3, Pong_PID)

    <0.36.0> is the return value from the start function.

    The process "pong" now does:

    receive
    │ │ │ │      finished ->
    │ │ │ │ -        io:format("Pong finished~n", []);
    │ │ │ │ -    {ping, Ping_PID} ->
    │ │ │ │ -        io:format("Pong received ping~n", []),
    │ │ │ │ +        io:format("Pong finished~n", []);
    │ │ │ │ +    {ping, Ping_PID} ->
    │ │ │ │ +        io:format("Pong received ping~n", []),
    │ │ │ │          Ping_PID ! pong,
    │ │ │ │ -        pong()
    │ │ │ │ +        pong()
    │ │ │ │  end.

    The receive construct is used to allow processes to wait for messages from │ │ │ │ other processes. It has the following format:

    receive
    │ │ │ │     pattern1 ->
    │ │ │ │         actions1;
    │ │ │ │     pattern2 ->
    │ │ │ │         actions2;
    │ │ │ │     ....
    │ │ │ │ @@ -158,84 +158,84 @@
    │ │ │ │  queue (keeping the first message and any other messages in the queue). If the
    │ │ │ │  second message does not match, the third message is tried, and so on, until the
    │ │ │ │  end of the queue is reached. If the end of the queue is reached, the process
    │ │ │ │  blocks (stops execution) and waits until a new message is received and this
    │ │ │ │  procedure is repeated.

    The Erlang implementation is "clever" and minimizes the number of times each │ │ │ │ message is tested against the patterns in each receive.

    Now back to the ping pong example.

    "Pong" is waiting for messages. If the atom finished is received, "pong" │ │ │ │ writes "Pong finished" to the output and, as it has nothing more to do, │ │ │ │ -terminates. If it receives a message with the format:

    {ping, Ping_PID}

    it writes "Pong received ping" to the output and sends the atom pong to the │ │ │ │ +terminates. If it receives a message with the format:

    {ping, Ping_PID}

    it writes "Pong received ping" to the output and sends the atom pong to the │ │ │ │ process "ping":

    Ping_PID ! pong

    Notice how the operator "!" is used to send messages. The syntax of "!" is:

    Pid ! Message

    That is, Message (any Erlang term) is sent to the process with identity Pid.

    After sending the message pong to the process "ping", "pong" calls the pong │ │ │ │ function again, which causes it to get back to the receive again and wait for │ │ │ │ -another message.

    Now let us look at the process "ping". Recall that it was started by executing:

    tut15:ping(3, Pong_PID)

    Looking at the function ping/2, the second clause of ping/2 is executed │ │ │ │ +another message.

    Now let us look at the process "ping". Recall that it was started by executing:

    tut15:ping(3, Pong_PID)

    Looking at the function ping/2, the second clause of ping/2 is executed │ │ │ │ since the value of the first argument is 3 (not 0) (first clause head is │ │ │ │ -ping(0,Pong_PID), second clause head is ping(N,Pong_PID), so N becomes 3).

    The second clause sends a message to "pong":

    Pong_PID ! {ping, self()},

    self/0 returns the pid of the process that executes self/0, in this case the │ │ │ │ +ping(0,Pong_PID), second clause head is ping(N,Pong_PID), so N becomes 3).

    The second clause sends a message to "pong":

    Pong_PID ! {ping, self()},

    self/0 returns the pid of the process that executes self/0, in this case the │ │ │ │ pid of "ping". (Recall the code for "pong", this lands up in the variable │ │ │ │ Ping_PID in the receive previously explained.)

    "Ping" now waits for a reply from "pong":

    receive
    │ │ │ │      pong ->
    │ │ │ │ -        io:format("Ping received pong~n", [])
    │ │ │ │ +        io:format("Ping received pong~n", [])
    │ │ │ │  end,

    It writes "Ping received pong" when this reply arrives, after which "ping" calls │ │ │ │ -the ping function again.

    ping(N - 1, Pong_PID)

    N-1 causes the first argument to be decremented until it becomes 0. When this │ │ │ │ -occurs, the first clause of ping/2 is executed:

    ping(0, Pong_PID) ->
    │ │ │ │ +the ping function again.

    ping(N - 1, Pong_PID)

    N-1 causes the first argument to be decremented until it becomes 0. When this │ │ │ │ +occurs, the first clause of ping/2 is executed:

    ping(0, Pong_PID) ->
    │ │ │ │      Pong_PID !  finished,
    │ │ │ │ -    io:format("ping finished~n", []);

    The atom finished is sent to "pong" (causing it to terminate as described │ │ │ │ + io:format("ping finished~n", []);

    The atom finished is sent to "pong" (causing it to terminate as described │ │ │ │ above) and "ping finished" is written to the output. "Ping" then terminates as │ │ │ │ it has nothing left to do.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Registered Process Names │ │ │ │

    │ │ │ │

    In the above example, "pong" was first created to be able to give the identity │ │ │ │ of "pong" when "ping" was started. That is, in some way "ping" must be able to │ │ │ │ know the identity of "pong" to be able to send a message to it. Sometimes │ │ │ │ processes which need to know each other's identities are started independently │ │ │ │ of each other. Erlang thus provides a mechanism for processes to be given names │ │ │ │ so that these names can be used as identities instead of pids. This is done by │ │ │ │ -using the register BIF:

    register(some_atom, Pid)

    Let us now rewrite the ping pong example using this and give the name pong to │ │ │ │ -the "pong" process:

    -module(tut16).
    │ │ │ │ +using the register BIF:

    register(some_atom, Pid)

    Let us now rewrite the ping pong example using this and give the name pong to │ │ │ │ +the "pong" process:

    -module(tut16).
    │ │ │ │  
    │ │ │ │ --export([start/0, ping/1, pong/0]).
    │ │ │ │ +-export([start/0, ping/1, pong/0]).
    │ │ │ │  
    │ │ │ │ -ping(0) ->
    │ │ │ │ +ping(0) ->
    │ │ │ │      pong ! finished,
    │ │ │ │ -    io:format("ping finished~n", []);
    │ │ │ │ +    io:format("ping finished~n", []);
    │ │ │ │  
    │ │ │ │ -ping(N) ->
    │ │ │ │ -    pong ! {ping, self()},
    │ │ │ │ +ping(N) ->
    │ │ │ │ +    pong ! {ping, self()},
    │ │ │ │      receive
    │ │ │ │          pong ->
    │ │ │ │ -            io:format("Ping received pong~n", [])
    │ │ │ │ +            io:format("Ping received pong~n", [])
    │ │ │ │      end,
    │ │ │ │ -    ping(N - 1).
    │ │ │ │ +    ping(N - 1).
    │ │ │ │  
    │ │ │ │ -pong() ->
    │ │ │ │ +pong() ->
    │ │ │ │      receive
    │ │ │ │          finished ->
    │ │ │ │ -            io:format("Pong finished~n", []);
    │ │ │ │ -        {ping, Ping_PID} ->
    │ │ │ │ -            io:format("Pong received ping~n", []),
    │ │ │ │ +            io:format("Pong finished~n", []);
    │ │ │ │ +        {ping, Ping_PID} ->
    │ │ │ │ +            io:format("Pong received ping~n", []),
    │ │ │ │              Ping_PID ! pong,
    │ │ │ │ -            pong()
    │ │ │ │ +            pong()
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -start() ->
    │ │ │ │ -    register(pong, spawn(tut16, pong, [])),
    │ │ │ │ -    spawn(tut16, ping, [3]).
    2> c(tut16).
    │ │ │ │ -{ok, tut16}
    │ │ │ │ -3> tut16:start().
    │ │ │ │ +start() ->
    │ │ │ │ +    register(pong, spawn(tut16, pong, [])),
    │ │ │ │ +    spawn(tut16, ping, [3]).
    2> c(tut16).
    │ │ │ │ +{ok, tut16}
    │ │ │ │ +3> tut16:start().
    │ │ │ │  <0.38.0>
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │  ping finished
    │ │ │ │ -Pong finished

    Here the start/0 function,

    register(pong, spawn(tut16, pong, [])),

    both spawns the "pong" process and gives it the name pong. In the "ping" │ │ │ │ -process, messages can be sent to pong by:

    pong ! {ping, self()},

    ping/2 now becomes ping/1 as the argument Pong_PID is not needed.

    │ │ │ │ +Pong finished

    Here the start/0 function,

    register(pong, spawn(tut16, pong, [])),

    both spawns the "pong" process and gives it the name pong. In the "ping" │ │ │ │ +process, messages can be sent to pong by:

    pong ! {ping, self()},

    ping/2 now becomes ping/1 as the argument Pong_PID is not needed.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Distributed Programming │ │ │ │

    │ │ │ │

    Let us rewrite the ping pong program with "ping" and "pong" on different │ │ │ │ computers. First a few things are needed to set up to get this to work. The │ │ │ │ @@ -255,106 +255,106 @@ │ │ │ │ of the file. This is a requirement.

    When you start an Erlang system that is going to talk to other Erlang systems, │ │ │ │ you must give it a name, for example:

    $ erl -sname my_name

    We will see more details of this later. If you want to experiment with │ │ │ │ distributed Erlang, but you only have one computer to work on, you can start two │ │ │ │ separate Erlang systems on the same computer but give them different names. Each │ │ │ │ Erlang system running on a computer is called an Erlang node.

    (Note: erl -sname assumes that all nodes are in the same IP domain and we can │ │ │ │ use only the first component of the IP address, if we want to use nodes in │ │ │ │ different domains we use -name instead, but then all IP address must be given │ │ │ │ -in full.)

    Here is the ping pong example modified to run on two separate nodes:

    -module(tut17).
    │ │ │ │ +in full.)

    Here is the ping pong example modified to run on two separate nodes:

    -module(tut17).
    │ │ │ │  
    │ │ │ │ --export([start_ping/1, start_pong/0,  ping/2, pong/0]).
    │ │ │ │ +-export([start_ping/1, start_pong/0,  ping/2, pong/0]).
    │ │ │ │  
    │ │ │ │ -ping(0, Pong_Node) ->
    │ │ │ │ -    {pong, Pong_Node} ! finished,
    │ │ │ │ -    io:format("ping finished~n", []);
    │ │ │ │ +ping(0, Pong_Node) ->
    │ │ │ │ +    {pong, Pong_Node} ! finished,
    │ │ │ │ +    io:format("ping finished~n", []);
    │ │ │ │  
    │ │ │ │ -ping(N, Pong_Node) ->
    │ │ │ │ -    {pong, Pong_Node} ! {ping, self()},
    │ │ │ │ +ping(N, Pong_Node) ->
    │ │ │ │ +    {pong, Pong_Node} ! {ping, self()},
    │ │ │ │      receive
    │ │ │ │          pong ->
    │ │ │ │ -            io:format("Ping received pong~n", [])
    │ │ │ │ +            io:format("Ping received pong~n", [])
    │ │ │ │      end,
    │ │ │ │ -    ping(N - 1, Pong_Node).
    │ │ │ │ +    ping(N - 1, Pong_Node).
    │ │ │ │  
    │ │ │ │ -pong() ->
    │ │ │ │ +pong() ->
    │ │ │ │      receive
    │ │ │ │          finished ->
    │ │ │ │ -            io:format("Pong finished~n", []);
    │ │ │ │ -        {ping, Ping_PID} ->
    │ │ │ │ -            io:format("Pong received ping~n", []),
    │ │ │ │ +            io:format("Pong finished~n", []);
    │ │ │ │ +        {ping, Ping_PID} ->
    │ │ │ │ +            io:format("Pong received ping~n", []),
    │ │ │ │              Ping_PID ! pong,
    │ │ │ │ -            pong()
    │ │ │ │ +            pong()
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -start_pong() ->
    │ │ │ │ -    register(pong, spawn(tut17, pong, [])).
    │ │ │ │ +start_pong() ->
    │ │ │ │ +    register(pong, spawn(tut17, pong, [])).
    │ │ │ │  
    │ │ │ │ -start_ping(Pong_Node) ->
    │ │ │ │ -    spawn(tut17, ping, [3, Pong_Node]).

    Let us assume there are two computers called gollum and kosken. First a node is │ │ │ │ +start_ping(Pong_Node) -> │ │ │ │ + spawn(tut17, ping, [3, Pong_Node]).

    Let us assume there are two computers called gollum and kosken. First a node is │ │ │ │ started on kosken, called ping, and then a node on gollum, called pong.

    On kosken (on a Linux/UNIX system):

    kosken> erl -sname ping
    │ │ │ │  Erlang (BEAM) emulator version 5.2.3.7 [hipe] [threads:0]
    │ │ │ │  
    │ │ │ │  Eshell V5.2.3.7  (abort with ^G)
    │ │ │ │  (ping@kosken)1>

    On gollum:

    gollum> erl -sname pong
    │ │ │ │  Erlang (BEAM) emulator version 5.2.3.7 [hipe] [threads:0]
    │ │ │ │  
    │ │ │ │  Eshell V5.2.3.7  (abort with ^G)
    │ │ │ │ -(pong@gollum)1>

    Now the "pong" process on gollum is started:

    (pong@gollum)1> tut17:start_pong().
    │ │ │ │ +(pong@gollum)1>

    Now the "pong" process on gollum is started:

    (pong@gollum)1> tut17:start_pong().
    │ │ │ │  true

    And the "ping" process on kosken is started (from the code above you can see │ │ │ │ that a parameter of the start_ping function is the node name of the Erlang │ │ │ │ -system where "pong" is running):

    (ping@kosken)1> tut17:start_ping(pong@gollum).
    │ │ │ │ +system where "pong" is running):

    (ping@kosken)1> tut17:start_ping(pong@gollum).
    │ │ │ │  <0.37.0>
    │ │ │ │  Ping received pong
    │ │ │ │  Ping received pong
    │ │ │ │  Ping received pong
    │ │ │ │  ping finished

    As shown, the ping pong program has run. On the "pong" side:

    (pong@gollum)2> 
    │ │ │ │  Pong received ping
    │ │ │ │  Pong received ping
    │ │ │ │  Pong received ping
    │ │ │ │  Pong finished
    │ │ │ │ -(pong@gollum)2> 

    Looking at the tut17 code, you see that the pong function itself is │ │ │ │ +(pong@gollum)2>

    Looking at the tut17 code, you see that the pong function itself is │ │ │ │ unchanged, the following lines work in the same way irrespective of on which │ │ │ │ -node the "ping" process is executes:

    {ping, Ping_PID} ->
    │ │ │ │ -    io:format("Pong received ping~n", []),
    │ │ │ │ +node the "ping" process is executes:

    {ping, Ping_PID} ->
    │ │ │ │ +    io:format("Pong received ping~n", []),
    │ │ │ │      Ping_PID ! pong,

    Thus, Erlang pids contain information about where the process executes. So if │ │ │ │ you know the pid of a process, the ! operator can be used to send it a │ │ │ │ -message disregarding if the process is on the same node or on a different node.

    A difference is how messages are sent to a registered process on another node:

    {pong, Pong_Node} ! {ping, self()},

    A tuple {registered_name,node_name} is used instead of just the │ │ │ │ +message disregarding if the process is on the same node or on a different node.

    A difference is how messages are sent to a registered process on another node:

    {pong, Pong_Node} ! {ping, self()},

    A tuple {registered_name,node_name} is used instead of just the │ │ │ │ registered_name.

    In the previous example, "ping" and "pong" were started from the shells of two │ │ │ │ separate Erlang nodes. spawn can also be used to start processes in other │ │ │ │ nodes.

    The next example is the ping pong program, yet again, but this time "ping" is │ │ │ │ -started in another node:

    -module(tut18).
    │ │ │ │ +started in another node:

    -module(tut18).
    │ │ │ │  
    │ │ │ │ --export([start/1,  ping/2, pong/0]).
    │ │ │ │ +-export([start/1,  ping/2, pong/0]).
    │ │ │ │  
    │ │ │ │ -ping(0, Pong_Node) ->
    │ │ │ │ -    {pong, Pong_Node} ! finished,
    │ │ │ │ -    io:format("ping finished~n", []);
    │ │ │ │ +ping(0, Pong_Node) ->
    │ │ │ │ +    {pong, Pong_Node} ! finished,
    │ │ │ │ +    io:format("ping finished~n", []);
    │ │ │ │  
    │ │ │ │ -ping(N, Pong_Node) ->
    │ │ │ │ -    {pong, Pong_Node} ! {ping, self()},
    │ │ │ │ +ping(N, Pong_Node) ->
    │ │ │ │ +    {pong, Pong_Node} ! {ping, self()},
    │ │ │ │      receive
    │ │ │ │          pong ->
    │ │ │ │ -            io:format("Ping received pong~n", [])
    │ │ │ │ +            io:format("Ping received pong~n", [])
    │ │ │ │      end,
    │ │ │ │ -    ping(N - 1, Pong_Node).
    │ │ │ │ +    ping(N - 1, Pong_Node).
    │ │ │ │  
    │ │ │ │ -pong() ->
    │ │ │ │ +pong() ->
    │ │ │ │      receive
    │ │ │ │          finished ->
    │ │ │ │ -            io:format("Pong finished~n", []);
    │ │ │ │ -        {ping, Ping_PID} ->
    │ │ │ │ -            io:format("Pong received ping~n", []),
    │ │ │ │ +            io:format("Pong finished~n", []);
    │ │ │ │ +        {ping, Ping_PID} ->
    │ │ │ │ +            io:format("Pong received ping~n", []),
    │ │ │ │              Ping_PID ! pong,
    │ │ │ │ -            pong()
    │ │ │ │ +            pong()
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -start(Ping_Node) ->
    │ │ │ │ -    register(pong, spawn(tut18, pong, [])),
    │ │ │ │ -    spawn(Ping_Node, tut18, ping, [3, node()]).

    Assuming an Erlang system called ping (but not the "ping" process) has already │ │ │ │ -been started on kosken, then on gollum this is done:

    (pong@gollum)1> tut18:start(ping@kosken).
    │ │ │ │ +start(Ping_Node) ->
    │ │ │ │ +    register(pong, spawn(tut18, pong, [])),
    │ │ │ │ +    spawn(Ping_Node, tut18, ping, [3, node()]).

    Assuming an Erlang system called ping (but not the "ping" process) has already │ │ │ │ +been started on kosken, then on gollum this is done:

    (pong@gollum)1> tut18:start(ping@kosken).
    │ │ │ │  <3934.39.0>
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │  Pong received ping
    │ │ │ │  Ping received pong
    │ │ │ │ @@ -421,184 +421,184 @@
    │ │ │ │  %%% Started: messenger:client(Server_Node, Name)
    │ │ │ │  %%% To client: logoff
    │ │ │ │  %%% To client: {message_to, ToName, Message}
    │ │ │ │  %%%
    │ │ │ │  %%% Configuration: change the server_node() function to return the
    │ │ │ │  %%% name of the node where the messenger server runs
    │ │ │ │  
    │ │ │ │ --module(messenger).
    │ │ │ │ --export([start_server/0, server/1, logon/1, logoff/0, message/2, client/2]).
    │ │ │ │ +-module(messenger).
    │ │ │ │ +-export([start_server/0, server/1, logon/1, logoff/0, message/2, client/2]).
    │ │ │ │  
    │ │ │ │  %%% Change the function below to return the name of the node where the
    │ │ │ │  %%% messenger server runs
    │ │ │ │ -server_node() ->
    │ │ │ │ +server_node() ->
    │ │ │ │      messenger@super.
    │ │ │ │  
    │ │ │ │  %%% This is the server process for the "messenger"
    │ │ │ │  %%% the user list has the format [{ClientPid1, Name1},{ClientPid22, Name2},...]
    │ │ │ │ -server(User_List) ->
    │ │ │ │ +server(User_List) ->
    │ │ │ │      receive
    │ │ │ │ -        {From, logon, Name} ->
    │ │ │ │ -            New_User_List = server_logon(From, Name, User_List),
    │ │ │ │ -            server(New_User_List);
    │ │ │ │ -        {From, logoff} ->
    │ │ │ │ -            New_User_List = server_logoff(From, User_List),
    │ │ │ │ -            server(New_User_List);
    │ │ │ │ -        {From, message_to, To, Message} ->
    │ │ │ │ -            server_transfer(From, To, Message, User_List),
    │ │ │ │ -            io:format("list is now: ~p~n", [User_List]),
    │ │ │ │ -            server(User_List)
    │ │ │ │ +        {From, logon, Name} ->
    │ │ │ │ +            New_User_List = server_logon(From, Name, User_List),
    │ │ │ │ +            server(New_User_List);
    │ │ │ │ +        {From, logoff} ->
    │ │ │ │ +            New_User_List = server_logoff(From, User_List),
    │ │ │ │ +            server(New_User_List);
    │ │ │ │ +        {From, message_to, To, Message} ->
    │ │ │ │ +            server_transfer(From, To, Message, User_List),
    │ │ │ │ +            io:format("list is now: ~p~n", [User_List]),
    │ │ │ │ +            server(User_List)
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │  %%% Start the server
    │ │ │ │ -start_server() ->
    │ │ │ │ -    register(messenger, spawn(messenger, server, [[]])).
    │ │ │ │ +start_server() ->
    │ │ │ │ +    register(messenger, spawn(messenger, server, [[]])).
    │ │ │ │  
    │ │ │ │  
    │ │ │ │  %%% Server adds a new user to the user list
    │ │ │ │ -server_logon(From, Name, User_List) ->
    │ │ │ │ +server_logon(From, Name, User_List) ->
    │ │ │ │      %% check if logged on anywhere else
    │ │ │ │ -    case lists:keymember(Name, 2, User_List) of
    │ │ │ │ +    case lists:keymember(Name, 2, User_List) of
    │ │ │ │          true ->
    │ │ │ │ -            From ! {messenger, stop, user_exists_at_other_node},  %reject logon
    │ │ │ │ +            From ! {messenger, stop, user_exists_at_other_node},  %reject logon
    │ │ │ │              User_List;
    │ │ │ │          false ->
    │ │ │ │ -            From ! {messenger, logged_on},
    │ │ │ │ -            [{From, Name} | User_List]        %add user to the list
    │ │ │ │ +            From ! {messenger, logged_on},
    │ │ │ │ +            [{From, Name} | User_List]        %add user to the list
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │  %%% Server deletes a user from the user list
    │ │ │ │ -server_logoff(From, User_List) ->
    │ │ │ │ -    lists:keydelete(From, 1, User_List).
    │ │ │ │ +server_logoff(From, User_List) ->
    │ │ │ │ +    lists:keydelete(From, 1, User_List).
    │ │ │ │  
    │ │ │ │  
    │ │ │ │  %%% Server transfers a message between user
    │ │ │ │ -server_transfer(From, To, Message, User_List) ->
    │ │ │ │ +server_transfer(From, To, Message, User_List) ->
    │ │ │ │      %% check that the user is logged on and who he is
    │ │ │ │ -    case lists:keysearch(From, 1, User_List) of
    │ │ │ │ +    case lists:keysearch(From, 1, User_List) of
    │ │ │ │          false ->
    │ │ │ │ -            From ! {messenger, stop, you_are_not_logged_on};
    │ │ │ │ -        {value, {From, Name}} ->
    │ │ │ │ -            server_transfer(From, Name, To, Message, User_List)
    │ │ │ │ +            From ! {messenger, stop, you_are_not_logged_on};
    │ │ │ │ +        {value, {From, Name}} ->
    │ │ │ │ +            server_transfer(From, Name, To, Message, User_List)
    │ │ │ │      end.
    │ │ │ │  %%% If the user exists, send the message
    │ │ │ │ -server_transfer(From, Name, To, Message, User_List) ->
    │ │ │ │ +server_transfer(From, Name, To, Message, User_List) ->
    │ │ │ │      %% Find the receiver and send the message
    │ │ │ │ -    case lists:keysearch(To, 2, User_List) of
    │ │ │ │ +    case lists:keysearch(To, 2, User_List) of
    │ │ │ │          false ->
    │ │ │ │ -            From ! {messenger, receiver_not_found};
    │ │ │ │ -        {value, {ToPid, To}} ->
    │ │ │ │ -            ToPid ! {message_from, Name, Message},
    │ │ │ │ -            From ! {messenger, sent}
    │ │ │ │ +            From ! {messenger, receiver_not_found};
    │ │ │ │ +        {value, {ToPid, To}} ->
    │ │ │ │ +            ToPid ! {message_from, Name, Message},
    │ │ │ │ +            From ! {messenger, sent}
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │  
    │ │ │ │  %%% User Commands
    │ │ │ │ -logon(Name) ->
    │ │ │ │ -    case whereis(mess_client) of
    │ │ │ │ +logon(Name) ->
    │ │ │ │ +    case whereis(mess_client) of
    │ │ │ │          undefined ->
    │ │ │ │ -            register(mess_client,
    │ │ │ │ -                     spawn(messenger, client, [server_node(), Name]));
    │ │ │ │ +            register(mess_client,
    │ │ │ │ +                     spawn(messenger, client, [server_node(), Name]));
    │ │ │ │          _ -> already_logged_on
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -logoff() ->
    │ │ │ │ +logoff() ->
    │ │ │ │      mess_client ! logoff.
    │ │ │ │  
    │ │ │ │ -message(ToName, Message) ->
    │ │ │ │ -    case whereis(mess_client) of % Test if the client is running
    │ │ │ │ +message(ToName, Message) ->
    │ │ │ │ +    case whereis(mess_client) of % Test if the client is running
    │ │ │ │          undefined ->
    │ │ │ │              not_logged_on;
    │ │ │ │ -        _ -> mess_client ! {message_to, ToName, Message},
    │ │ │ │ +        _ -> mess_client ! {message_to, ToName, Message},
    │ │ │ │               ok
    │ │ │ │  end.
    │ │ │ │  
    │ │ │ │  
    │ │ │ │  %%% The client process which runs on each server node
    │ │ │ │ -client(Server_Node, Name) ->
    │ │ │ │ -    {messenger, Server_Node} ! {self(), logon, Name},
    │ │ │ │ -    await_result(),
    │ │ │ │ -    client(Server_Node).
    │ │ │ │ +client(Server_Node, Name) ->
    │ │ │ │ +    {messenger, Server_Node} ! {self(), logon, Name},
    │ │ │ │ +    await_result(),
    │ │ │ │ +    client(Server_Node).
    │ │ │ │  
    │ │ │ │ -client(Server_Node) ->
    │ │ │ │ +client(Server_Node) ->
    │ │ │ │      receive
    │ │ │ │          logoff ->
    │ │ │ │ -            {messenger, Server_Node} ! {self(), logoff},
    │ │ │ │ -            exit(normal);
    │ │ │ │ -        {message_to, ToName, Message} ->
    │ │ │ │ -            {messenger, Server_Node} ! {self(), message_to, ToName, Message},
    │ │ │ │ -            await_result();
    │ │ │ │ -        {message_from, FromName, Message} ->
    │ │ │ │ -            io:format("Message from ~p: ~p~n", [FromName, Message])
    │ │ │ │ +            {messenger, Server_Node} ! {self(), logoff},
    │ │ │ │ +            exit(normal);
    │ │ │ │ +        {message_to, ToName, Message} ->
    │ │ │ │ +            {messenger, Server_Node} ! {self(), message_to, ToName, Message},
    │ │ │ │ +            await_result();
    │ │ │ │ +        {message_from, FromName, Message} ->
    │ │ │ │ +            io:format("Message from ~p: ~p~n", [FromName, Message])
    │ │ │ │      end,
    │ │ │ │ -    client(Server_Node).
    │ │ │ │ +    client(Server_Node).
    │ │ │ │  
    │ │ │ │  %%% wait for a response from the server
    │ │ │ │ -await_result() ->
    │ │ │ │ +await_result() ->
    │ │ │ │      receive
    │ │ │ │ -        {messenger, stop, Why} -> % Stop the client
    │ │ │ │ -            io:format("~p~n", [Why]),
    │ │ │ │ -            exit(normal);
    │ │ │ │ -        {messenger, What} ->  % Normal response
    │ │ │ │ -            io:format("~p~n", [What])
    │ │ │ │ +        {messenger, stop, Why} -> % Stop the client
    │ │ │ │ +            io:format("~p~n", [Why]),
    │ │ │ │ +            exit(normal);
    │ │ │ │ +        {messenger, What} ->  % Normal response
    │ │ │ │ +            io:format("~p~n", [What])
    │ │ │ │      end.

    To use this program, you need to:

    • Configure the server_node() function.
    • Copy the compiled code (messenger.beam) to the directory on each computer │ │ │ │ where you start Erlang.

    In the following example using this program, nodes are started on four different │ │ │ │ computers. If you do not have that many machines available on your network, you │ │ │ │ can start several nodes on the same machine.

    Four Erlang nodes are started up: messenger@super, c1@bilbo, c2@kosken, │ │ │ │ -c3@gollum.

    First the server at messenger@super is started up:

    (messenger@super)1> messenger:start_server().
    │ │ │ │ -true

    Now Peter logs on at c1@bilbo:

    (c1@bilbo)1> messenger:logon(peter).
    │ │ │ │ +c3@gollum.

    First the server at messenger@super is started up:

    (messenger@super)1> messenger:start_server().
    │ │ │ │ +true

    Now Peter logs on at c1@bilbo:

    (c1@bilbo)1> messenger:logon(peter).
    │ │ │ │  true
    │ │ │ │ -logged_on

    James logs on at c2@kosken:

    (c2@kosken)1> messenger:logon(james).
    │ │ │ │ +logged_on

    James logs on at c2@kosken:

    (c2@kosken)1> messenger:logon(james).
    │ │ │ │  true
    │ │ │ │ -logged_on

    And Fred logs on at c3@gollum:

    (c3@gollum)1> messenger:logon(fred).
    │ │ │ │ +logged_on

    And Fred logs on at c3@gollum:

    (c3@gollum)1> messenger:logon(fred).
    │ │ │ │  true
    │ │ │ │ -logged_on

    Now Peter sends Fred a message:

    (c1@bilbo)2> messenger:message(fred, "hello").
    │ │ │ │ +logged_on

    Now Peter sends Fred a message:

    (c1@bilbo)2> messenger:message(fred, "hello").
    │ │ │ │  ok
    │ │ │ │  sent

    Fred receives the message and sends a message to Peter and logs off:

    Message from peter: "hello"
    │ │ │ │ -(c3@gollum)2> messenger:message(peter, "go away, I'm busy").
    │ │ │ │ +(c3@gollum)2> messenger:message(peter, "go away, I'm busy").
    │ │ │ │  ok
    │ │ │ │  sent
    │ │ │ │ -(c3@gollum)3> messenger:logoff().
    │ │ │ │ -logoff

    James now tries to send a message to Fred:

    (c2@kosken)2> messenger:message(fred, "peter doesn't like you").
    │ │ │ │ +(c3@gollum)3> messenger:logoff().
    │ │ │ │ +logoff

    James now tries to send a message to Fred:

    (c2@kosken)2> messenger:message(fred, "peter doesn't like you").
    │ │ │ │  ok
    │ │ │ │  receiver_not_found

    But this fails as Fred has already logged off.

    First let us look at some of the new concepts that have been introduced.

    There are two versions of the server_transfer function: one with four │ │ │ │ arguments (server_transfer/4) and one with five (server_transfer/5). These │ │ │ │ are regarded by Erlang as two separate functions.

    Notice how to write the server function so that it calls itself, through │ │ │ │ server(User_List), and thus creates a loop. The Erlang compiler is "clever" │ │ │ │ and optimizes the code so that this really is a sort of loop and not a proper │ │ │ │ function call. But this only works if there is no code after the call. │ │ │ │ Otherwise, the compiler expects the call to return and make a proper function │ │ │ │ call. This would result in the process getting bigger and bigger for every loop.

    Functions in the lists module are used. This is a very useful module and a │ │ │ │ study of the manual page is recommended (erl -man lists). │ │ │ │ lists:keymember(Key,Position,Lists) looks through a list of tuples and looks │ │ │ │ at Position in each tuple to see if it is the same as Key. The first element │ │ │ │ is position 1. If it finds a tuple where the element at Position is the same │ │ │ │ -as Key, it returns true, otherwise false.

    3> lists:keymember(a, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
    │ │ │ │ +as Key, it returns true, otherwise false.

    3> lists:keymember(a, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
    │ │ │ │  true
    │ │ │ │ -4> lists:keymember(p, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
    │ │ │ │ +4> lists:keymember(p, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
    │ │ │ │  false

    lists:keydelete works in the same way but deletes the first tuple found (if │ │ │ │ -any) and returns the remaining list:

    5> lists:keydelete(a, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
    │ │ │ │ -[{x,y,z},{b,b,b},{q,r,s}]

    lists:keysearch is like lists:keymember, but it returns │ │ │ │ +any) and returns the remaining list:

    5> lists:keydelete(a, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
    │ │ │ │ +[{x,y,z},{b,b,b},{q,r,s}]

    lists:keysearch is like lists:keymember, but it returns │ │ │ │ {value,Tuple_Found} or the atom false.

    There are many very useful functions in the lists module.

    An Erlang process (conceptually) runs until it does a receive and there is no │ │ │ │ message which it wants to receive in the message queue. "conceptually" is used │ │ │ │ here because the Erlang system shares the CPU time between the active processes │ │ │ │ in the system.

    A process terminates when there is nothing more for it to do, that is, the last │ │ │ │ function it calls simply returns and does not call another function. Another way │ │ │ │ for a process to terminate is for it to call exit/1. The argument │ │ │ │ to exit/1 has a special meaning, which is discussed later. In this │ │ │ │ example, exit(normal) is done, which has the same effect as a │ │ │ │ process running out of functions to call.

    The BIF whereis(RegisteredName) checks if a registered process │ │ │ │ of name RegisteredName exists. If it exists, the pid of that process is │ │ │ │ returned. If it does not exist, the atom undefined is returned.

    You should by now be able to understand most of the code in the │ │ │ │ messenger-module. Let us study one case in detail: a message is sent from one │ │ │ │ -user to another.

    The first user "sends" the message in the example above by:

    messenger:message(fred, "hello")

    After testing that the client process exists:

    whereis(mess_client)

    And a message is sent to mess_client:

    mess_client ! {message_to, fred, "hello"}

    The client sends the message to the server by:

    {messenger, messenger@super} ! {self(), message_to, fred, "hello"},

    And waits for a reply from the server.

    The server receives this message and calls:

    server_transfer(From, fred, "hello", User_List),

    This checks that the pid From is in the User_List:

    lists:keysearch(From, 1, User_List)

    If keysearch returns the atom false, some error has occurred and the server │ │ │ │ -sends back the message:

    From ! {messenger, stop, you_are_not_logged_on}

    This is received by the client, which in turn does exit(normal) │ │ │ │ +user to another.

    The first user "sends" the message in the example above by:

    messenger:message(fred, "hello")

    After testing that the client process exists:

    whereis(mess_client)

    And a message is sent to mess_client:

    mess_client ! {message_to, fred, "hello"}

    The client sends the message to the server by:

    {messenger, messenger@super} ! {self(), message_to, fred, "hello"},

    And waits for a reply from the server.

    The server receives this message and calls:

    server_transfer(From, fred, "hello", User_List),

    This checks that the pid From is in the User_List:

    lists:keysearch(From, 1, User_List)

    If keysearch returns the atom false, some error has occurred and the server │ │ │ │ +sends back the message:

    From ! {messenger, stop, you_are_not_logged_on}

    This is received by the client, which in turn does exit(normal) │ │ │ │ and terminates. If keysearch returns {value,{From,Name}} it is certain that │ │ │ │ -the user is logged on and that his name (peter) is in variable Name.

    Let us now call:

    server_transfer(From, peter, fred, "hello", User_List)

    Notice that as this is server_transfer/5, it is not the same as the previous │ │ │ │ +the user is logged on and that his name (peter) is in variable Name.

    Let us now call:

    server_transfer(From, peter, fred, "hello", User_List)

    Notice that as this is server_transfer/5, it is not the same as the previous │ │ │ │ function server_transfer/4. Another keysearch is done on User_List to find │ │ │ │ -the pid of the client corresponding to fred:

    lists:keysearch(fred, 2, User_List)

    This time argument 2 is used, which is the second element in the tuple. If this │ │ │ │ +the pid of the client corresponding to fred:

    lists:keysearch(fred, 2, User_List)

    This time argument 2 is used, which is the second element in the tuple. If this │ │ │ │ returns the atom false, fred is not logged on and the following message is │ │ │ │ -sent:

    From ! {messenger, receiver_not_found};

    This is received by the client.

    If keysearch returns:

    {value, {ToPid, fred}}

    The following message is sent to fred's client:

    ToPid ! {message_from, peter, "hello"},

    The following message is sent to peter's client:

    From ! {messenger, sent}

    Fred's client receives the message and prints it:

    {message_from, peter, "hello"} ->
    │ │ │ │ -    io:format("Message from ~p: ~p~n", [peter, "hello"])

    Peter's client receives the message in the await_result function.

    │ │ │ │ +sent:

    From ! {messenger, receiver_not_found};

    This is received by the client.

    If keysearch returns:

    {value, {ToPid, fred}}

    The following message is sent to fred's client:

    ToPid ! {message_from, peter, "hello"},

    The following message is sent to peter's client:

    From ! {messenger, sent}

    Fred's client receives the message and prints it:

    {message_from, peter, "hello"} ->
    │ │ │ │ +    io:format("Message from ~p: ~p~n", [peter, "hello"])

    Peter's client receives the message in the await_result function.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/commoncaveats.xhtml │ │ │ │ @@ -23,31 +23,31 @@ │ │ │ │

    This section lists a few constructs to watch out for.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Operator ++ │ │ │ │

    │ │ │ │

    The ++ operator copies its left-hand side operand. That is clearly │ │ │ │ -seen if we do our own implementation in Erlang:

    my_plus_plus([H|T], Tail) ->
    │ │ │ │ -    [H|my_plus_plus(T, Tail)];
    │ │ │ │ -my_plus_plus([], Tail) ->
    │ │ │ │ -    Tail.

    We must be careful how we use ++ in a loop. First is how not to use it:

    DO NOT

    naive_reverse([H|T]) ->
    │ │ │ │ -    naive_reverse(T) ++ [H];
    │ │ │ │ -naive_reverse([]) ->
    │ │ │ │ -    [].

    As the ++ operator copies its left-hand side operand, the growing │ │ │ │ -result is copied repeatedly, leading to quadratic complexity.

    On the other hand, using ++ in loop like this is perfectly fine:

    OK

    naive_but_ok_reverse(List) ->
    │ │ │ │ -    naive_but_ok_reverse(List, []).
    │ │ │ │ +seen if we do our own implementation in Erlang:

    my_plus_plus([H|T], Tail) ->
    │ │ │ │ +    [H|my_plus_plus(T, Tail)];
    │ │ │ │ +my_plus_plus([], Tail) ->
    │ │ │ │ +    Tail.

    We must be careful how we use ++ in a loop. First is how not to use it:

    DO NOT

    naive_reverse([H|T]) ->
    │ │ │ │ +    naive_reverse(T) ++ [H];
    │ │ │ │ +naive_reverse([]) ->
    │ │ │ │ +    [].

    As the ++ operator copies its left-hand side operand, the growing │ │ │ │ +result is copied repeatedly, leading to quadratic complexity.

    On the other hand, using ++ in loop like this is perfectly fine:

    OK

    naive_but_ok_reverse(List) ->
    │ │ │ │ +    naive_but_ok_reverse(List, []).
    │ │ │ │  
    │ │ │ │ -naive_but_ok_reverse([H|T], Acc) ->
    │ │ │ │ -    naive_but_ok_reverse(T, [H] ++ Acc);
    │ │ │ │ -naive_but_ok_reverse([], Acc) ->
    │ │ │ │ +naive_but_ok_reverse([H|T], Acc) ->
    │ │ │ │ +    naive_but_ok_reverse(T, [H] ++ Acc);
    │ │ │ │ +naive_but_ok_reverse([], Acc) ->
    │ │ │ │      Acc.

    Each list element is copied only once. The growing result Acc is the right-hand │ │ │ │ -side operand, which it is not copied.

    Experienced Erlang programmers would probably write as follows:

    DO

    vanilla_reverse([H|T], Acc) ->
    │ │ │ │ -    vanilla_reverse(T, [H|Acc]);
    │ │ │ │ -vanilla_reverse([], Acc) ->
    │ │ │ │ +side operand, which it is not copied.

    Experienced Erlang programmers would probably write as follows:

    DO

    vanilla_reverse([H|T], Acc) ->
    │ │ │ │ +    vanilla_reverse(T, [H|Acc]);
    │ │ │ │ +vanilla_reverse([], Acc) ->
    │ │ │ │      Acc.

    In principle, this is slightly more efficient because the list element [H] │ │ │ │ is not built before being copied and discarded. In practice, the compiler │ │ │ │ rewrites [H] ++ Acc to [H|Acc].

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Timer Module │ │ │ │ @@ -65,77 +65,77 @@ │ │ │ │ therefore harmless.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Accidental Copying and Loss of Sharing │ │ │ │

    │ │ │ │

    When spawning a new process using a fun, one can accidentally copy more data to │ │ │ │ -the process than intended. For example:

    DO NOT

    accidental1(State) ->
    │ │ │ │ -    spawn(fun() ->
    │ │ │ │ -                  io:format("~p\n", [State#state.info])
    │ │ │ │ -          end).

    The code in the fun will extract one element from the record and print it. The │ │ │ │ +the process than intended. For example:

    DO NOT

    accidental1(State) ->
    │ │ │ │ +    spawn(fun() ->
    │ │ │ │ +                  io:format("~p\n", [State#state.info])
    │ │ │ │ +          end).

    The code in the fun will extract one element from the record and print it. The │ │ │ │ rest of the state record is not used. However, when the spawn/1 │ │ │ │ -function is executed, the entire record is copied to the newly created process.

    The same kind of problem can happen with a map:

    DO NOT

    accidental2(State) ->
    │ │ │ │ -    spawn(fun() ->
    │ │ │ │ -                  io:format("~p\n", [map_get(info, State)])
    │ │ │ │ -          end).

    In the following example (part of a module implementing the gen_server │ │ │ │ -behavior) the created fun is sent to another process:

    DO NOT

    handle_call(give_me_a_fun, _From, State) ->
    │ │ │ │ -    Fun = fun() -> State#state.size =:= 42 end,
    │ │ │ │ -    {reply, Fun, State}.

    How bad that unnecessary copy is depends on the contents of the record or the │ │ │ │ -map.

    For example, if the state record is initialized like this:

    init1() ->
    │ │ │ │ -    #state{data=lists:seq(1, 10000)}.

    a list with 10000 elements (or about 20000 heap words) will be copied to the │ │ │ │ +function is executed, the entire record is copied to the newly created process.

    The same kind of problem can happen with a map:

    DO NOT

    accidental2(State) ->
    │ │ │ │ +    spawn(fun() ->
    │ │ │ │ +                  io:format("~p\n", [map_get(info, State)])
    │ │ │ │ +          end).

    In the following example (part of a module implementing the gen_server │ │ │ │ +behavior) the created fun is sent to another process:

    DO NOT

    handle_call(give_me_a_fun, _From, State) ->
    │ │ │ │ +    Fun = fun() -> State#state.size =:= 42 end,
    │ │ │ │ +    {reply, Fun, State}.

    How bad that unnecessary copy is depends on the contents of the record or the │ │ │ │ +map.

    For example, if the state record is initialized like this:

    init1() ->
    │ │ │ │ +    #state{data=lists:seq(1, 10000)}.

    a list with 10000 elements (or about 20000 heap words) will be copied to the │ │ │ │ newly created process.

    An unnecessary copy of 10000 element list can be bad enough, but it can get even │ │ │ │ worse if the state record contains shared subterms. Here is a simple example │ │ │ │ -of a term with a shared subterm:

    {SubTerm, SubTerm}

    When a term is copied to another process, sharing of subterms will be lost and │ │ │ │ -the copied term can be many times larger than the original term. For example:

    init2() ->
    │ │ │ │ -    SharedSubTerms = lists:foldl(fun(_, A) -> [A|A] end, [0], lists:seq(1, 15)),
    │ │ │ │ -    #state{data=Shared}.

    In the process that calls init2/0, the size of the data field in the state │ │ │ │ +of a term with a shared subterm:

    {SubTerm, SubTerm}

    When a term is copied to another process, sharing of subterms will be lost and │ │ │ │ +the copied term can be many times larger than the original term. For example:

    init2() ->
    │ │ │ │ +    SharedSubTerms = lists:foldl(fun(_, A) -> [A|A] end, [0], lists:seq(1, 15)),
    │ │ │ │ +    #state{data=Shared}.

    In the process that calls init2/0, the size of the data field in the state │ │ │ │ record will be 32 heap words. When the record is copied to the newly created │ │ │ │ process, sharing will be lost and the size of the copied data field will be │ │ │ │ 131070 heap words. More details about │ │ │ │ loss off sharing are found in a later │ │ │ │ section.

    To avoid the problem, outside of the fun extract only the fields of the record │ │ │ │ -that are actually used:

    DO

    fixed_accidental1(State) ->
    │ │ │ │ +that are actually used:

    DO

    fixed_accidental1(State) ->
    │ │ │ │      Info = State#state.info,
    │ │ │ │ -    spawn(fun() ->
    │ │ │ │ -                  io:format("~p\n", [Info])
    │ │ │ │ -          end).

    Similarly, outside of the fun extract only the map elements that are actually │ │ │ │ -used:

    DO

    fixed_accidental2(State) ->
    │ │ │ │ -    Info = map_get(info, State),
    │ │ │ │ -    spawn(fun() ->
    │ │ │ │ -                  io:format("~p\n", [Info])
    │ │ │ │ -          end).

    │ │ │ │ + spawn(fun() -> │ │ │ │ + io:format("~p\n", [Info]) │ │ │ │ + end).

    Similarly, outside of the fun extract only the map elements that are actually │ │ │ │ +used:

    DO

    fixed_accidental2(State) ->
    │ │ │ │ +    Info = map_get(info, State),
    │ │ │ │ +    spawn(fun() ->
    │ │ │ │ +                  io:format("~p\n", [Info])
    │ │ │ │ +          end).

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ list_to_atom/1 │ │ │ │

    │ │ │ │

    Atoms are not garbage-collected. Once an atom is created, it is never removed. │ │ │ │ The emulator terminates if the limit for the number of atoms (1,048,576 by │ │ │ │ default) is reached.

    Therefore, converting arbitrary input strings to atoms can be dangerous in a │ │ │ │ system that runs continuously. If only certain well-defined atoms are allowed as │ │ │ │ input, list_to_existing_atom/1 or │ │ │ │ binary_to_existing_atom/1 can be used │ │ │ │ to guard against a denial-of-service attack. (All atoms that are allowed must │ │ │ │ have been created earlier, for example, by using all of them in a module │ │ │ │ and loading that module.)

    Using list_to_atom/1 to construct an atom that │ │ │ │ -is passed to apply/3 is quite expensive.

    DO NOT

    apply(list_to_atom("some_prefix"++Var), foo, Args)

    │ │ │ │ +is passed to apply/3 is quite expensive.

    DO NOT

    apply(list_to_atom("some_prefix"++Var), foo, Args)

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ length/1 │ │ │ │

    │ │ │ │

    The time for calculating the length of a list is proportional to the length of │ │ │ │ the list, as opposed to tuple_size/1, │ │ │ │ byte_size/1, and bit_size/1, which all │ │ │ │ execute in constant time.

    Normally, there is no need to worry about the speed of length/1, │ │ │ │ because it is efficiently implemented in C. In time-critical code, you might │ │ │ │ want to avoid it if the input list could potentially be very long.

    Some uses of length/1 can be replaced by matching. For example, │ │ │ │ -the following code:

    foo(L) when length(L) >= 3 ->
    │ │ │ │ -    ...

    can be rewritten to:

    foo([_,_,_|_]=L) ->
    │ │ │ │ +the following code:

    foo(L) when length(L) >= 3 ->
    │ │ │ │ +    ...

    can be rewritten to:

    foo([_,_,_|_]=L) ->
    │ │ │ │     ...

    One slight difference is that length(L) fails if L is an │ │ │ │ improper list, while the pattern in the second code fragment accepts an improper │ │ │ │ list.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ setelement/3 │ │ │ │ @@ -143,18 +143,18 @@ │ │ │ │

    setelement/3 copies the tuple it modifies. Therefore, │ │ │ │ updating a tuple in a loop using setelement/3 creates a new │ │ │ │ copy of the tuple every time.

    There is one exception to the rule that the tuple is copied. If the compiler │ │ │ │ clearly can see that destructively updating the tuple would give the same result │ │ │ │ as if the tuple was copied, the call to setelement/3 is │ │ │ │ replaced with a special destructive setelement instruction. In the following │ │ │ │ code sequence, the first setelement/3 call copies the tuple │ │ │ │ -and modifies the ninth element:

    multiple_setelement(T0) when tuple_size(T0) =:= 9 ->
    │ │ │ │ -    T1 = setelement(9, T0, bar),
    │ │ │ │ -    T2 = setelement(7, T1, foobar),
    │ │ │ │ -    setelement(5, T2, new_value).

    The two following setelement/3 calls modify the tuple in │ │ │ │ +and modifies the ninth element:

    multiple_setelement(T0) when tuple_size(T0) =:= 9 ->
    │ │ │ │ +    T1 = setelement(9, T0, bar),
    │ │ │ │ +    T2 = setelement(7, T1, foobar),
    │ │ │ │ +    setelement(5, T2, new_value).

    The two following setelement/3 calls modify the tuple in │ │ │ │ place.

    For the optimization to be applied, all the following conditions must be true:

    • The tuple argument must be known to be a tuple of a known size.
    • The indices must be integer literals, not variables or expressions.
    • The indices must be given in descending order.
    • There must be no calls to another function in between the calls to │ │ │ │ setelement/3.
    • The tuple returned from one setelement/3 call must only be │ │ │ │ used in the subsequent call to setelement/3.

    If the code cannot be structured as in the multiple_setelement/1 example, the │ │ │ │ best way to modify multiple elements in a large tuple is to convert the tuple to │ │ │ │ a list, modify the list, and convert it back to a tuple.

    │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/code_loading.xhtml │ │ │ │ @@ -27,16 +27,16 @@ │ │ │ │ │ │ │ │ │ │ │ │ Compilation │ │ │ │

    │ │ │ │

    Erlang programs must be compiled to object code. The compiler can generate a │ │ │ │ new file that contains the object code. The current abstract machine, which runs │ │ │ │ the object code, is called BEAM, therefore the object files get the suffix │ │ │ │ -.beam. The compiler can also generate a binary which can be loaded directly.

    The compiler is located in the module compile in Compiler.

    compile:file(Module)
    │ │ │ │ -compile:file(Module, Options)

    The Erlang shell understands the command c(Module), which both compiles and │ │ │ │ +.beam. The compiler can also generate a binary which can be loaded directly.

    The compiler is located in the module compile in Compiler.

    compile:file(Module)
    │ │ │ │ +compile:file(Module, Options)

    The Erlang shell understands the command c(Module), which both compiles and │ │ │ │ loads Module.

    There is also a module make, which provides a set of functions similar to the │ │ │ │ UNIX type Make functions, see module make in Tools.

    The compiler can also be accessed from the OS prompt using the │ │ │ │ erl executable in ERTS.

    % erl -compile Module1...ModuleN
    │ │ │ │  % erl -make

    The erlc program provides way to compile modules from the OS │ │ │ │ shell, see the erlc executable in ERTS. It │ │ │ │ understands a number of flags that can be used to define macros, add search │ │ │ │ paths for include files, and more.

    % erlc <flags> File1.erl...FileN.erl

    │ │ │ │ @@ -61,51 +61,51 @@ │ │ │ │ When a module is loaded into the system for the first time, the code becomes │ │ │ │ 'current'. If then a new instance of the module is loaded, the code of the │ │ │ │ previous instance becomes 'old' and the new instance becomes 'current'.

    Both old and current code is valid, and can be evaluated concurrently. Fully │ │ │ │ qualified function calls always refer to current code. Old code can still be │ │ │ │ evaluated because of processes lingering in the old code.

    If a third instance of the module is loaded, the code server removes (purges) │ │ │ │ the old code and any processes lingering in it is terminated. Then the third │ │ │ │ instance becomes 'current' and the previously current code becomes 'old'.

    To change from old code to current code, a process must make a fully qualified │ │ │ │ -function call.

    Example:

    -module(m).
    │ │ │ │ --export([loop/0]).
    │ │ │ │ +function call.

    Example:

    -module(m).
    │ │ │ │ +-export([loop/0]).
    │ │ │ │  
    │ │ │ │ -loop() ->
    │ │ │ │ +loop() ->
    │ │ │ │      receive
    │ │ │ │          code_switch ->
    │ │ │ │ -            m:loop();
    │ │ │ │ +            m:loop();
    │ │ │ │          Msg ->
    │ │ │ │              ...
    │ │ │ │ -            loop()
    │ │ │ │ +            loop()
    │ │ │ │      end.

    To make the process change code, send the message code_switch to it. The │ │ │ │ process then makes a fully qualified call to m:loop() and changes to current │ │ │ │ code. Notice that m:loop/0 must be exported.

    For code replacement of funs to work, use the syntax │ │ │ │ fun Module:FunctionName/Arity.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Running a Function When a Module is Loaded │ │ │ │

    │ │ │ │

    The -on_load() directive names a function that is to be run automatically when │ │ │ │ -a module is loaded.

    Its syntax is as follows:

    -on_load(Name/0).

    It is not necessary to export the function. It is called in a freshly spawned │ │ │ │ +a module is loaded.

    Its syntax is as follows:

    -on_load(Name/0).

    It is not necessary to export the function. It is called in a freshly spawned │ │ │ │ process (which terminates as soon as the function returns).

    The function must return ok if the module is to become the new current code │ │ │ │ for the module and become callable.

    Returning any other value or generating an exception causes the new code to be │ │ │ │ unloaded. If the return value is not an atom, a warning error report is sent to │ │ │ │ the error logger.

    If there already is current code for the module, that code will remain current │ │ │ │ and can be called until the on_load function has returned. If the on_load │ │ │ │ function fails, the current code (if any) will remain current. If there is no │ │ │ │ current code for a module, any process that makes an external call to the module │ │ │ │ before the on_load function has finished will be suspended until the on_load │ │ │ │ function have finished.

    Change

    Before Erlang/OTP 19, if the on_load function failed, any previously current │ │ │ │ code would become old, essentially leaving the system without any working and │ │ │ │ reachable instance of the module.

    In embedded mode, first all modules are loaded. Then all on_load functions are │ │ │ │ called. The system is terminated unless all of the on_load functions return │ │ │ │ -ok.

    Example:

    -module(m).
    │ │ │ │ --on_load(load_my_nifs/0).
    │ │ │ │ +ok.

    Example:

    -module(m).
    │ │ │ │ +-on_load(load_my_nifs/0).
    │ │ │ │  
    │ │ │ │ -load_my_nifs() ->
    │ │ │ │ +load_my_nifs() ->
    │ │ │ │      NifPath = ...,    %Set up the path to the NIF library.
    │ │ │ │      Info = ...,       %Initialize the Info term
    │ │ │ │ -    erlang:load_nif(NifPath, Info).

    If the call to erlang:load_nif/2 fails, the module is unloaded and a warning │ │ │ │ + erlang:load_nif(NifPath, Info).

    If the call to erlang:load_nif/2 fails, the module is unloaded and a warning │ │ │ │ report is sent to the error loader.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/c_portdriver.xhtml │ │ │ │ @@ -56,112 +56,112 @@ │ │ │ │

    Like a port program, the port communicates with an Erlang process. All │ │ │ │ communication goes through one Erlang process that is the connected process of │ │ │ │ the port driver. Terminating this process closes the port driver.

    Before the port is created, the driver must be loaded. This is done with the │ │ │ │ function erl_ddll:load_driver/2, with the name of the shared library as │ │ │ │ argument.

    The port is then created using the BIF open_port/2, with the │ │ │ │ tuple {spawn, DriverName} as the first argument. The string SharedLib is the │ │ │ │ name of the port driver. The second argument is a list of options, none in this │ │ │ │ -case:

    -module(complex5).
    │ │ │ │ --export([start/1, init/1]).
    │ │ │ │ +case:

    -module(complex5).
    │ │ │ │ +-export([start/1, init/1]).
    │ │ │ │  
    │ │ │ │ -start(SharedLib) ->
    │ │ │ │ -    case erl_ddll:load_driver(".", SharedLib) of
    │ │ │ │ +start(SharedLib) ->
    │ │ │ │ +    case erl_ddll:load_driver(".", SharedLib) of
    │ │ │ │          ok -> ok;
    │ │ │ │ -        {error, already_loaded} -> ok;
    │ │ │ │ -        _ -> exit({error, could_not_load_driver})
    │ │ │ │ +        {error, already_loaded} -> ok;
    │ │ │ │ +        _ -> exit({error, could_not_load_driver})
    │ │ │ │      end,
    │ │ │ │ -    spawn(?MODULE, init, [SharedLib]).
    │ │ │ │ +    spawn(?MODULE, init, [SharedLib]).
    │ │ │ │  
    │ │ │ │ -init(SharedLib) ->
    │ │ │ │ -  register(complex, self()),
    │ │ │ │ -  Port = open_port({spawn, SharedLib}, []),
    │ │ │ │ -  loop(Port).

    Now complex5:foo/1 and complex5:bar/1 can be implemented. Both send a │ │ │ │ -message to the complex process and receive the following reply:

    foo(X) ->
    │ │ │ │ -    call_port({foo, X}).
    │ │ │ │ -bar(Y) ->
    │ │ │ │ -    call_port({bar, Y}).
    │ │ │ │ +init(SharedLib) ->
    │ │ │ │ +  register(complex, self()),
    │ │ │ │ +  Port = open_port({spawn, SharedLib}, []),
    │ │ │ │ +  loop(Port).

    Now complex5:foo/1 and complex5:bar/1 can be implemented. Both send a │ │ │ │ +message to the complex process and receive the following reply:

    foo(X) ->
    │ │ │ │ +    call_port({foo, X}).
    │ │ │ │ +bar(Y) ->
    │ │ │ │ +    call_port({bar, Y}).
    │ │ │ │  
    │ │ │ │ -call_port(Msg) ->
    │ │ │ │ -    complex ! {call, self(), Msg},
    │ │ │ │ +call_port(Msg) ->
    │ │ │ │ +    complex ! {call, self(), Msg},
    │ │ │ │      receive
    │ │ │ │ -        {complex, Result} ->
    │ │ │ │ +        {complex, Result} ->
    │ │ │ │              Result
    │ │ │ │ -    end.

    The complex process performs the following:

    • Encodes the message into a sequence of bytes.
    • Sends it to the port.
    • Waits for a reply.
    • Decodes the reply.
    • Sends it back to the caller:
    loop(Port) ->
    │ │ │ │ +    end.

    The complex process performs the following:

    • Encodes the message into a sequence of bytes.
    • Sends it to the port.
    • Waits for a reply.
    • Decodes the reply.
    • Sends it back to the caller:
    loop(Port) ->
    │ │ │ │      receive
    │ │ │ │ -        {call, Caller, Msg} ->
    │ │ │ │ -            Port ! {self(), {command, encode(Msg)}},
    │ │ │ │ +        {call, Caller, Msg} ->
    │ │ │ │ +            Port ! {self(), {command, encode(Msg)}},
    │ │ │ │              receive
    │ │ │ │ -                {Port, {data, Data}} ->
    │ │ │ │ -                    Caller ! {complex, decode(Data)}
    │ │ │ │ +                {Port, {data, Data}} ->
    │ │ │ │ +                    Caller ! {complex, decode(Data)}
    │ │ │ │              end,
    │ │ │ │ -            loop(Port)
    │ │ │ │ +            loop(Port)
    │ │ │ │      end.

    Assuming that both the arguments and the results from the C functions are less │ │ │ │ than 256, a simple encoding/decoding scheme is employed. In this scheme, foo │ │ │ │ is represented by byte 1, bar is represented by 2, and the argument/result is │ │ │ │ -represented by a single byte as well:

    encode({foo, X}) -> [1, X];
    │ │ │ │ -encode({bar, Y}) -> [2, Y].
    │ │ │ │ +represented by a single byte as well:

    encode({foo, X}) -> [1, X];
    │ │ │ │ +encode({bar, Y}) -> [2, Y].
    │ │ │ │  
    │ │ │ │ -decode([Int]) -> Int.

    The resulting Erlang program, including functions for stopping the port and │ │ │ │ +decode([Int]) -> Int.

    The resulting Erlang program, including functions for stopping the port and │ │ │ │ detecting port failures, is as follows:

    
    │ │ │ │ --module(complex5).
    │ │ │ │ --export([start/1, stop/0, init/1]).
    │ │ │ │ --export([foo/1, bar/1]).
    │ │ │ │ +-module(complex5).
    │ │ │ │ +-export([start/1, stop/0, init/1]).
    │ │ │ │ +-export([foo/1, bar/1]).
    │ │ │ │  
    │ │ │ │ -start(SharedLib) ->
    │ │ │ │ -    case erl_ddll:load_driver(".", SharedLib) of
    │ │ │ │ +start(SharedLib) ->
    │ │ │ │ +    case erl_ddll:load_driver(".", SharedLib) of
    │ │ │ │  	ok -> ok;
    │ │ │ │ -	{error, already_loaded} -> ok;
    │ │ │ │ -	_ -> exit({error, could_not_load_driver})
    │ │ │ │ +	{error, already_loaded} -> ok;
    │ │ │ │ +	_ -> exit({error, could_not_load_driver})
    │ │ │ │      end,
    │ │ │ │ -    spawn(?MODULE, init, [SharedLib]).
    │ │ │ │ +    spawn(?MODULE, init, [SharedLib]).
    │ │ │ │  
    │ │ │ │ -init(SharedLib) ->
    │ │ │ │ -    register(complex, self()),
    │ │ │ │ -    Port = open_port({spawn, SharedLib}, []),
    │ │ │ │ -    loop(Port).
    │ │ │ │ +init(SharedLib) ->
    │ │ │ │ +    register(complex, self()),
    │ │ │ │ +    Port = open_port({spawn, SharedLib}, []),
    │ │ │ │ +    loop(Port).
    │ │ │ │  
    │ │ │ │ -stop() ->
    │ │ │ │ +stop() ->
    │ │ │ │      complex ! stop.
    │ │ │ │  
    │ │ │ │ -foo(X) ->
    │ │ │ │ -    call_port({foo, X}).
    │ │ │ │ -bar(Y) ->
    │ │ │ │ -    call_port({bar, Y}).
    │ │ │ │ +foo(X) ->
    │ │ │ │ +    call_port({foo, X}).
    │ │ │ │ +bar(Y) ->
    │ │ │ │ +    call_port({bar, Y}).
    │ │ │ │  
    │ │ │ │ -call_port(Msg) ->
    │ │ │ │ -    complex ! {call, self(), Msg},
    │ │ │ │ +call_port(Msg) ->
    │ │ │ │ +    complex ! {call, self(), Msg},
    │ │ │ │      receive
    │ │ │ │ -	{complex, Result} ->
    │ │ │ │ +	{complex, Result} ->
    │ │ │ │  	    Result
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -loop(Port) ->
    │ │ │ │ +loop(Port) ->
    │ │ │ │      receive
    │ │ │ │ -	{call, Caller, Msg} ->
    │ │ │ │ -	    Port ! {self(), {command, encode(Msg)}},
    │ │ │ │ +	{call, Caller, Msg} ->
    │ │ │ │ +	    Port ! {self(), {command, encode(Msg)}},
    │ │ │ │  	    receive
    │ │ │ │ -		{Port, {data, Data}} ->
    │ │ │ │ -		    Caller ! {complex, decode(Data)}
    │ │ │ │ +		{Port, {data, Data}} ->
    │ │ │ │ +		    Caller ! {complex, decode(Data)}
    │ │ │ │  	    end,
    │ │ │ │ -	    loop(Port);
    │ │ │ │ +	    loop(Port);
    │ │ │ │  	stop ->
    │ │ │ │ -	    Port ! {self(), close},
    │ │ │ │ +	    Port ! {self(), close},
    │ │ │ │  	    receive
    │ │ │ │ -		{Port, closed} ->
    │ │ │ │ -		    exit(normal)
    │ │ │ │ +		{Port, closed} ->
    │ │ │ │ +		    exit(normal)
    │ │ │ │  	    end;
    │ │ │ │ -	{'EXIT', Port, Reason} ->
    │ │ │ │ -	    io:format("~p ~n", [Reason]),
    │ │ │ │ -	    exit(port_terminated)
    │ │ │ │ +	{'EXIT', Port, Reason} ->
    │ │ │ │ +	    io:format("~p ~n", [Reason]),
    │ │ │ │ +	    exit(port_terminated)
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -encode({foo, X}) -> [1, X];
    │ │ │ │ -encode({bar, Y}) -> [2, Y].
    │ │ │ │ +encode({foo, X}) -> [1, X];
    │ │ │ │ +encode({bar, Y}) -> [2, Y].
    │ │ │ │  
    │ │ │ │ -decode([Int]) -> Int.

    │ │ │ │ +decode([Int]) -> Int.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ C Driver │ │ │ │

    │ │ │ │

    The C driver is a module that is compiled and linked into a shared library. It │ │ │ │ uses a driver structure and includes the header file erl_driver.h.

    The driver structure is filled with the driver name and function pointers. It is │ │ │ │ @@ -252,22 +252,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Running the Example │ │ │ │

    │ │ │ │

    Step 1. Compile the C code:

    unix> gcc -o example_drv.so -fpic -shared complex.c port_driver.c
    │ │ │ │  windows> cl -LD -MD -Fe example_drv.dll complex.c port_driver.c

    Step 2. Start Erlang and compile the Erlang code:

    > erl
    │ │ │ │ -Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
    │ │ │ │ +Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
    │ │ │ │  
    │ │ │ │ -Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
    │ │ │ │ -1> c(complex5).
    │ │ │ │ -{ok,complex5}

    Step 3. Run the example:

    2> complex5:start("example_drv").
    │ │ │ │ +Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
    │ │ │ │ +1> c(complex5).
    │ │ │ │ +{ok,complex5}

    Step 3. Run the example:

    2> complex5:start("example_drv").
    │ │ │ │  <0.34.0>
    │ │ │ │ -3> complex5:foo(3).
    │ │ │ │ +3> complex5:foo(3).
    │ │ │ │  4
    │ │ │ │ -4> complex5:bar(5).
    │ │ │ │ +4> complex5:bar(5).
    │ │ │ │  10
    │ │ │ │ -5> complex5:stop().
    │ │ │ │ +5> complex5:stop().
    │ │ │ │  stop
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/c_port.xhtml │ │ │ │ @@ -53,101 +53,101 @@ │ │ │ │ external program, if it is written properly).

    The port is created using the BIF open_port/2 with │ │ │ │ {spawn,ExtPrg} as the first argument. The string ExtPrg is the name of the │ │ │ │ external program, including any command line arguments. The second argument is a │ │ │ │ list of options, in this case only {packet,2}. This option says that a 2 byte │ │ │ │ length indicator is to be used to simplify the communication between C and │ │ │ │ Erlang. The Erlang port automatically adds the length indicator, but this must │ │ │ │ be done explicitly in the external C program.

    The process is also set to trap exits, which enables detection of failure of the │ │ │ │ -external program:

    -module(complex1).
    │ │ │ │ --export([start/1, init/1]).
    │ │ │ │ +external program:

    -module(complex1).
    │ │ │ │ +-export([start/1, init/1]).
    │ │ │ │  
    │ │ │ │ -start(ExtPrg) ->
    │ │ │ │ -  spawn(?MODULE, init, [ExtPrg]).
    │ │ │ │ +start(ExtPrg) ->
    │ │ │ │ +  spawn(?MODULE, init, [ExtPrg]).
    │ │ │ │  
    │ │ │ │ -init(ExtPrg) ->
    │ │ │ │ -  register(complex, self()),
    │ │ │ │ -  process_flag(trap_exit, true),
    │ │ │ │ -  Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
    │ │ │ │ -  loop(Port).

    Now complex1:foo/1 and complex1:bar/1 can be implemented. Both send a │ │ │ │ -message to the complex process and receive the following replies:

    foo(X) ->
    │ │ │ │ -  call_port({foo, X}).
    │ │ │ │ -bar(Y) ->
    │ │ │ │ -  call_port({bar, Y}).
    │ │ │ │ +init(ExtPrg) ->
    │ │ │ │ +  register(complex, self()),
    │ │ │ │ +  process_flag(trap_exit, true),
    │ │ │ │ +  Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
    │ │ │ │ +  loop(Port).

    Now complex1:foo/1 and complex1:bar/1 can be implemented. Both send a │ │ │ │ +message to the complex process and receive the following replies:

    foo(X) ->
    │ │ │ │ +  call_port({foo, X}).
    │ │ │ │ +bar(Y) ->
    │ │ │ │ +  call_port({bar, Y}).
    │ │ │ │  
    │ │ │ │ -call_port(Msg) ->
    │ │ │ │ -  complex ! {call, self(), Msg},
    │ │ │ │ +call_port(Msg) ->
    │ │ │ │ +  complex ! {call, self(), Msg},
    │ │ │ │    receive
    │ │ │ │ -    {complex, Result} ->
    │ │ │ │ +    {complex, Result} ->
    │ │ │ │        Result
    │ │ │ │ -  end.

    The complex process does the following:

    • Encodes the message into a sequence of bytes.
    • Sends it to the port.
    • Waits for a reply.
    • Decodes the reply.
    • Sends it back to the caller:
    loop(Port) ->
    │ │ │ │ +  end.

    The complex process does the following:

    • Encodes the message into a sequence of bytes.
    • Sends it to the port.
    • Waits for a reply.
    • Decodes the reply.
    • Sends it back to the caller:
    loop(Port) ->
    │ │ │ │    receive
    │ │ │ │ -    {call, Caller, Msg} ->
    │ │ │ │ -      Port ! {self(), {command, encode(Msg)}},
    │ │ │ │ +    {call, Caller, Msg} ->
    │ │ │ │ +      Port ! {self(), {command, encode(Msg)}},
    │ │ │ │        receive
    │ │ │ │ -        {Port, {data, Data}} ->
    │ │ │ │ -          Caller ! {complex, decode(Data)}
    │ │ │ │ +        {Port, {data, Data}} ->
    │ │ │ │ +          Caller ! {complex, decode(Data)}
    │ │ │ │        end,
    │ │ │ │ -      loop(Port)
    │ │ │ │ +      loop(Port)
    │ │ │ │    end.

    Assuming that both the arguments and the results from the C functions are less │ │ │ │ than 256, a simple encoding/decoding scheme is employed. In this scheme, foo │ │ │ │ is represented by byte 1, bar is represented by 2, and the argument/result is │ │ │ │ -represented by a single byte as well:

    encode({foo, X}) -> [1, X];
    │ │ │ │ -encode({bar, Y}) -> [2, Y].
    │ │ │ │ +represented by a single byte as well:

    encode({foo, X}) -> [1, X];
    │ │ │ │ +encode({bar, Y}) -> [2, Y].
    │ │ │ │  
    │ │ │ │ -decode([Int]) -> Int.

    The resulting Erlang program, including functionality for stopping the port and │ │ │ │ -detecting port failures, is as follows:

    -module(complex1).
    │ │ │ │ --export([start/1, stop/0, init/1]).
    │ │ │ │ --export([foo/1, bar/1]).
    │ │ │ │ -
    │ │ │ │ -start(ExtPrg) ->
    │ │ │ │ -    spawn(?MODULE, init, [ExtPrg]).
    │ │ │ │ -stop() ->
    │ │ │ │ +decode([Int]) -> Int.

    The resulting Erlang program, including functionality for stopping the port and │ │ │ │ +detecting port failures, is as follows:

    -module(complex1).
    │ │ │ │ +-export([start/1, stop/0, init/1]).
    │ │ │ │ +-export([foo/1, bar/1]).
    │ │ │ │ +
    │ │ │ │ +start(ExtPrg) ->
    │ │ │ │ +    spawn(?MODULE, init, [ExtPrg]).
    │ │ │ │ +stop() ->
    │ │ │ │      complex ! stop.
    │ │ │ │  
    │ │ │ │ -foo(X) ->
    │ │ │ │ -    call_port({foo, X}).
    │ │ │ │ -bar(Y) ->
    │ │ │ │ -    call_port({bar, Y}).
    │ │ │ │ +foo(X) ->
    │ │ │ │ +    call_port({foo, X}).
    │ │ │ │ +bar(Y) ->
    │ │ │ │ +    call_port({bar, Y}).
    │ │ │ │  
    │ │ │ │ -call_port(Msg) ->
    │ │ │ │ -    complex ! {call, self(), Msg},
    │ │ │ │ +call_port(Msg) ->
    │ │ │ │ +    complex ! {call, self(), Msg},
    │ │ │ │      receive
    │ │ │ │ -	{complex, Result} ->
    │ │ │ │ +	{complex, Result} ->
    │ │ │ │  	    Result
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -init(ExtPrg) ->
    │ │ │ │ -    register(complex, self()),
    │ │ │ │ -    process_flag(trap_exit, true),
    │ │ │ │ -    Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
    │ │ │ │ -    loop(Port).
    │ │ │ │ +init(ExtPrg) ->
    │ │ │ │ +    register(complex, self()),
    │ │ │ │ +    process_flag(trap_exit, true),
    │ │ │ │ +    Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
    │ │ │ │ +    loop(Port).
    │ │ │ │  
    │ │ │ │ -loop(Port) ->
    │ │ │ │ +loop(Port) ->
    │ │ │ │      receive
    │ │ │ │ -	{call, Caller, Msg} ->
    │ │ │ │ -	    Port ! {self(), {command, encode(Msg)}},
    │ │ │ │ +	{call, Caller, Msg} ->
    │ │ │ │ +	    Port ! {self(), {command, encode(Msg)}},
    │ │ │ │  	    receive
    │ │ │ │ -		{Port, {data, Data}} ->
    │ │ │ │ -		    Caller ! {complex, decode(Data)}
    │ │ │ │ +		{Port, {data, Data}} ->
    │ │ │ │ +		    Caller ! {complex, decode(Data)}
    │ │ │ │  	    end,
    │ │ │ │ -	    loop(Port);
    │ │ │ │ +	    loop(Port);
    │ │ │ │  	stop ->
    │ │ │ │ -	    Port ! {self(), close},
    │ │ │ │ +	    Port ! {self(), close},
    │ │ │ │  	    receive
    │ │ │ │ -		{Port, closed} ->
    │ │ │ │ -		    exit(normal)
    │ │ │ │ +		{Port, closed} ->
    │ │ │ │ +		    exit(normal)
    │ │ │ │  	    end;
    │ │ │ │ -	{'EXIT', Port, Reason} ->
    │ │ │ │ -	    exit(port_terminated)
    │ │ │ │ +	{'EXIT', Port, Reason} ->
    │ │ │ │ +	    exit(port_terminated)
    │ │ │ │      end.
    │ │ │ │  
    │ │ │ │ -encode({foo, X}) -> [1, X];
    │ │ │ │ -encode({bar, Y}) -> [2, Y].
    │ │ │ │ +encode({foo, X}) -> [1, X];
    │ │ │ │ +encode({bar, Y}) -> [2, Y].
    │ │ │ │  
    │ │ │ │ -decode([Int]) -> Int.

    │ │ │ │ +decode([Int]) -> Int.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ C Program │ │ │ │

    │ │ │ │

    On the C side, it is necessary to write functions for receiving and sending data │ │ │ │ with 2 byte length indicators from/to Erlang. By default, the C program is to │ │ │ │ @@ -238,22 +238,22 @@ │ │ │ │ and terminates.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Running the Example │ │ │ │

    │ │ │ │

    Step 1. Compile the C code:

    $ gcc -o extprg complex.c erl_comm.c port.c

    Step 2. Start Erlang and compile the Erlang code:

    $ erl
    │ │ │ │ -Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
    │ │ │ │ +Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
    │ │ │ │  
    │ │ │ │ -Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
    │ │ │ │ -1> c(complex1).
    │ │ │ │ -{ok,complex1}

    Step 3. Run the example:

    2> complex1:start("./extprg").
    │ │ │ │ +Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
    │ │ │ │ +1> c(complex1).
    │ │ │ │ +{ok,complex1}

    Step 3. Run the example:

    2> complex1:start("./extprg").
    │ │ │ │  <0.34.0>
    │ │ │ │ -3> complex1:foo(3).
    │ │ │ │ +3> complex1:foo(3).
    │ │ │ │  4
    │ │ │ │ -4> complex1:bar(5).
    │ │ │ │ +4> complex1:bar(5).
    │ │ │ │  10
    │ │ │ │ -5> complex1:stop().
    │ │ │ │ +5> complex1:stop().
    │ │ │ │  stop
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/bit_syntax.xhtml │ │ │ │ @@ -24,48 +24,48 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Introduction │ │ │ │ │ │ │ │

    The complete specification for the bit syntax appears in the │ │ │ │ Reference Manual.

    In Erlang, a Bin is used for constructing binaries and matching binary patterns. │ │ │ │ -A Bin is written with the following syntax:

    <<E1, E2, ... En>>

    A Bin is a low-level sequence of bits or bytes. The purpose of a Bin is to │ │ │ │ -enable construction of binaries:

    Bin = <<E1, E2, ... En>>

    All elements must be bound. Or match a binary:

    <<E1, E2, ... En>> = Bin

    Here, Bin is bound and the elements are bound or unbound, as in any match.

    A Bin does not need to consist of a whole number of bytes.

    A bitstring is a sequence of zero or more bits, where the number of bits does │ │ │ │ +A Bin is written with the following syntax:

    <<E1, E2, ... En>>

    A Bin is a low-level sequence of bits or bytes. The purpose of a Bin is to │ │ │ │ +enable construction of binaries:

    Bin = <<E1, E2, ... En>>

    All elements must be bound. Or match a binary:

    <<E1, E2, ... En>> = Bin

    Here, Bin is bound and the elements are bound or unbound, as in any match.

    A Bin does not need to consist of a whole number of bytes.

    A bitstring is a sequence of zero or more bits, where the number of bits does │ │ │ │ not need to be divisible by 8. If the number of bits is divisible by 8, the │ │ │ │ bitstring is also a binary.

    Each element specifies a certain segment of the bitstring. A segment is a set │ │ │ │ of contiguous bits of the binary (not necessarily on a byte boundary). The first │ │ │ │ element specifies the initial segment, the second element specifies the │ │ │ │ following segment, and so on.

    The following examples illustrate how binaries are constructed, or matched, and │ │ │ │ how elements and tails are specified.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Examples │ │ │ │

    │ │ │ │

    Example 1: A binary can be constructed from a set of constants or a string │ │ │ │ -literal:

    Bin11 = <<1, 17, 42>>,
    │ │ │ │ -Bin12 = <<"abc">>

    This gives two binaries of size 3, with the following evaluations:

    Example 2:Similarly, a binary can be constructed from a set of bound │ │ │ │ +literal:

    Bin11 = <<1, 17, 42>>,
    │ │ │ │ +Bin12 = <<"abc">>

    This gives two binaries of size 3, with the following evaluations:

    Example 2:Similarly, a binary can be constructed from a set of bound │ │ │ │ variables:

    A = 1, B = 17, C = 42,
    │ │ │ │ -Bin2 = <<A, B, C:16>>

    This gives a binary of size 4. Here, a size expression is used for the │ │ │ │ +Bin2 = <<A, B, C:16>>

    This gives a binary of size 4. Here, a size expression is used for the │ │ │ │ variable C to specify a 16-bits segment of Bin2.

    binary_to_list(Bin2) evaluates to [1, 17, 00, 42].

    Example 3: A Bin can also be used for matching. D, E, and F are unbound │ │ │ │ -variables, and Bin2 is bound, as in Example 2:

    <<D:16, E, F/binary>> = Bin2

    This gives D = 273, E = 00, and F binds to a binary of size 1: │ │ │ │ +variables, and Bin2 is bound, as in Example 2:

    <<D:16, E, F/binary>> = Bin2

    This gives D = 273, E = 00, and F binds to a binary of size 1: │ │ │ │ binary_to_list(F) = [42].

    Example 4: The following is a more elaborate example of matching. Here, │ │ │ │ Dgram is bound to the consecutive bytes of an IP datagram of IP protocol │ │ │ │ -version 4. The ambition is to extract the header and the data of the datagram:

    -define(IP_VERSION, 4).
    │ │ │ │ --define(IP_MIN_HDR_LEN, 5).
    │ │ │ │ +version 4. The ambition is to extract the header and the data of the datagram:

    -define(IP_VERSION, 4).
    │ │ │ │ +-define(IP_MIN_HDR_LEN, 5).
    │ │ │ │  
    │ │ │ │ -DgramSize = byte_size(Dgram),
    │ │ │ │ +DgramSize = byte_size(Dgram),
    │ │ │ │  case Dgram of
    │ │ │ │ -    <<?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16,
    │ │ │ │ +    <<?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16,
    │ │ │ │        ID:16, Flgs:3, FragOff:13,
    │ │ │ │        TTL:8, Proto:8, HdrChkSum:16,
    │ │ │ │        SrcIP:32,
    │ │ │ │ -      DestIP:32, RestDgram/binary>> when HLen>=5, 4*HLen=<DgramSize ->
    │ │ │ │ -        OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN),
    │ │ │ │ -        <<Opts:OptsLen/binary,Data/binary>> = RestDgram,
    │ │ │ │ +      DestIP:32, RestDgram/binary>> when HLen>=5, 4*HLen=<DgramSize ->
    │ │ │ │ +        OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN),
    │ │ │ │ +        <<Opts:OptsLen/binary,Data/binary>> = RestDgram,
    │ │ │ │      ...
    │ │ │ │  end.

    Here, the segment corresponding to the Opts variable has a type modifier, │ │ │ │ specifying that Opts is to bind to a binary. All other variables have the │ │ │ │ default type equal to unsigned integer.

    An IP datagram header is of variable length. This length is measured in the │ │ │ │ number of 32-bit words and is given in the segment corresponding to HLen. The │ │ │ │ minimum value of HLen is 5. It is the segment corresponding to Opts that is │ │ │ │ variable, so if HLen is equal to 5, Opts becomes an empty binary.

    The tail variables RestDgram and Data bind to binaries, as all tail │ │ │ │ @@ -123,77 +123,77 @@ │ │ │ │

    This section describes the rules for constructing binaries using the bit syntax. │ │ │ │ Unlike when constructing lists or tuples, the construction of a binary can fail │ │ │ │ with a badarg exception.

    There can be zero or more segments in a binary to be constructed. The expression │ │ │ │ <<>> constructs a zero length binary.

    Each segment in a binary can consist of zero or more bits. There are no │ │ │ │ alignment rules for individual segments of type integer and float. For │ │ │ │ binaries and bitstrings without size, the unit specifies the alignment. Since │ │ │ │ the default alignment for the binary type is 8, the size of a binary segment │ │ │ │ -must be a multiple of 8 bits, that is, only whole bytes.

    Example:

    <<Bin/binary,Bitstring/bitstring>>

    The variable Bin must contain a whole number of bytes, because the binary │ │ │ │ +must be a multiple of 8 bits, that is, only whole bytes.

    Example:

    <<Bin/binary,Bitstring/bitstring>>

    The variable Bin must contain a whole number of bytes, because the binary │ │ │ │ type defaults to unit:8. A badarg exception is generated if Bin consist │ │ │ │ of, for example, 17 bits.

    The Bitstring variable can consist of any number of bits, for example, 0, 1, │ │ │ │ 8, 11, 17, 42, and so on. This is because the default unit for bitstrings │ │ │ │ is 1.

    For clarity, it is recommended not to change the unit size for binaries. │ │ │ │ Instead, use binary when you need byte alignment and bitstring when you need │ │ │ │ bit alignment.

    The following example successfully constructs a bitstring of 7 bits, provided │ │ │ │ -that all of X and Y are integers:

    <<X:1,Y:6>>

    As mentioned earlier, segments have the following general syntax:

    Value:Size/TypeSpecifierList

    When constructing binaries, Value and Size can be any Erlang expression. │ │ │ │ +that all of X and Y are integers:

    <<X:1,Y:6>>

    As mentioned earlier, segments have the following general syntax:

    Value:Size/TypeSpecifierList

    When constructing binaries, Value and Size can be any Erlang expression. │ │ │ │ However, for syntactical reasons, both Value and Size must be enclosed in │ │ │ │ parenthesis if the expression consists of anything more than a single literal or │ │ │ │ -a variable. The following gives a compiler syntax error:

    <<X+1:8>>

    This expression must be rewritten into the following, to be accepted by the │ │ │ │ -compiler:

    <<(X+1):8>>

    │ │ │ │ +a variable. The following gives a compiler syntax error:

    <<X+1:8>>

    This expression must be rewritten into the following, to be accepted by the │ │ │ │ +compiler:

    <<(X+1):8>>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Including Literal Strings │ │ │ │

    │ │ │ │ -

    A literal string can be written instead of an element:

    <<"hello">>

    This is syntactic sugar for the following:

    <<$h,$e,$l,$l,$o>>

    │ │ │ │ +

    A literal string can be written instead of an element:

    <<"hello">>

    This is syntactic sugar for the following:

    <<$h,$e,$l,$l,$o>>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Matching Binaries │ │ │ │

    │ │ │ │

    This section describes the rules for matching binaries, using the bit syntax.

    There can be zero or more segments in a binary pattern. A binary pattern can │ │ │ │ occur wherever patterns are allowed, including inside other patterns. Binary │ │ │ │ patterns cannot be nested. The pattern <<>> matches a zero length binary.

    Each segment in a binary can consist of zero or more bits. A segment of type │ │ │ │ binary must have a size evenly divisible by 8 (or divisible by the unit size, │ │ │ │ if the unit size has been changed). A segment of type bitstring has no │ │ │ │ restrictions on the size. A segment of type float must have size 64 or 32.

    As mentioned earlier, segments have the following general syntax:

    Value:Size/TypeSpecifierList

    When matching Value, value must be either a variable or an integer, or a │ │ │ │ floating point literal. Expressions are not allowed.

    Size must be a │ │ │ │ guard expression, which can use │ │ │ │ -literals and previously bound variables. The following is not allowed:

    foo(N, <<X:N,T/binary>>) ->
    │ │ │ │ -   {X,T}.

    The two occurrences of N are not related. The compiler will complain that the │ │ │ │ -N in the size field is unbound.

    The correct way to write this example is as follows:

    foo(N, Bin) ->
    │ │ │ │ -   <<X:N,T/binary>> = Bin,
    │ │ │ │ -   {X,T}.

    Note

    Before OTP 23, Size was restricted to be an integer or a variable bound to │ │ │ │ +literals and previously bound variables. The following is not allowed:

    foo(N, <<X:N,T/binary>>) ->
    │ │ │ │ +   {X,T}.

    The two occurrences of N are not related. The compiler will complain that the │ │ │ │ +N in the size field is unbound.

    The correct way to write this example is as follows:

    foo(N, Bin) ->
    │ │ │ │ +   <<X:N,T/binary>> = Bin,
    │ │ │ │ +   {X,T}.

    Note

    Before OTP 23, Size was restricted to be an integer or a variable bound to │ │ │ │ an integer.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Binding and Using a Size Variable │ │ │ │

    │ │ │ │

    There is one exception to the rule that a variable that is used as size must be │ │ │ │ previously bound. It is possible to match and bind a variable, and use it as a │ │ │ │ -size within the same binary pattern. For example:

    bar(<<Sz:8,Payload:Sz/binary-unit:8,Rest/binary>>) ->
    │ │ │ │ -   {Payload,Rest}.

    Here Sz is bound to the value in the first byte of the binary. Sz is then │ │ │ │ -used at the number of bytes to match out as a binary.

    Starting in OTP 23, the size can be a guard expression:

    bar(<<Sz:8,Payload:((Sz-1)*8)/binary,Rest/binary>>) ->
    │ │ │ │ -   {Payload,Rest}.

    Here Sz is the combined size of the header and the payload, so we will need to │ │ │ │ +size within the same binary pattern. For example:

    bar(<<Sz:8,Payload:Sz/binary-unit:8,Rest/binary>>) ->
    │ │ │ │ +   {Payload,Rest}.

    Here Sz is bound to the value in the first byte of the binary. Sz is then │ │ │ │ +used at the number of bytes to match out as a binary.

    Starting in OTP 23, the size can be a guard expression:

    bar(<<Sz:8,Payload:((Sz-1)*8)/binary,Rest/binary>>) ->
    │ │ │ │ +   {Payload,Rest}.

    Here Sz is the combined size of the header and the payload, so we will need to │ │ │ │ subtract one byte to get the size of the payload.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Getting the Rest of the Binary or Bitstring │ │ │ │

    │ │ │ │ -

    To match out the rest of a binary, specify a binary field without size:

    foo(<<A:8,Rest/binary>>) ->

    The size of the tail must be evenly divisible by 8.

    To match out the rest of a bitstring, specify a field without size:

    foo(<<A:8,Rest/bitstring>>) ->

    There are no restrictions on the number of bits in the tail.

    │ │ │ │ +

    To match out the rest of a binary, specify a binary field without size:

    foo(<<A:8,Rest/binary>>) ->

    The size of the tail must be evenly divisible by 8.

    To match out the rest of a bitstring, specify a field without size:

    foo(<<A:8,Rest/bitstring>>) ->

    There are no restrictions on the number of bits in the tail.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Appending to a Binary │ │ │ │

    │ │ │ │ -

    Appending to a binary in an efficient way can be done as follows:

    triples_to_bin(T) ->
    │ │ │ │ -    triples_to_bin(T, <<>>).
    │ │ │ │ +

    Appending to a binary in an efficient way can be done as follows:

    triples_to_bin(T) ->
    │ │ │ │ +    triples_to_bin(T, <<>>).
    │ │ │ │  
    │ │ │ │ -triples_to_bin([{X,Y,Z} | T], Acc) ->
    │ │ │ │ -    triples_to_bin(T, <<Acc/binary,X:32,Y:32,Z:32>>);
    │ │ │ │ -triples_to_bin([], Acc) ->
    │ │ │ │ +triples_to_bin([{X,Y,Z} | T], Acc) ->
    │ │ │ │ +    triples_to_bin(T, <<Acc/binary,X:32,Y:32,Z:32>>);
    │ │ │ │ +triples_to_bin([], Acc) ->
    │ │ │ │      Acc.
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/binaryhandling.xhtml │ │ │ │ @@ -19,43 +19,43 @@ │ │ │ │ │ │ │ │

    │ │ │ │ Constructing and Matching Binaries │ │ │ │

    │ │ │ │

    This section gives a few examples on how to handle binaries in an efficient way. │ │ │ │ The sections that follow take an in-depth look at how binaries are implemented │ │ │ │ and how to best take advantages of the optimizations done by the compiler and │ │ │ │ -runtime system.

    Binaries can be efficiently built in the following way:

    DO

    my_list_to_binary(List) ->
    │ │ │ │ -    my_list_to_binary(List, <<>>).
    │ │ │ │ +runtime system.

    Binaries can be efficiently built in the following way:

    DO

    my_list_to_binary(List) ->
    │ │ │ │ +    my_list_to_binary(List, <<>>).
    │ │ │ │  
    │ │ │ │ -my_list_to_binary([H|T], Acc) ->
    │ │ │ │ -    my_list_to_binary(T, <<Acc/binary,H>>);
    │ │ │ │ -my_list_to_binary([], Acc) ->
    │ │ │ │ +my_list_to_binary([H|T], Acc) ->
    │ │ │ │ +    my_list_to_binary(T, <<Acc/binary,H>>);
    │ │ │ │ +my_list_to_binary([], Acc) ->
    │ │ │ │      Acc.

    Appending data to a binary as in the example is efficient because it is │ │ │ │ specially optimized by the runtime system to avoid copying the Acc binary │ │ │ │ -every time.

    Prepending data to a binary in a loop is not efficient:

    DO NOT

    rev_list_to_binary(List) ->
    │ │ │ │ -    rev_list_to_binary(List, <<>>).
    │ │ │ │ +every time.

    Prepending data to a binary in a loop is not efficient:

    DO NOT

    rev_list_to_binary(List) ->
    │ │ │ │ +    rev_list_to_binary(List, <<>>).
    │ │ │ │  
    │ │ │ │ -rev_list_to_binary([H|T], Acc) ->
    │ │ │ │ -    rev_list_to_binary(T, <<H,Acc/binary>>);
    │ │ │ │ -rev_list_to_binary([], Acc) ->
    │ │ │ │ +rev_list_to_binary([H|T], Acc) ->
    │ │ │ │ +    rev_list_to_binary(T, <<H,Acc/binary>>);
    │ │ │ │ +rev_list_to_binary([], Acc) ->
    │ │ │ │      Acc.

    This is not efficient for long lists because the Acc binary is copied every │ │ │ │ -time. One way to make the function more efficient is like this:

    DO NOT

    rev_list_to_binary(List) ->
    │ │ │ │ -    rev_list_to_binary(lists:reverse(List), <<>>).
    │ │ │ │ +time. One way to make the function more efficient is like this:

    DO NOT

    rev_list_to_binary(List) ->
    │ │ │ │ +    rev_list_to_binary(lists:reverse(List), <<>>).
    │ │ │ │  
    │ │ │ │ -rev_list_to_binary([H|T], Acc) ->
    │ │ │ │ -    rev_list_to_binary(T, <<Acc/binary,H>>);
    │ │ │ │ -rev_list_to_binary([], Acc) ->
    │ │ │ │ -    Acc.

    Another way to avoid copying the binary each time is like this:

    DO

    rev_list_to_binary([H|T]) ->
    │ │ │ │ -    RevTail = rev_list_to_binary(T),
    │ │ │ │ -    <<RevTail/binary,H>>;
    │ │ │ │ -rev_list_to_binary([]) ->
    │ │ │ │ -    <<>>.

    Note that in each of the DO examples, the binary to be appended to is always │ │ │ │ -given as the first segment.

    Binaries can be efficiently matched in the following way:

    DO

    my_binary_to_list(<<H,T/binary>>) ->
    │ │ │ │ -    [H|my_binary_to_list(T)];
    │ │ │ │ -my_binary_to_list(<<>>) -> [].

    │ │ │ │ +rev_list_to_binary([H|T], Acc) -> │ │ │ │ + rev_list_to_binary(T, <<Acc/binary,H>>); │ │ │ │ +rev_list_to_binary([], Acc) -> │ │ │ │ + Acc.

    Another way to avoid copying the binary each time is like this:

    DO

    rev_list_to_binary([H|T]) ->
    │ │ │ │ +    RevTail = rev_list_to_binary(T),
    │ │ │ │ +    <<RevTail/binary,H>>;
    │ │ │ │ +rev_list_to_binary([]) ->
    │ │ │ │ +    <<>>.

    Note that in each of the DO examples, the binary to be appended to is always │ │ │ │ +given as the first segment.

    Binaries can be efficiently matched in the following way:

    DO

    my_binary_to_list(<<H,T/binary>>) ->
    │ │ │ │ +    [H|my_binary_to_list(T)];
    │ │ │ │ +my_binary_to_list(<<>>) -> [].

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ How Binaries are Implemented │ │ │ │

    │ │ │ │

    Internally, binaries and bitstrings are implemented in the same way. In this │ │ │ │ section, they are called binaries because that is what they are called in the │ │ │ │ @@ -110,29 +110,29 @@ │ │ │ │ called referential transparency) of Erlang would break.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Constructing Binaries │ │ │ │

    │ │ │ │

    Appending to a binary or bitstring in the following way is specially optimized │ │ │ │ -to avoid copying the binary:

    <<Binary/binary, ...>>
    │ │ │ │ +to avoid copying the binary:

    <<Binary/binary, ...>>
    │ │ │ │  %% - OR -
    │ │ │ │ -<<Binary/bitstring, ...>>

    This optimization is applied by the runtime system in a way that makes it │ │ │ │ +<<Binary/bitstring, ...>>

    This optimization is applied by the runtime system in a way that makes it │ │ │ │ effective in most circumstances (for exceptions, see │ │ │ │ Circumstances That Force Copying). The │ │ │ │ optimization in its basic form does not need any help from the compiler. │ │ │ │ However, the compiler add hints to the runtime system when it is safe to apply │ │ │ │ the optimization in a more efficient way.

    Change

    The compiler support for making the optimization more efficient was added in │ │ │ │ Erlang/OTP 26.

    To explain how the basic optimization works, let us examine the following code │ │ │ │ -line by line:

    Bin0 = <<0>>,                    %% 1
    │ │ │ │ -Bin1 = <<Bin0/binary,1,2,3>>,    %% 2
    │ │ │ │ -Bin2 = <<Bin1/binary,4,5,6>>,    %% 3
    │ │ │ │ -Bin3 = <<Bin2/binary,7,8,9>>,    %% 4
    │ │ │ │ -Bin4 = <<Bin1/binary,17>>,       %% 5 !!!
    │ │ │ │ -{Bin4,Bin3}                      %% 6
    • Line 1 (marked with the %% 1 comment), assigns a │ │ │ │ +line by line:

      Bin0 = <<0>>,                    %% 1
      │ │ │ │ +Bin1 = <<Bin0/binary,1,2,3>>,    %% 2
      │ │ │ │ +Bin2 = <<Bin1/binary,4,5,6>>,    %% 3
      │ │ │ │ +Bin3 = <<Bin2/binary,7,8,9>>,    %% 4
      │ │ │ │ +Bin4 = <<Bin1/binary,17>>,       %% 5 !!!
      │ │ │ │ +{Bin4,Bin3}                      %% 6
      • Line 1 (marked with the %% 1 comment), assigns a │ │ │ │ heap binary to the Bin0 variable.

      • Line 2 is an append operation. As Bin0 has not been involved in an append │ │ │ │ operation, a new refc binary is created and │ │ │ │ the contents of Bin0 is copied into it. The ProcBin part of the refc │ │ │ │ binary has its size set to the size of the data stored in the binary, while │ │ │ │ the binary object has extra space allocated. The size of the binary object is │ │ │ │ either twice the size of Bin1 or 256, whichever is larger. In this case it │ │ │ │ is 256.

      • Line 3 is more interesting. Bin1 has been used in an append operation, and │ │ │ │ @@ -158,23 +158,23 @@ │ │ │ │ handle an append operation to a heap binary by copying it to a refc binary (line │ │ │ │ 2), and also handle an append operation to a previous version of the binary by │ │ │ │ copying it (line 5). The support for doing that does not come for free. For │ │ │ │ example, to make it possible to know when it is necessary to copy the binary, │ │ │ │ for every append operation, the runtime system must create a sub binary.

        When the compiler can determine that none of those situations need to be handled │ │ │ │ and that the append operation cannot possibly fail, the compiler generates code │ │ │ │ that causes the runtime system to apply a more efficient variant of the │ │ │ │ -optimization.

        Example:

        -module(repack).
        │ │ │ │ --export([repack/1]).
        │ │ │ │ +optimization.

        Example:

        -module(repack).
        │ │ │ │ +-export([repack/1]).
        │ │ │ │  
        │ │ │ │ -repack(Bin) when is_binary(Bin) ->
        │ │ │ │ -    repack(Bin, <<>>).
        │ │ │ │ +repack(Bin) when is_binary(Bin) ->
        │ │ │ │ +    repack(Bin, <<>>).
        │ │ │ │  
        │ │ │ │ -repack(<<C:8,T/binary>>, Result) ->
        │ │ │ │ -    repack(T, <<Result/binary,C:16>>);
        │ │ │ │ -repack(<<>>, Result) ->
        │ │ │ │ +repack(<<C:8,T/binary>>, Result) ->
        │ │ │ │ +    repack(T, <<Result/binary,C:16>>);
        │ │ │ │ +repack(<<>>, Result) ->
        │ │ │ │      Result.

        The repack/2 function only keeps a single version of the binary, so there is │ │ │ │ never any need to copy the binary. The compiler rewrites the creation of the │ │ │ │ empty binary in repack/1 to instead create a refc binary with 256 bytes │ │ │ │ already reserved; thus, the append operation in repack/2 never needs to handle │ │ │ │ a binary not prepared for appending.

        │ │ │ │ │ │ │ │ │ │ │ │ @@ -186,72 +186,72 @@ │ │ │ │ reason is that the binary object can be moved (reallocated) during an append │ │ │ │ operation, and when that happens, the pointer in the ProcBin must be updated. If │ │ │ │ there would be more than one ProcBin pointing to the binary object, it would not │ │ │ │ be possible to find and update all of them.

        Therefore, certain operations on a binary mark it so that any future append │ │ │ │ operation will be forced to copy the binary. In most cases, the binary object │ │ │ │ will be shrunk at the same time to reclaim the extra space allocated for │ │ │ │ growing.

        When appending to a binary as follows, only the binary returned from the latest │ │ │ │ -append operation will support further cheap append operations:

        Bin = <<Bin0,...>>

        In the code fragment in the beginning of this section, appending to Bin will │ │ │ │ +append operation will support further cheap append operations:

        Bin = <<Bin0,...>>

        In the code fragment in the beginning of this section, appending to Bin will │ │ │ │ be cheap, while appending to Bin0 will force the creation of a new binary and │ │ │ │ copying of the contents of Bin0.

        If a binary is sent as a message to a process or port, the binary will be shrunk │ │ │ │ and any further append operation will copy the binary data into a new binary. │ │ │ │ For example, in the following code fragment Bin1 will be copied in the third │ │ │ │ -line:

        Bin1 = <<Bin0,...>>,
        │ │ │ │ +line:

        Bin1 = <<Bin0,...>>,
        │ │ │ │  PortOrPid ! Bin1,
        │ │ │ │ -Bin = <<Bin1,...>>  %% Bin1 will be COPIED

        The same happens if you insert a binary into an Ets table, send it to a port │ │ │ │ +Bin = <<Bin1,...>> %% Bin1 will be COPIED

        The same happens if you insert a binary into an Ets table, send it to a port │ │ │ │ using erlang:port_command/2, or pass it to │ │ │ │ enif_inspect_binary in a NIF.

        Matching a binary will also cause it to shrink and the next append operation │ │ │ │ -will copy the binary data:

        Bin1 = <<Bin0,...>>,
        │ │ │ │ -<<X,Y,Z,T/binary>> = Bin1,
        │ │ │ │ -Bin = <<Bin1,...>>  %% Bin1 will be COPIED

        The reason is that a match context contains a │ │ │ │ +will copy the binary data:

        Bin1 = <<Bin0,...>>,
        │ │ │ │ +<<X,Y,Z,T/binary>> = Bin1,
        │ │ │ │ +Bin = <<Bin1,...>>  %% Bin1 will be COPIED

        The reason is that a match context contains a │ │ │ │ direct pointer to the binary data.

        If a process simply keeps binaries (either in "loop data" or in the process │ │ │ │ dictionary), the garbage collector can eventually shrink the binaries. If only │ │ │ │ one such binary is kept, it will not be shrunk. If the process later appends to │ │ │ │ a binary that has been shrunk, the binary object will be reallocated to make │ │ │ │ place for the data to be appended.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Matching Binaries │ │ │ │

        │ │ │ │ -

        Let us revisit the example in the beginning of the previous section:

        DO

        my_binary_to_list(<<H,T/binary>>) ->
        │ │ │ │ -    [H|my_binary_to_list(T)];
        │ │ │ │ -my_binary_to_list(<<>>) -> [].

        The first time my_binary_to_list/1 is called, a │ │ │ │ +

        Let us revisit the example in the beginning of the previous section:

        DO

        my_binary_to_list(<<H,T/binary>>) ->
        │ │ │ │ +    [H|my_binary_to_list(T)];
        │ │ │ │ +my_binary_to_list(<<>>) -> [].

        The first time my_binary_to_list/1 is called, a │ │ │ │ match context is created. The match context │ │ │ │ points to the first byte of the binary. 1 byte is matched out and the match │ │ │ │ context is updated to point to the second byte in the binary.

        At this point it would make sense to create a │ │ │ │ sub binary, but in this particular example the │ │ │ │ compiler sees that there will soon be a call to a function (in this case, to │ │ │ │ my_binary_to_list/1 itself) that immediately will create a new match context │ │ │ │ and discard the sub binary.

        Therefore my_binary_to_list/1 calls itself with the match context instead of │ │ │ │ with a sub binary. The instruction that initializes the matching operation │ │ │ │ basically does nothing when it sees that it was passed a match context instead │ │ │ │ of a binary.

        When the end of the binary is reached and the second clause matches, the match │ │ │ │ context will simply be discarded (removed in the next garbage collection, as │ │ │ │ there is no longer any reference to it).

        To summarize, my_binary_to_list/1 only needs to create one match context and │ │ │ │ no sub binaries.

        Notice that the match context in my_binary_to_list/1 was discarded when the │ │ │ │ entire binary had been traversed. What happens if the iteration stops before it │ │ │ │ -has reached the end of the binary? Will the optimization still work?

        after_zero(<<0,T/binary>>) ->
        │ │ │ │ +has reached the end of the binary? Will the optimization still work?

        after_zero(<<0,T/binary>>) ->
        │ │ │ │      T;
        │ │ │ │ -after_zero(<<_,T/binary>>) ->
        │ │ │ │ -    after_zero(T);
        │ │ │ │ -after_zero(<<>>) ->
        │ │ │ │ -    <<>>.

        Yes, it will. The compiler will remove the building of the sub binary in the │ │ │ │ +after_zero(<<_,T/binary>>) -> │ │ │ │ + after_zero(T); │ │ │ │ +after_zero(<<>>) -> │ │ │ │ + <<>>.

        Yes, it will. The compiler will remove the building of the sub binary in the │ │ │ │ second clause:

        ...
        │ │ │ │ -after_zero(<<_,T/binary>>) ->
        │ │ │ │ -    after_zero(T);
        │ │ │ │ -...

        But it will generate code that builds a sub binary in the first clause:

        after_zero(<<0,T/binary>>) ->
        │ │ │ │ +after_zero(<<_,T/binary>>) ->
        │ │ │ │ +    after_zero(T);
        │ │ │ │ +...

        But it will generate code that builds a sub binary in the first clause:

        after_zero(<<0,T/binary>>) ->
        │ │ │ │      T;
        │ │ │ │  ...

        Therefore, after_zero/1 builds one match context and one sub binary (assuming │ │ │ │ -it is passed a binary that contains a zero byte).

        Code like the following will also be optimized:

        all_but_zeroes_to_list(Buffer, Acc, 0) ->
        │ │ │ │ -    {lists:reverse(Acc),Buffer};
        │ │ │ │ -all_but_zeroes_to_list(<<0,T/binary>>, Acc, Remaining) ->
        │ │ │ │ -    all_but_zeroes_to_list(T, Acc, Remaining-1);
        │ │ │ │ -all_but_zeroes_to_list(<<Byte,T/binary>>, Acc, Remaining) ->
        │ │ │ │ -    all_but_zeroes_to_list(T, [Byte|Acc], Remaining-1).

        The compiler removes building of sub binaries in the second and third clauses, │ │ │ │ +it is passed a binary that contains a zero byte).

        Code like the following will also be optimized:

        all_but_zeroes_to_list(Buffer, Acc, 0) ->
        │ │ │ │ +    {lists:reverse(Acc),Buffer};
        │ │ │ │ +all_but_zeroes_to_list(<<0,T/binary>>, Acc, Remaining) ->
        │ │ │ │ +    all_but_zeroes_to_list(T, Acc, Remaining-1);
        │ │ │ │ +all_but_zeroes_to_list(<<Byte,T/binary>>, Acc, Remaining) ->
        │ │ │ │ +    all_but_zeroes_to_list(T, [Byte|Acc], Remaining-1).

        The compiler removes building of sub binaries in the second and third clauses, │ │ │ │ and it adds an instruction to the first clause that converts Buffer from a │ │ │ │ match context to a sub binary (or do nothing if Buffer is a binary already).

        But in more complicated code, how can one know whether the optimization is │ │ │ │ applied or not?

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Option bin_opt_info │ │ │ │ @@ -259,35 +259,35 @@ │ │ │ │

        Use the bin_opt_info option to have the compiler print a lot of information │ │ │ │ about binary optimizations. It can be given either to the compiler or erlc:

        erlc +bin_opt_info Mod.erl

        or passed through an environment variable:

        export ERL_COMPILER_OPTIONS=bin_opt_info

        Notice that the bin_opt_info is not meant to be a permanent option added to │ │ │ │ your Makefiles, because all messages that it generates cannot be eliminated. │ │ │ │ Therefore, passing the option through the environment is in most cases the most │ │ │ │ practical approach.

        The warnings look as follows:

        ./efficiency_guide.erl:60: Warning: NOT OPTIMIZED: binary is returned from the function
        │ │ │ │  ./efficiency_guide.erl:62: Warning: OPTIMIZED: match context reused

        To make it clearer exactly what code the warnings refer to, the warnings in the │ │ │ │ following examples are inserted as comments after the clause they refer to, for │ │ │ │ -example:

        after_zero(<<0,T/binary>>) ->
        │ │ │ │ +example:

        after_zero(<<0,T/binary>>) ->
        │ │ │ │           %% BINARY CREATED: binary is returned from the function
        │ │ │ │      T;
        │ │ │ │ -after_zero(<<_,T/binary>>) ->
        │ │ │ │ +after_zero(<<_,T/binary>>) ->
        │ │ │ │           %% OPTIMIZED: match context reused
        │ │ │ │ -    after_zero(T);
        │ │ │ │ -after_zero(<<>>) ->
        │ │ │ │ -    <<>>.

        The warning for the first clause says that the creation of a sub binary cannot │ │ │ │ + after_zero(T); │ │ │ │ +after_zero(<<>>) -> │ │ │ │ + <<>>.

        The warning for the first clause says that the creation of a sub binary cannot │ │ │ │ be delayed, because it will be returned. The warning for the second clause says │ │ │ │ that a sub binary will not be created (yet).

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Unused Variables │ │ │ │

        │ │ │ │

        The compiler figures out if a variable is unused. The same code is generated for │ │ │ │ -each of the following functions:

        count1(<<_,T/binary>>, Count) -> count1(T, Count+1);
        │ │ │ │ -count1(<<>>, Count) -> Count.
        │ │ │ │ +each of the following functions:

        count1(<<_,T/binary>>, Count) -> count1(T, Count+1);
        │ │ │ │ +count1(<<>>, Count) -> Count.
        │ │ │ │  
        │ │ │ │ -count2(<<H,T/binary>>, Count) -> count2(T, Count+1);
        │ │ │ │ -count2(<<>>, Count) -> Count.
        │ │ │ │ +count2(<<H,T/binary>>, Count) -> count2(T, Count+1);
        │ │ │ │ +count2(<<>>, Count) -> Count.
        │ │ │ │  
        │ │ │ │ -count3(<<_H,T/binary>>, Count) -> count3(T, Count+1);
        │ │ │ │ -count3(<<>>, Count) -> Count.

        In each iteration, the first 8 bits in the binary will be skipped, not matched │ │ │ │ +count3(<<_H,T/binary>>, Count) -> count3(T, Count+1); │ │ │ │ +count3(<<>>, Count) -> Count.

        In each iteration, the first 8 bits in the binary will be skipped, not matched │ │ │ │ out.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/benchmarking.xhtml │ │ │ │ @@ -49,16 +49,16 @@ │ │ │ │ fast as possible, what can we do? One way could be to generate more │ │ │ │ than two bytes at the time.

        % erlperf 'rand:bytes(100).' 'crypto:strong_rand_bytes(100).'
        │ │ │ │  Code                                   ||        QPS       Time   Rel
        │ │ │ │  rand:bytes(100).                        1    2124 Ki     470 ns  100%
        │ │ │ │  crypto:strong_rand_bytes(100).          1    1915 Ki     522 ns   90%

        rand:bytes/1 is still faster when we generate 100 bytes at the time, │ │ │ │ but the relative difference is smaller.

        % erlperf 'rand:bytes(1000).' 'crypto:strong_rand_bytes(1000).'
        │ │ │ │  Code                                    ||        QPS       Time   Rel
        │ │ │ │ -crypto:strong_rand_bytes(1000).          1    1518 Ki     658 ns  100%
        │ │ │ │ -rand:bytes(1000).                        1     284 Ki    3521 ns   19%

        When we generate 1000 bytes at the time, crypto:strong_rand_bytes/1 is │ │ │ │ +crypto:strong_rand_bytes(1000). 1 1518 Ki 658 ns 100% │ │ │ │ +rand:bytes(1000). 1 284 Ki 3521 ns 19%

        When we generate 1000 bytes at the time, crypto:strong_rand_bytes/1 is │ │ │ │ now the fastest.

        │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Benchmarking using Erlang/OTP functionality │ │ │ │

        │ │ │ │

        Benchmarks can measure wall-clock time or CPU time.

        • timer:tc/3 measures wall-clock time. The advantage with wall-clock time is │ │ │ ├── OEBPS/appup_cookbook.xhtml │ │ │ │ @@ -25,18 +25,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing a Functional Module │ │ │ │ │ │ │ │

          When a functional module has been changed, for example, if a new function has │ │ │ │ been added or a bug has been corrected, simple code replacement is sufficient, │ │ │ │ -for example:

          {"2",
          │ │ │ │ - [{"1", [{load_module, m}]}],
          │ │ │ │ - [{"1", [{load_module, m}]}]
          │ │ │ │ -}.

          │ │ │ │ +for example:

          {"2",
          │ │ │ │ + [{"1", [{load_module, m}]}],
          │ │ │ │ + [{"1", [{load_module, m}]}]
          │ │ │ │ +}.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing a Residence Module │ │ │ │

          │ │ │ │

          In a system implemented according to the OTP design principles, all processes, │ │ │ │ except system processes and special processes, reside in one of the behaviours │ │ │ │ @@ -47,46 +47,46 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing a Callback Module │ │ │ │ │ │ │ │

          A callback module is a functional module, and for code extensions simple code │ │ │ │ replacement is sufficient.

          Example

          When adding a function to ch3, as described in the example in │ │ │ │ -Release Handling, ch_app.appup looks as follows:

          {"2",
          │ │ │ │ - [{"1", [{load_module, ch3}]}],
          │ │ │ │ - [{"1", [{load_module, ch3}]}]
          │ │ │ │ -}.

          OTP also supports changing the internal state of behaviour processes; see │ │ │ │ +Release Handling, ch_app.appup looks as follows:

          {"2",
          │ │ │ │ + [{"1", [{load_module, ch3}]}],
          │ │ │ │ + [{"1", [{load_module, ch3}]}]
          │ │ │ │ +}.

          OTP also supports changing the internal state of behaviour processes; see │ │ │ │ Changing Internal State.

          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing Internal State │ │ │ │

          │ │ │ │

          In this case, simple code replacement is not sufficient. The process must │ │ │ │ explicitly transform its state using the callback function code_change/3 before │ │ │ │ switching to the new version of the callback module. Thus, synchronized code │ │ │ │ replacement is used.

          Example

          Consider the ch3 module from │ │ │ │ gen_server Behaviour. The internal state is a term │ │ │ │ Chs representing the available channels. Assume you want to add a counter N, │ │ │ │ which keeps track of the number of alloc requests so far. This means that the │ │ │ │ -format must be changed to {Chs,N}.

          The .appup file can look as follows:

          {"2",
          │ │ │ │ - [{"1", [{update, ch3, {advanced, []}}]}],
          │ │ │ │ - [{"1", [{update, ch3, {advanced, []}}]}]
          │ │ │ │ -}.

          The third element of the update instruction is a tuple {advanced,Extra}, │ │ │ │ +format must be changed to {Chs,N}.

          The .appup file can look as follows:

          {"2",
          │ │ │ │ + [{"1", [{update, ch3, {advanced, []}}]}],
          │ │ │ │ + [{"1", [{update, ch3, {advanced, []}}]}]
          │ │ │ │ +}.

          The third element of the update instruction is a tuple {advanced,Extra}, │ │ │ │ which says that the affected processes are to do a state transformation before │ │ │ │ loading the new version of the module. This is done by the processes calling the │ │ │ │ callback function code_change/3 (see gen_server in STDLIB). │ │ │ │ -The term Extra, in this case [], is passed as is to the function:

          -module(ch3).
          │ │ │ │ +The term Extra, in this case [], is passed as is to the function:

          -module(ch3).
          │ │ │ │  ...
          │ │ │ │ --export([code_change/3]).
          │ │ │ │ +-export([code_change/3]).
          │ │ │ │  ...
          │ │ │ │ -code_change({down, _Vsn}, {Chs, N}, _Extra) ->
          │ │ │ │ -    {ok, Chs};
          │ │ │ │ -code_change(_Vsn, Chs, _Extra) ->
          │ │ │ │ -    {ok, {Chs, 0}}.

          The first argument is {down,Vsn} if there is a downgrade, or Vsn if there is │ │ │ │ +code_change({down, _Vsn}, {Chs, N}, _Extra) -> │ │ │ │ + {ok, Chs}; │ │ │ │ +code_change(_Vsn, Chs, _Extra) -> │ │ │ │ + {ok, {Chs, 0}}.

          The first argument is {down,Vsn} if there is a downgrade, or Vsn if there is │ │ │ │ a upgrade. The term Vsn is fetched from the 'original' version of the module, │ │ │ │ that is, the version you are upgrading from, or downgrading to.

          The version is defined by the module attribute vsn, if any. There is no such │ │ │ │ attribute in ch3, so in this case the version is the checksum (a huge integer) │ │ │ │ of the beam file, an uninteresting value, which is ignored.

          The other callback functions of ch3 must also be modified and perhaps a new │ │ │ │ interface function must be added, but this is not shown here.

          │ │ │ │ │ │ │ │ │ │ │ │ @@ -95,67 +95,67 @@ │ │ │ │

          │ │ │ │

          Assume that a module is extended by adding an interface function, as in the │ │ │ │ example in Release Handling, where a function │ │ │ │ available/0 is added to ch3.

          If a call is added to this function, say in module m1, a runtime error could │ │ │ │ can occur during release upgrade if the new version of m1 is loaded first and │ │ │ │ calls ch3:available/0 before the new version of ch3 is loaded.

          Thus, ch3 must be loaded before m1, in the upgrade case, and conversely in │ │ │ │ the downgrade case. m1 is said to be dependent on ch3. In a release │ │ │ │ -handling instruction, this is expressed by the DepMods element:

          {load_module, Module, DepMods}
          │ │ │ │ -{update, Module, {advanced, Extra}, DepMods}

          DepMods is a list of modules, on which Module is dependent.

          Example

          The module m1 in application myapp is dependent on ch3 when │ │ │ │ +handling instruction, this is expressed by the DepMods element:

          {load_module, Module, DepMods}
          │ │ │ │ +{update, Module, {advanced, Extra}, DepMods}

          DepMods is a list of modules, on which Module is dependent.

          Example

          The module m1 in application myapp is dependent on ch3 when │ │ │ │ upgrading from "1" to "2", or downgrading from "2" to "1":

          myapp.appup:
          │ │ │ │  
          │ │ │ │ -{"2",
          │ │ │ │ - [{"1", [{load_module, m1, [ch3]}]}],
          │ │ │ │ - [{"1", [{load_module, m1, [ch3]}]}]
          │ │ │ │ -}.
          │ │ │ │ +{"2",
          │ │ │ │ + [{"1", [{load_module, m1, [ch3]}]}],
          │ │ │ │ + [{"1", [{load_module, m1, [ch3]}]}]
          │ │ │ │ +}.
          │ │ │ │  
          │ │ │ │  ch_app.appup:
          │ │ │ │  
          │ │ │ │ -{"2",
          │ │ │ │ - [{"1", [{load_module, ch3}]}],
          │ │ │ │ - [{"1", [{load_module, ch3}]}]
          │ │ │ │ -}.

          If instead m1 and ch3 belong to the same application, the .appup file can │ │ │ │ -look as follows:

          {"2",
          │ │ │ │ - [{"1",
          │ │ │ │ -   [{load_module, ch3},
          │ │ │ │ -    {load_module, m1, [ch3]}]}],
          │ │ │ │ - [{"1",
          │ │ │ │ -   [{load_module, ch3},
          │ │ │ │ -    {load_module, m1, [ch3]}]}]
          │ │ │ │ -}.

          m1 is dependent on ch3 also when downgrading. systools knows the │ │ │ │ +{"2", │ │ │ │ + [{"1", [{load_module, ch3}]}], │ │ │ │ + [{"1", [{load_module, ch3}]}] │ │ │ │ +}.

    If instead m1 and ch3 belong to the same application, the .appup file can │ │ │ │ +look as follows:

    {"2",
    │ │ │ │ + [{"1",
    │ │ │ │ +   [{load_module, ch3},
    │ │ │ │ +    {load_module, m1, [ch3]}]}],
    │ │ │ │ + [{"1",
    │ │ │ │ +   [{load_module, ch3},
    │ │ │ │ +    {load_module, m1, [ch3]}]}]
    │ │ │ │ +}.

    m1 is dependent on ch3 also when downgrading. systools knows the │ │ │ │ difference between up- and downgrading and generates a correct relup, where │ │ │ │ ch3 is loaded before m1 when upgrading, but m1 is loaded before ch3 when │ │ │ │ downgrading.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing Code for a Special Process │ │ │ │

    │ │ │ │

    In this case, simple code replacement is not sufficient. When a new version of a │ │ │ │ residence module for a special process is loaded, the process must make a fully │ │ │ │ qualified call to its loop function to switch to the new code. Thus, │ │ │ │ synchronized code replacement must be used.

    Note

    The name(s) of the user-defined residence module(s) must be listed in the │ │ │ │ Modules part of the child specification for the special process. Otherwise │ │ │ │ the release handler cannot find the process.

    Example

    Consider the example ch4 in sys and proc_lib. │ │ │ │ -When started by a supervisor, the child specification can look as follows:

    {ch4, {ch4, start_link, []},
    │ │ │ │ - permanent, brutal_kill, worker, [ch4]}

    If ch4 is part of the application sp_app and a new version of the module is │ │ │ │ +When started by a supervisor, the child specification can look as follows:

    {ch4, {ch4, start_link, []},
    │ │ │ │ + permanent, brutal_kill, worker, [ch4]}

    If ch4 is part of the application sp_app and a new version of the module is │ │ │ │ to be loaded when upgrading from version "1" to "2" of this application, │ │ │ │ -sp_app.appup can look as follows:

    {"2",
    │ │ │ │ - [{"1", [{update, ch4, {advanced, []}}]}],
    │ │ │ │ - [{"1", [{update, ch4, {advanced, []}}]}]
    │ │ │ │ -}.

    The update instruction must contain the tuple {advanced,Extra}. The │ │ │ │ +sp_app.appup can look as follows:

    {"2",
    │ │ │ │ + [{"1", [{update, ch4, {advanced, []}}]}],
    │ │ │ │ + [{"1", [{update, ch4, {advanced, []}}]}]
    │ │ │ │ +}.

    The update instruction must contain the tuple {advanced,Extra}. The │ │ │ │ instruction makes the special process call the callback function │ │ │ │ system_code_change/4, a function the user must implement. The term Extra, in │ │ │ │ -this case [], is passed as is to system_code_change/4:

    -module(ch4).
    │ │ │ │ +this case [], is passed as is to system_code_change/4:

    -module(ch4).
    │ │ │ │  ...
    │ │ │ │ --export([system_code_change/4]).
    │ │ │ │ +-export([system_code_change/4]).
    │ │ │ │  ...
    │ │ │ │  
    │ │ │ │ -system_code_change(Chs, _Module, _OldVsn, _Extra) ->
    │ │ │ │ -    {ok, Chs}.
    • The first argument is the internal state State, passed from │ │ │ │ +system_code_change(Chs, _Module, _OldVsn, _Extra) -> │ │ │ │ + {ok, Chs}.

    In this case, all arguments but the first are ignored and the function simply │ │ │ │ returns the internal state again. This is enough if the code only has been │ │ │ │ extended. If instead the internal state is changed (similar to the example in │ │ │ │ @@ -176,85 +176,85 @@ │ │ │ │ Changing Properties │ │ │ │ │ │ │ │

    Since the supervisor is to change its internal state, synchronized code │ │ │ │ replacement is required. However, a special update instruction must be used.

    First, the new version of the callback module must be loaded, both in the case │ │ │ │ of upgrade and downgrade. Then the new return value of init/1 can be checked │ │ │ │ and the internal state be changed accordingly.

    The following upgrade instruction is used for supervisors:

    {update, Module, supervisor}

    Example

    To change the restart strategy of ch_sup (from │ │ │ │ Supervisor Behaviour) from one_for_one to one_for_all, │ │ │ │ -change the callback function init/1 in ch_sup.erl:

    -module(ch_sup).
    │ │ │ │ +change the callback function init/1 in ch_sup.erl:

    -module(ch_sup).
    │ │ │ │  ...
    │ │ │ │  
    │ │ │ │ -init(_Args) ->
    │ │ │ │ -    {ok, {#{strategy => one_for_all, ...}, ...}}.

    The file ch_app.appup:

    {"2",
    │ │ │ │ - [{"1", [{update, ch_sup, supervisor}]}],
    │ │ │ │ - [{"1", [{update, ch_sup, supervisor}]}]
    │ │ │ │ -}.

    │ │ │ │ +init(_Args) -> │ │ │ │ + {ok, {#{strategy => one_for_all, ...}, ...}}.

    The file ch_app.appup:

    {"2",
    │ │ │ │ + [{"1", [{update, ch_sup, supervisor}]}],
    │ │ │ │ + [{"1", [{update, ch_sup, supervisor}]}]
    │ │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing Child Specifications │ │ │ │

    │ │ │ │

    The instruction, and thus the .appup file, when changing an existing child │ │ │ │ -specification, is the same as when changing properties as described earlier:

    {"2",
    │ │ │ │ - [{"1", [{update, ch_sup, supervisor}]}],
    │ │ │ │ - [{"1", [{update, ch_sup, supervisor}]}]
    │ │ │ │ -}.

    The changes do not affect existing child processes. For example, changing the │ │ │ │ +specification, is the same as when changing properties as described earlier:

    {"2",
    │ │ │ │ + [{"1", [{update, ch_sup, supervisor}]}],
    │ │ │ │ + [{"1", [{update, ch_sup, supervisor}]}]
    │ │ │ │ +}.

    The changes do not affect existing child processes. For example, changing the │ │ │ │ start function only specifies how the child process is to be restarted, if │ │ │ │ needed later on.

    The id of the child specification cannot be changed.

    Changing the Modules field of the child specification can affect the release │ │ │ │ handling process itself, as this field is used to identify which processes are │ │ │ │ affected when doing a synchronized code replacement.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Adding and Deleting Child Processes │ │ │ │

    │ │ │ │

    As stated earlier, changing child specifications does not affect existing child │ │ │ │ processes. New child specifications are automatically added, but not deleted. │ │ │ │ Child processes are not automatically started or terminated, this must be done │ │ │ │ using apply instructions.

    Example

    Assume a new child process m1 is to be added to ch_sup when │ │ │ │ upgrading ch_app from "1" to "2". This means m1 is to be deleted when │ │ │ │ -downgrading from "2" to "1":

    {"2",
    │ │ │ │ - [{"1",
    │ │ │ │ -   [{update, ch_sup, supervisor},
    │ │ │ │ -    {apply, {supervisor, restart_child, [ch_sup, m1]}}
    │ │ │ │ -   ]}],
    │ │ │ │ - [{"1",
    │ │ │ │ -   [{apply, {supervisor, terminate_child, [ch_sup, m1]}},
    │ │ │ │ -    {apply, {supervisor, delete_child, [ch_sup, m1]}},
    │ │ │ │ -    {update, ch_sup, supervisor}
    │ │ │ │ -   ]}]
    │ │ │ │ -}.

    The order of the instructions is important.

    The supervisor must be registered as ch_sup for the script to work. If the │ │ │ │ +downgrading from "2" to "1":

    {"2",
    │ │ │ │ + [{"1",
    │ │ │ │ +   [{update, ch_sup, supervisor},
    │ │ │ │ +    {apply, {supervisor, restart_child, [ch_sup, m1]}}
    │ │ │ │ +   ]}],
    │ │ │ │ + [{"1",
    │ │ │ │ +   [{apply, {supervisor, terminate_child, [ch_sup, m1]}},
    │ │ │ │ +    {apply, {supervisor, delete_child, [ch_sup, m1]}},
    │ │ │ │ +    {update, ch_sup, supervisor}
    │ │ │ │ +   ]}]
    │ │ │ │ +}.

    The order of the instructions is important.

    The supervisor must be registered as ch_sup for the script to work. If the │ │ │ │ supervisor is not registered, it cannot be accessed directly from the script. │ │ │ │ Instead a help function that finds the pid of the supervisor and calls │ │ │ │ supervisor:restart_child, and so on, must be written. This function is then to │ │ │ │ be called from the script using the apply instruction.

    If the module m1 is introduced in version "2" of ch_app, it must also be │ │ │ │ -loaded when upgrading and deleted when downgrading:

    {"2",
    │ │ │ │ - [{"1",
    │ │ │ │ -   [{add_module, m1},
    │ │ │ │ -    {update, ch_sup, supervisor},
    │ │ │ │ -    {apply, {supervisor, restart_child, [ch_sup, m1]}}
    │ │ │ │ -   ]}],
    │ │ │ │ - [{"1",
    │ │ │ │ -   [{apply, {supervisor, terminate_child, [ch_sup, m1]}},
    │ │ │ │ -    {apply, {supervisor, delete_child, [ch_sup, m1]}},
    │ │ │ │ -    {update, ch_sup, supervisor},
    │ │ │ │ -    {delete_module, m1}
    │ │ │ │ -   ]}]
    │ │ │ │ -}.

    As stated earlier, the order of the instructions is important. When upgrading, │ │ │ │ +loaded when upgrading and deleted when downgrading:

    {"2",
    │ │ │ │ + [{"1",
    │ │ │ │ +   [{add_module, m1},
    │ │ │ │ +    {update, ch_sup, supervisor},
    │ │ │ │ +    {apply, {supervisor, restart_child, [ch_sup, m1]}}
    │ │ │ │ +   ]}],
    │ │ │ │ + [{"1",
    │ │ │ │ +   [{apply, {supervisor, terminate_child, [ch_sup, m1]}},
    │ │ │ │ +    {apply, {supervisor, delete_child, [ch_sup, m1]}},
    │ │ │ │ +    {update, ch_sup, supervisor},
    │ │ │ │ +    {delete_module, m1}
    │ │ │ │ +   ]}]
    │ │ │ │ +}.

    As stated earlier, the order of the instructions is important. When upgrading, │ │ │ │ m1 must be loaded, and the supervisor child specification changed, before the │ │ │ │ new child process can be started. When downgrading, the child process must be │ │ │ │ terminated before the child specification is changed and the module is deleted.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Adding or Deleting a Module │ │ │ │

    │ │ │ │ -

    _Example

    _ A new functional module m is added to ch_app:

    {"2",
    │ │ │ │ - [{"1", [{add_module, m}]}],
    │ │ │ │ - [{"1", [{delete_module, m}]}]

    │ │ │ │ +

    _Example

    _ A new functional module m is added to ch_app:

    {"2",
    │ │ │ │ + [{"1", [{add_module, m}]}],
    │ │ │ │ + [{"1", [{delete_module, m}]}]

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Starting or Terminating a Process │ │ │ │

    │ │ │ │

    In a system structured according to the OTP design principles, any process would │ │ │ │ be a child process belonging to a supervisor, see │ │ │ │ @@ -274,29 +274,29 @@ │ │ │ │ Restarting an Application │ │ │ │ │ │ │ │

    Restarting an application is useful when a change is too complicated to be made │ │ │ │ without restarting the processes, for example, if the supervisor hierarchy has │ │ │ │ been restructured.

    Example

    When adding a child m1 to ch_sup, as in │ │ │ │ Adding and Deleting Child Processes in Changing a │ │ │ │ Supervisor, an alternative to updating the supervisor is to restart the entire │ │ │ │ -application:

    {"2",
    │ │ │ │ - [{"1", [{restart_application, ch_app}]}],
    │ │ │ │ - [{"1", [{restart_application, ch_app}]}]
    │ │ │ │ -}.

    │ │ │ │ +application:

    {"2",
    │ │ │ │ + [{"1", [{restart_application, ch_app}]}],
    │ │ │ │ + [{"1", [{restart_application, ch_app}]}]
    │ │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing an Application Specification │ │ │ │

    │ │ │ │

    When installing a release, the application specifications are automatically │ │ │ │ updated before evaluating the relup script. Thus, no instructions are needed │ │ │ │ -in the .appup file:

    {"2",
    │ │ │ │ - [{"1", []}],
    │ │ │ │ - [{"1", []}]
    │ │ │ │ -}.

    │ │ │ │ +in the .appup file:

    {"2",
    │ │ │ │ + [{"1", []}],
    │ │ │ │ + [{"1", []}]
    │ │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing Application Configuration │ │ │ │

    │ │ │ │

    Changing an application configuration by updating the env key in the .app │ │ │ │ file is an instance of changing an application specification, see the previous │ │ │ │ @@ -311,26 +311,26 @@ │ │ │ │ applications apply to primary applications only. There are no corresponding │ │ │ │ instructions for included applications. However, since an included application │ │ │ │ is really a supervision tree with a topmost supervisor, started as a child │ │ │ │ process to a supervisor in the including application, a .relup file can be │ │ │ │ manually created.

    Example

    Assume there is a release containing an application prim_app, which │ │ │ │ have a supervisor prim_sup in its supervision tree.

    In a new version of the release, the application ch_app is to be included in │ │ │ │ prim_app. That is, its topmost supervisor ch_sup is to be started as a child │ │ │ │ -process to prim_sup.

    The workflow is as follows:

    Step 1) Edit the code for prim_sup:

    init(...) ->
    │ │ │ │ -    {ok, {...supervisor flags...,
    │ │ │ │ -          [...,
    │ │ │ │ -           {ch_sup, {ch_sup,start_link,[]},
    │ │ │ │ -            permanent,infinity,supervisor,[ch_sup]},
    │ │ │ │ -           ...]}}.

    Step 2) Edit the .app file for prim_app:

    {application, prim_app,
    │ │ │ │ - [...,
    │ │ │ │ -  {vsn, "2"},
    │ │ │ │ +process to prim_sup.

    The workflow is as follows:

    Step 1) Edit the code for prim_sup:

    init(...) ->
    │ │ │ │ +    {ok, {...supervisor flags...,
    │ │ │ │ +          [...,
    │ │ │ │ +           {ch_sup, {ch_sup,start_link,[]},
    │ │ │ │ +            permanent,infinity,supervisor,[ch_sup]},
    │ │ │ │ +           ...]}}.

    Step 2) Edit the .app file for prim_app:

    {application, prim_app,
    │ │ │ │ + [...,
    │ │ │ │ +  {vsn, "2"},
    │ │ │ │    ...,
    │ │ │ │ -  {included_applications, [ch_app]},
    │ │ │ │ +  {included_applications, [ch_app]},
    │ │ │ │    ...
    │ │ │ │ - ]}.

    Step 3) Create a new .rel file, including ch_app:

    {release,
    │ │ │ │ + ]}.

    Step 3) Create a new .rel file, including ch_app:

    {release,
    │ │ │ │   ...,
    │ │ │ │   [...,
    │ │ │ │    {prim_app, "2"},
    │ │ │ │    {ch_app, "1"}]}.

    The included application can be started in two ways. This is described in the │ │ │ │ next two sections.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -385,74 +385,74 @@ │ │ │ │

    Step 4b) Another way to start the included application (or stop it in the case │ │ │ │ of downgrade) is by combining instructions for adding and removing child │ │ │ │ processes to/from prim_sup with instructions for loading/unloading all │ │ │ │ ch_app code and its application specification.

    Again, the .relup file is created manually, either from scratch or by editing a │ │ │ │ generated version. Load all code for ch_app first, and also load the │ │ │ │ application specification, before prim_sup is updated. When downgrading, │ │ │ │ prim_sup is to updated first, before the code for ch_app and its application │ │ │ │ -specification are unloaded.

    {"B",
    │ │ │ │ - [{"A",
    │ │ │ │ -   [],
    │ │ │ │ -   [{load_object_code,{ch_app,"1",[ch_sup,ch3]}},
    │ │ │ │ -    {load_object_code,{prim_app,"2",[prim_sup]}},
    │ │ │ │ +specification are unloaded.

    {"B",
    │ │ │ │ + [{"A",
    │ │ │ │ +   [],
    │ │ │ │ +   [{load_object_code,{ch_app,"1",[ch_sup,ch3]}},
    │ │ │ │ +    {load_object_code,{prim_app,"2",[prim_sup]}},
    │ │ │ │      point_of_no_return,
    │ │ │ │ -    {load,{ch_sup,brutal_purge,brutal_purge}},
    │ │ │ │ -    {load,{ch3,brutal_purge,brutal_purge}},
    │ │ │ │ -    {apply,{application,load,[ch_app]}},
    │ │ │ │ -    {suspend,[prim_sup]},
    │ │ │ │ -    {load,{prim_sup,brutal_purge,brutal_purge}},
    │ │ │ │ -    {code_change,up,[{prim_sup,[]}]},
    │ │ │ │ -    {resume,[prim_sup]},
    │ │ │ │ -    {apply,{supervisor,restart_child,[prim_sup,ch_sup]}}]}],
    │ │ │ │ - [{"A",
    │ │ │ │ -   [],
    │ │ │ │ -   [{load_object_code,{prim_app,"1",[prim_sup]}},
    │ │ │ │ +    {load,{ch_sup,brutal_purge,brutal_purge}},
    │ │ │ │ +    {load,{ch3,brutal_purge,brutal_purge}},
    │ │ │ │ +    {apply,{application,load,[ch_app]}},
    │ │ │ │ +    {suspend,[prim_sup]},
    │ │ │ │ +    {load,{prim_sup,brutal_purge,brutal_purge}},
    │ │ │ │ +    {code_change,up,[{prim_sup,[]}]},
    │ │ │ │ +    {resume,[prim_sup]},
    │ │ │ │ +    {apply,{supervisor,restart_child,[prim_sup,ch_sup]}}]}],
    │ │ │ │ + [{"A",
    │ │ │ │ +   [],
    │ │ │ │ +   [{load_object_code,{prim_app,"1",[prim_sup]}},
    │ │ │ │      point_of_no_return,
    │ │ │ │ -    {apply,{supervisor,terminate_child,[prim_sup,ch_sup]}},
    │ │ │ │ -    {apply,{supervisor,delete_child,[prim_sup,ch_sup]}},
    │ │ │ │ -    {suspend,[prim_sup]},
    │ │ │ │ -    {load,{prim_sup,brutal_purge,brutal_purge}},
    │ │ │ │ -    {code_change,down,[{prim_sup,[]}]},
    │ │ │ │ -    {resume,[prim_sup]},
    │ │ │ │ -    {remove,{ch_sup,brutal_purge,brutal_purge}},
    │ │ │ │ -    {remove,{ch3,brutal_purge,brutal_purge}},
    │ │ │ │ -    {purge,[ch_sup,ch3]},
    │ │ │ │ -    {apply,{application,unload,[ch_app]}}]}]
    │ │ │ │ -}.

    │ │ │ │ + {apply,{supervisor,terminate_child,[prim_sup,ch_sup]}}, │ │ │ │ + {apply,{supervisor,delete_child,[prim_sup,ch_sup]}}, │ │ │ │ + {suspend,[prim_sup]}, │ │ │ │ + {load,{prim_sup,brutal_purge,brutal_purge}}, │ │ │ │ + {code_change,down,[{prim_sup,[]}]}, │ │ │ │ + {resume,[prim_sup]}, │ │ │ │ + {remove,{ch_sup,brutal_purge,brutal_purge}}, │ │ │ │ + {remove,{ch3,brutal_purge,brutal_purge}}, │ │ │ │ + {purge,[ch_sup,ch3]}, │ │ │ │ + {apply,{application,unload,[ch_app]}}]}] │ │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Changing Non-Erlang Code │ │ │ │

    │ │ │ │

    Changing code for a program written in another programming language than Erlang, │ │ │ │ for example, a port program, is application-dependent and OTP provides no │ │ │ │ special support.

    Example

    When changing code for a port program, assume that the Erlang process │ │ │ │ controlling the port is a gen_server portc and that the port is opened in │ │ │ │ -the callback function init/1:

    init(...) ->
    │ │ │ │ +the callback function init/1:

    init(...) ->
    │ │ │ │      ...,
    │ │ │ │ -    PortPrg = filename:join(code:priv_dir(App), "portc"),
    │ │ │ │ -    Port = open_port({spawn,PortPrg}, [...]),
    │ │ │ │ +    PortPrg = filename:join(code:priv_dir(App), "portc"),
    │ │ │ │ +    Port = open_port({spawn,PortPrg}, [...]),
    │ │ │ │      ...,
    │ │ │ │ -    {ok, #state{port=Port, ...}}.

    If the port program is to be updated, the code for the gen_server can be │ │ │ │ + {ok, #state{port=Port, ...}}.

    If the port program is to be updated, the code for the gen_server can be │ │ │ │ extended with a code_change/3 function, which closes the old port and opens a │ │ │ │ new port. (If necessary, the gen_server can first request data that must be │ │ │ │ -saved from the port program and pass this data to the new port):

    code_change(_OldVsn, State, port) ->
    │ │ │ │ +saved from the port program and pass this data to the new port):

    code_change(_OldVsn, State, port) ->
    │ │ │ │      State#state.port ! close,
    │ │ │ │      receive
    │ │ │ │ -        {Port,close} ->
    │ │ │ │ +        {Port,close} ->
    │ │ │ │              true
    │ │ │ │      end,
    │ │ │ │ -    PortPrg = filename:join(code:priv_dir(App), "portc"),
    │ │ │ │ -    Port = open_port({spawn,PortPrg}, [...]),
    │ │ │ │ -    {ok, #state{port=Port, ...}}.

    Update the application version number in the .app file and write an .appup │ │ │ │ -file:

    ["2",
    │ │ │ │ - [{"1", [{update, portc, {advanced,port}}]}],
    │ │ │ │ - [{"1", [{update, portc, {advanced,port}}]}]
    │ │ │ │ -].

    Ensure that the priv directory, where the C program is located, is included in │ │ │ │ -the new release package:

    1> systools:make_tar("my_release", [{dirs,[priv]}]).
    │ │ │ │ +    PortPrg = filename:join(code:priv_dir(App), "portc"),
    │ │ │ │ +    Port = open_port({spawn,PortPrg}, [...]),
    │ │ │ │ +    {ok, #state{port=Port, ...}}.

    Update the application version number in the .app file and write an .appup │ │ │ │ +file:

    ["2",
    │ │ │ │ + [{"1", [{update, portc, {advanced,port}}]}],
    │ │ │ │ + [{"1", [{update, portc, {advanced,port}}]}]
    │ │ │ │ +].

    Ensure that the priv directory, where the C program is located, is included in │ │ │ │ +the new release package:

    1> systools:make_tar("my_release", [{dirs,[priv]}]).
    │ │ │ │  ...

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Runtime System Restart and Upgrade │ │ │ │

    │ │ │ │

    Two upgrade instructions restart the runtime system:

    • restart_new_emulator

      Intended when ERTS, Kernel, STDLIB, or SASL is upgraded. It is automatically │ │ │ │ @@ -460,20 +460,20 @@ │ │ │ │ executed before all other upgrade instructions. For more information about │ │ │ │ this instruction, see restart_new_emulator (Low-Level) in │ │ │ │ Release Handling Instructions.

    • restart_emulator

      Used when a restart of the runtime system is required after all other upgrade │ │ │ │ instructions are executed. For more information about this instruction, see │ │ │ │ restart_emulator (Low-Level) in │ │ │ │ Release Handling Instructions.

    If a runtime system restart is necessary and no upgrade instructions are needed, │ │ │ │ that is, if the restart itself is enough for the upgraded applications to start │ │ │ │ -running the new versions, a simple .relup file can be created manually:

    {"B",
    │ │ │ │ - [{"A",
    │ │ │ │ -   [],
    │ │ │ │ -   [restart_emulator]}],
    │ │ │ │ - [{"A",
    │ │ │ │ -   [],
    │ │ │ │ -   [restart_emulator]}]
    │ │ │ │ -}.

    In this case, the release handler framework with automatic packing and unpacking │ │ │ │ +running the new versions, a simple .relup file can be created manually:

    {"B",
    │ │ │ │ + [{"A",
    │ │ │ │ +   [],
    │ │ │ │ +   [restart_emulator]}],
    │ │ │ │ + [{"A",
    │ │ │ │ +   [],
    │ │ │ │ +   [restart_emulator]}]
    │ │ │ │ +}.

    In this case, the release handler framework with automatic packing and unpacking │ │ │ │ of release packages, automatic path updates, and so on, can be used without │ │ │ │ having to specify .appup files.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── OEBPS/applications.xhtml │ │ │ │ @@ -40,34 +40,34 @@ │ │ │ │ directory structure.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Application Callback Module │ │ │ │

    │ │ │ │

    How to start and stop the code for the application, including its supervision │ │ │ │ -tree, is described by two callback functions:

    start(StartType, StartArgs) -> {ok, Pid} | {ok, Pid, State}
    │ │ │ │ -stop(State)
    • start/2 is called when starting the application and is to create the │ │ │ │ +tree, is described by two callback functions:

      start(StartType, StartArgs) -> {ok, Pid} | {ok, Pid, State}
      │ │ │ │ +stop(State)
      • start/2 is called when starting the application and is to create the │ │ │ │ supervision tree by starting the top supervisor. It is expected to return the │ │ │ │ pid of the top supervisor and an optional term, State, which defaults to │ │ │ │ []. This term is passed as is to stop/1.
      • StartType is usually the atom normal. It has other values only in the case │ │ │ │ of a takeover or failover; see │ │ │ │ Distributed Applications.
      • StartArgs is defined by the key mod in the │ │ │ │ application resource file.
      • stop/1 is called after the application has been stopped and is to do any │ │ │ │ necessary cleaning up. The actual stopping of the application, that is, │ │ │ │ shutting down the supervision tree, is handled automatically as described in │ │ │ │ Starting and Stopping Applications.

      Example of an application callback module for packaging the supervision tree │ │ │ │ -from Supervisor Behaviour:

      -module(ch_app).
      │ │ │ │ --behaviour(application).
      │ │ │ │ +from Supervisor Behaviour:

      -module(ch_app).
      │ │ │ │ +-behaviour(application).
      │ │ │ │  
      │ │ │ │ --export([start/2, stop/1]).
      │ │ │ │ +-export([start/2, stop/1]).
      │ │ │ │  
      │ │ │ │ -start(_Type, _Args) ->
      │ │ │ │ -    ch_sup:start_link().
      │ │ │ │ +start(_Type, _Args) ->
      │ │ │ │ +    ch_sup:start_link().
      │ │ │ │  
      │ │ │ │ -stop(_State) ->
      │ │ │ │ +stop(_State) ->
      │ │ │ │      ok.

      A library application that cannot be started or stopped does not need any │ │ │ │ application callback module.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Application Resource File │ │ │ │

      │ │ │ │ @@ -78,22 +78,22 @@ │ │ │ │ keys.

    The contents of a minimal .app file for a library application libapp looks │ │ │ │ as follows:

    {application, libapp, []}.

    The contents of a minimal .app file ch_app.app for a supervision tree │ │ │ │ application like ch_app looks as follows:

    {application, ch_app,
    │ │ │ │   [{mod, {ch_app,[]}}]}.

    The key mod defines the callback module and start argument of the application, │ │ │ │ in this case ch_app and [], respectively. This means that the following is │ │ │ │ called when the application is to be started:

    ch_app:start(normal, [])

    The following is called when the application is stopped:

    ch_app:stop([])

    When using systools, the Erlang/OTP tools for packaging code (see Section │ │ │ │ Releases), the keys description, vsn, modules, │ │ │ │ -registered, and applications are also to be specified:

    {application, ch_app,
    │ │ │ │ - [{description, "Channel allocator"},
    │ │ │ │ -  {vsn, "1"},
    │ │ │ │ -  {modules, [ch_app, ch_sup, ch3]},
    │ │ │ │ -  {registered, [ch3]},
    │ │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ │ -  {mod, {ch_app,[]}}
    │ │ │ │ - ]}.
    • description - A short description, a string. Defaults to "".
    • vsn - Version number, a string. Defaults to "".
    • modules - All modules introduced by this application. systools uses │ │ │ │ +registered, and applications are also to be specified:

      {application, ch_app,
      │ │ │ │ + [{description, "Channel allocator"},
      │ │ │ │ +  {vsn, "1"},
      │ │ │ │ +  {modules, [ch_app, ch_sup, ch3]},
      │ │ │ │ +  {registered, [ch3]},
      │ │ │ │ +  {applications, [kernel, stdlib, sasl]},
      │ │ │ │ +  {mod, {ch_app,[]}}
      │ │ │ │ + ]}.
      • description - A short description, a string. Defaults to "".
      • vsn - Version number, a string. Defaults to "".
      • modules - All modules introduced by this application. systools uses │ │ │ │ this list when generating boot scripts and tar files. A module must only │ │ │ │ be included in one application. Defaults to [].
      • registered - All names of registered processes in the application. │ │ │ │ systools uses this list to detect name clashes between applications. │ │ │ │ Defaults to [].
      • applications - All applications that must be started before this │ │ │ │ application is started. systools uses this list to generate correct boot │ │ │ │ scripts. Defaults to []. Notice that all applications have dependencies to │ │ │ │ at least Kernel and STDLIB.

      Note

      For details about the syntax and contents of the application resource file, │ │ │ │ @@ -205,38 +205,38 @@ │ │ │ │ stop applications.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading and Unloading Applications │ │ │ │

      │ │ │ │

      Before an application can be started, it must be loaded. The application │ │ │ │ -controller reads and stores the information from the .app file:

      1> application:load(ch_app).
      │ │ │ │ +controller reads and stores the information from the .app file:

      1> application:load(ch_app).
      │ │ │ │  ok
      │ │ │ │ -2> application:loaded_applications().
      │ │ │ │ -[{kernel,"ERTS  CXC 138 10","2.8.1.3"},
      │ │ │ │ - {stdlib,"ERTS  CXC 138 10","1.11.4.3"},
      │ │ │ │ - {ch_app,"Channel allocator","1"}]

      An application that has been stopped, or has never been started, can be │ │ │ │ +2> application:loaded_applications(). │ │ │ │ +[{kernel,"ERTS CXC 138 10","2.8.1.3"}, │ │ │ │ + {stdlib,"ERTS CXC 138 10","1.11.4.3"}, │ │ │ │ + {ch_app,"Channel allocator","1"}]

      An application that has been stopped, or has never been started, can be │ │ │ │ unloaded. The information about the application is erased from the internal │ │ │ │ -database of the application controller.

      3> application:unload(ch_app).
      │ │ │ │ +database of the application controller.

      3> application:unload(ch_app).
      │ │ │ │  ok
      │ │ │ │ -4> application:loaded_applications().
      │ │ │ │ -[{kernel,"ERTS  CXC 138 10","2.8.1.3"},
      │ │ │ │ - {stdlib,"ERTS  CXC 138 10","1.11.4.3"}]

      Note

      Loading/unloading an application does not load/unload the code used by the │ │ │ │ +4> application:loaded_applications(). │ │ │ │ +[{kernel,"ERTS CXC 138 10","2.8.1.3"}, │ │ │ │ + {stdlib,"ERTS CXC 138 10","1.11.4.3"}]

      Note

      Loading/unloading an application does not load/unload the code used by the │ │ │ │ application. Code loading is handled in the usual way by the code server.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Starting and Stopping Applications │ │ │ │

      │ │ │ │ -

      An application is started by calling:

      5> application:start(ch_app).
      │ │ │ │ +

      An application is started by calling:

      5> application:start(ch_app).
      │ │ │ │  ok
      │ │ │ │ -6> application:which_applications().
      │ │ │ │ -[{kernel,"ERTS  CXC 138 10","2.8.1.3"},
      │ │ │ │ - {stdlib,"ERTS  CXC 138 10","1.11.4.3"},
      │ │ │ │ - {ch_app,"Channel allocator","1"}]

      If the application is not already loaded, the application controller first loads │ │ │ │ +6> application:which_applications(). │ │ │ │ +[{kernel,"ERTS CXC 138 10","2.8.1.3"}, │ │ │ │ + {stdlib,"ERTS CXC 138 10","1.11.4.3"}, │ │ │ │ + {ch_app,"Channel allocator","1"}]

      If the application is not already loaded, the application controller first loads │ │ │ │ it using application:load/1. It checks the value of the applications key to │ │ │ │ ensure that all applications that are to be started before this application are │ │ │ │ running.

      Following that, the application controller creates an application master for │ │ │ │ the application.

      The application master establishes itself as the group │ │ │ │ leader of all processes in the application │ │ │ │ and will forward I/O to the previous group leader.

      Note

      The purpose of the application master being the group leader is to easily │ │ │ │ keep track of which processes that belong to the application. That is needed │ │ │ │ @@ -252,55 +252,55 @@ │ │ │ │ defined by the mod key.

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Configuring an Application │ │ │ │

      │ │ │ │

      An application can be configured using configuration parameters. These are a │ │ │ │ -list of {Par,Val} tuples specified by a key env in the .app file:

      {application, ch_app,
      │ │ │ │ - [{description, "Channel allocator"},
      │ │ │ │ -  {vsn, "1"},
      │ │ │ │ -  {modules, [ch_app, ch_sup, ch3]},
      │ │ │ │ -  {registered, [ch3]},
      │ │ │ │ -  {applications, [kernel, stdlib, sasl]},
      │ │ │ │ -  {mod, {ch_app,[]}},
      │ │ │ │ -  {env, [{file, "/usr/local/log"}]}
      │ │ │ │ - ]}.

      Par is to be an atom. Val is any term. The application can retrieve the │ │ │ │ +list of {Par,Val} tuples specified by a key env in the .app file:

      {application, ch_app,
      │ │ │ │ + [{description, "Channel allocator"},
      │ │ │ │ +  {vsn, "1"},
      │ │ │ │ +  {modules, [ch_app, ch_sup, ch3]},
      │ │ │ │ +  {registered, [ch3]},
      │ │ │ │ +  {applications, [kernel, stdlib, sasl]},
      │ │ │ │ +  {mod, {ch_app,[]}},
      │ │ │ │ +  {env, [{file, "/usr/local/log"}]}
      │ │ │ │ + ]}.

      Par is to be an atom. Val is any term. The application can retrieve the │ │ │ │ value of a configuration parameter by calling application:get_env(App, Par) or │ │ │ │ a number of similar functions. For more information, see module application │ │ │ │ in Kernel.

      Example:

      % erl
      │ │ │ │ -Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
      │ │ │ │ +Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
      │ │ │ │  
      │ │ │ │ -Eshell V5.2.3.6  (abort with ^G)
      │ │ │ │ -1> application:start(ch_app).
      │ │ │ │ +Eshell V5.2.3.6  (abort with ^G)
      │ │ │ │ +1> application:start(ch_app).
      │ │ │ │  ok
      │ │ │ │ -2> application:get_env(ch_app, file).
      │ │ │ │ -{ok,"/usr/local/log"}

      The values in the .app file can be overridden by values in a system │ │ │ │ +2> application:get_env(ch_app, file). │ │ │ │ +{ok,"/usr/local/log"}

    The values in the .app file can be overridden by values in a system │ │ │ │ configuration file. This is a file that contains configuration parameters for │ │ │ │ -relevant applications:

    [{Application1, [{Par11,Val11},...]},
    │ │ │ │ +relevant applications:

    [{Application1, [{Par11,Val11},...]},
    │ │ │ │   ...,
    │ │ │ │ - {ApplicationN, [{ParN1,ValN1},...]}].

    The system configuration is to be called Name.config and Erlang is to be │ │ │ │ + {ApplicationN, [{ParN1,ValN1},...]}].

    The system configuration is to be called Name.config and Erlang is to be │ │ │ │ started with the command-line argument -config Name. For details, see │ │ │ │ config in Kernel.

    Example:

    A file test.config is created with the following contents:

    [{ch_app, [{file, "testlog"}]}].

    The value of file overrides the value of file as defined in the .app file:

    % erl -config test
    │ │ │ │ -Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
    │ │ │ │ +Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
    │ │ │ │  
    │ │ │ │ -Eshell V5.2.3.6  (abort with ^G)
    │ │ │ │ -1> application:start(ch_app).
    │ │ │ │ +Eshell V5.2.3.6  (abort with ^G)
    │ │ │ │ +1> application:start(ch_app).
    │ │ │ │  ok
    │ │ │ │ -2> application:get_env(ch_app, file).
    │ │ │ │ -{ok,"testlog"}

    If release handling is used, exactly one system │ │ │ │ +2> application:get_env(ch_app, file). │ │ │ │ +{ok,"testlog"}

    If release handling is used, exactly one system │ │ │ │ configuration file is to be used and that file is to be called sys.config.

    The values in the .app file and the values in a system configuration file can │ │ │ │ be overridden directly from the command line:

    % erl -ApplName Par1 Val1 ... ParN ValN

    Example:

    % erl -ch_app file '"testlog"'
    │ │ │ │ -Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
    │ │ │ │ +Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
    │ │ │ │  
    │ │ │ │ -Eshell V5.2.3.6  (abort with ^G)
    │ │ │ │ -1> application:start(ch_app).
    │ │ │ │ +Eshell V5.2.3.6  (abort with ^G)
    │ │ │ │ +1> application:start(ch_app).
    │ │ │ │  ok
    │ │ │ │ -2> application:get_env(ch_app, file).
    │ │ │ │ -{ok,"testlog"}

    │ │ │ │ +2> application:get_env(ch_app, file). │ │ │ │ +{ok,"testlog"}

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Application Start Types │ │ │ │

    │ │ │ │

    A start type is defined when starting the application:

    application:start(Application, Type)

    application:start(Application) is the same as calling │ │ │ │ application:start(Application, temporary). The type can also be permanent or │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/applications.html │ │ │ @@ -135,34 +135,34 @@ │ │ │ directory structure.

    │ │ │ │ │ │ │ │ │ │ │ │ Application Callback Module │ │ │

    │ │ │

    How to start and stop the code for the application, including its supervision │ │ │ -tree, is described by two callback functions:

    start(StartType, StartArgs) -> {ok, Pid} | {ok, Pid, State}
    │ │ │ -stop(State)
    • start/2 is called when starting the application and is to create the │ │ │ +tree, is described by two callback functions:

      start(StartType, StartArgs) -> {ok, Pid} | {ok, Pid, State}
      │ │ │ +stop(State)
      • start/2 is called when starting the application and is to create the │ │ │ supervision tree by starting the top supervisor. It is expected to return the │ │ │ pid of the top supervisor and an optional term, State, which defaults to │ │ │ []. This term is passed as is to stop/1.
      • StartType is usually the atom normal. It has other values only in the case │ │ │ of a takeover or failover; see │ │ │ Distributed Applications.
      • StartArgs is defined by the key mod in the │ │ │ application resource file.
      • stop/1 is called after the application has been stopped and is to do any │ │ │ necessary cleaning up. The actual stopping of the application, that is, │ │ │ shutting down the supervision tree, is handled automatically as described in │ │ │ Starting and Stopping Applications.

      Example of an application callback module for packaging the supervision tree │ │ │ -from Supervisor Behaviour:

      -module(ch_app).
      │ │ │ --behaviour(application).
      │ │ │ +from Supervisor Behaviour:

      -module(ch_app).
      │ │ │ +-behaviour(application).
      │ │ │  
      │ │ │ --export([start/2, stop/1]).
      │ │ │ +-export([start/2, stop/1]).
      │ │ │  
      │ │ │ -start(_Type, _Args) ->
      │ │ │ -    ch_sup:start_link().
      │ │ │ +start(_Type, _Args) ->
      │ │ │ +    ch_sup:start_link().
      │ │ │  
      │ │ │ -stop(_State) ->
      │ │ │ +stop(_State) ->
      │ │ │      ok.

      A library application that cannot be started or stopped does not need any │ │ │ application callback module.

      │ │ │ │ │ │ │ │ │ │ │ │ Application Resource File │ │ │

      │ │ │ @@ -173,22 +173,22 @@ │ │ │ keys.

    The contents of a minimal .app file for a library application libapp looks │ │ │ as follows:

    {application, libapp, []}.

    The contents of a minimal .app file ch_app.app for a supervision tree │ │ │ application like ch_app looks as follows:

    {application, ch_app,
    │ │ │   [{mod, {ch_app,[]}}]}.

    The key mod defines the callback module and start argument of the application, │ │ │ in this case ch_app and [], respectively. This means that the following is │ │ │ called when the application is to be started:

    ch_app:start(normal, [])

    The following is called when the application is stopped:

    ch_app:stop([])

    When using systools, the Erlang/OTP tools for packaging code (see Section │ │ │ Releases), the keys description, vsn, modules, │ │ │ -registered, and applications are also to be specified:

    {application, ch_app,
    │ │ │ - [{description, "Channel allocator"},
    │ │ │ -  {vsn, "1"},
    │ │ │ -  {modules, [ch_app, ch_sup, ch3]},
    │ │ │ -  {registered, [ch3]},
    │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ -  {mod, {ch_app,[]}}
    │ │ │ - ]}.
    • description - A short description, a string. Defaults to "".
    • vsn - Version number, a string. Defaults to "".
    • modules - All modules introduced by this application. systools uses │ │ │ +registered, and applications are also to be specified:

      {application, ch_app,
      │ │ │ + [{description, "Channel allocator"},
      │ │ │ +  {vsn, "1"},
      │ │ │ +  {modules, [ch_app, ch_sup, ch3]},
      │ │ │ +  {registered, [ch3]},
      │ │ │ +  {applications, [kernel, stdlib, sasl]},
      │ │ │ +  {mod, {ch_app,[]}}
      │ │ │ + ]}.
      • description - A short description, a string. Defaults to "".
      • vsn - Version number, a string. Defaults to "".
      • modules - All modules introduced by this application. systools uses │ │ │ this list when generating boot scripts and tar files. A module must only │ │ │ be included in one application. Defaults to [].
      • registered - All names of registered processes in the application. │ │ │ systools uses this list to detect name clashes between applications. │ │ │ Defaults to [].
      • applications - All applications that must be started before this │ │ │ application is started. systools uses this list to generate correct boot │ │ │ scripts. Defaults to []. Notice that all applications have dependencies to │ │ │ at least Kernel and STDLIB.

      Note

      For details about the syntax and contents of the application resource file, │ │ │ @@ -300,38 +300,38 @@ │ │ │ stop applications.

      │ │ │ │ │ │ │ │ │ │ │ │ Loading and Unloading Applications │ │ │

      │ │ │

      Before an application can be started, it must be loaded. The application │ │ │ -controller reads and stores the information from the .app file:

      1> application:load(ch_app).
      │ │ │ +controller reads and stores the information from the .app file:

      1> application:load(ch_app).
      │ │ │  ok
      │ │ │ -2> application:loaded_applications().
      │ │ │ -[{kernel,"ERTS  CXC 138 10","2.8.1.3"},
      │ │ │ - {stdlib,"ERTS  CXC 138 10","1.11.4.3"},
      │ │ │ - {ch_app,"Channel allocator","1"}]

      An application that has been stopped, or has never been started, can be │ │ │ +2> application:loaded_applications(). │ │ │ +[{kernel,"ERTS CXC 138 10","2.8.1.3"}, │ │ │ + {stdlib,"ERTS CXC 138 10","1.11.4.3"}, │ │ │ + {ch_app,"Channel allocator","1"}]

      An application that has been stopped, or has never been started, can be │ │ │ unloaded. The information about the application is erased from the internal │ │ │ -database of the application controller.

      3> application:unload(ch_app).
      │ │ │ +database of the application controller.

      3> application:unload(ch_app).
      │ │ │  ok
      │ │ │ -4> application:loaded_applications().
      │ │ │ -[{kernel,"ERTS  CXC 138 10","2.8.1.3"},
      │ │ │ - {stdlib,"ERTS  CXC 138 10","1.11.4.3"}]

      Note

      Loading/unloading an application does not load/unload the code used by the │ │ │ +4> application:loaded_applications(). │ │ │ +[{kernel,"ERTS CXC 138 10","2.8.1.3"}, │ │ │ + {stdlib,"ERTS CXC 138 10","1.11.4.3"}]

      Note

      Loading/unloading an application does not load/unload the code used by the │ │ │ application. Code loading is handled in the usual way by the code server.

      │ │ │ │ │ │ │ │ │ │ │ │ Starting and Stopping Applications │ │ │

      │ │ │ -

      An application is started by calling:

      5> application:start(ch_app).
      │ │ │ +

      An application is started by calling:

      5> application:start(ch_app).
      │ │ │  ok
      │ │ │ -6> application:which_applications().
      │ │ │ -[{kernel,"ERTS  CXC 138 10","2.8.1.3"},
      │ │ │ - {stdlib,"ERTS  CXC 138 10","1.11.4.3"},
      │ │ │ - {ch_app,"Channel allocator","1"}]

      If the application is not already loaded, the application controller first loads │ │ │ +6> application:which_applications(). │ │ │ +[{kernel,"ERTS CXC 138 10","2.8.1.3"}, │ │ │ + {stdlib,"ERTS CXC 138 10","1.11.4.3"}, │ │ │ + {ch_app,"Channel allocator","1"}]

      If the application is not already loaded, the application controller first loads │ │ │ it using application:load/1. It checks the value of the applications key to │ │ │ ensure that all applications that are to be started before this application are │ │ │ running.

      Following that, the application controller creates an application master for │ │ │ the application.

      The application master establishes itself as the group │ │ │ leader of all processes in the application │ │ │ and will forward I/O to the previous group leader.

      Note

      The purpose of the application master being the group leader is to easily │ │ │ keep track of which processes that belong to the application. That is needed │ │ │ @@ -347,55 +347,55 @@ │ │ │ defined by the mod key.

      │ │ │ │ │ │ │ │ │ │ │ │ Configuring an Application │ │ │

      │ │ │

      An application can be configured using configuration parameters. These are a │ │ │ -list of {Par,Val} tuples specified by a key env in the .app file:

      {application, ch_app,
      │ │ │ - [{description, "Channel allocator"},
      │ │ │ -  {vsn, "1"},
      │ │ │ -  {modules, [ch_app, ch_sup, ch3]},
      │ │ │ -  {registered, [ch3]},
      │ │ │ -  {applications, [kernel, stdlib, sasl]},
      │ │ │ -  {mod, {ch_app,[]}},
      │ │ │ -  {env, [{file, "/usr/local/log"}]}
      │ │ │ - ]}.

      Par is to be an atom. Val is any term. The application can retrieve the │ │ │ +list of {Par,Val} tuples specified by a key env in the .app file:

      {application, ch_app,
      │ │ │ + [{description, "Channel allocator"},
      │ │ │ +  {vsn, "1"},
      │ │ │ +  {modules, [ch_app, ch_sup, ch3]},
      │ │ │ +  {registered, [ch3]},
      │ │ │ +  {applications, [kernel, stdlib, sasl]},
      │ │ │ +  {mod, {ch_app,[]}},
      │ │ │ +  {env, [{file, "/usr/local/log"}]}
      │ │ │ + ]}.

      Par is to be an atom. Val is any term. The application can retrieve the │ │ │ value of a configuration parameter by calling application:get_env(App, Par) or │ │ │ a number of similar functions. For more information, see module application │ │ │ in Kernel.

      Example:

      % erl
      │ │ │ -Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
      │ │ │ +Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
      │ │ │  
      │ │ │ -Eshell V5.2.3.6  (abort with ^G)
      │ │ │ -1> application:start(ch_app).
      │ │ │ +Eshell V5.2.3.6  (abort with ^G)
      │ │ │ +1> application:start(ch_app).
      │ │ │  ok
      │ │ │ -2> application:get_env(ch_app, file).
      │ │ │ -{ok,"/usr/local/log"}

      The values in the .app file can be overridden by values in a system │ │ │ +2> application:get_env(ch_app, file). │ │ │ +{ok,"/usr/local/log"}

    The values in the .app file can be overridden by values in a system │ │ │ configuration file. This is a file that contains configuration parameters for │ │ │ -relevant applications:

    [{Application1, [{Par11,Val11},...]},
    │ │ │ +relevant applications:

    [{Application1, [{Par11,Val11},...]},
    │ │ │   ...,
    │ │ │ - {ApplicationN, [{ParN1,ValN1},...]}].

    The system configuration is to be called Name.config and Erlang is to be │ │ │ + {ApplicationN, [{ParN1,ValN1},...]}].

    The system configuration is to be called Name.config and Erlang is to be │ │ │ started with the command-line argument -config Name. For details, see │ │ │ config in Kernel.

    Example:

    A file test.config is created with the following contents:

    [{ch_app, [{file, "testlog"}]}].

    The value of file overrides the value of file as defined in the .app file:

    % erl -config test
    │ │ │ -Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
    │ │ │ +Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
    │ │ │  
    │ │ │ -Eshell V5.2.3.6  (abort with ^G)
    │ │ │ -1> application:start(ch_app).
    │ │ │ +Eshell V5.2.3.6  (abort with ^G)
    │ │ │ +1> application:start(ch_app).
    │ │ │  ok
    │ │ │ -2> application:get_env(ch_app, file).
    │ │ │ -{ok,"testlog"}

    If release handling is used, exactly one system │ │ │ +2> application:get_env(ch_app, file). │ │ │ +{ok,"testlog"}

    If release handling is used, exactly one system │ │ │ configuration file is to be used and that file is to be called sys.config.

    The values in the .app file and the values in a system configuration file can │ │ │ be overridden directly from the command line:

    % erl -ApplName Par1 Val1 ... ParN ValN

    Example:

    % erl -ch_app file '"testlog"'
    │ │ │ -Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
    │ │ │ +Erlang (BEAM) emulator version 5.2.3.6 [hipe] [threads:0]
    │ │ │  
    │ │ │ -Eshell V5.2.3.6  (abort with ^G)
    │ │ │ -1> application:start(ch_app).
    │ │ │ +Eshell V5.2.3.6  (abort with ^G)
    │ │ │ +1> application:start(ch_app).
    │ │ │  ok
    │ │ │ -2> application:get_env(ch_app, file).
    │ │ │ -{ok,"testlog"}

    │ │ │ +2> application:get_env(ch_app, file). │ │ │ +{ok,"testlog"}

    │ │ │ │ │ │ │ │ │ │ │ │ Application Start Types │ │ │

    │ │ │

    A start type is defined when starting the application:

    application:start(Application, Type)

    application:start(Application) is the same as calling │ │ │ application:start(Application, temporary). The type can also be permanent or │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/appup_cookbook.html │ │ │ @@ -120,18 +120,18 @@ │ │ │ │ │ │ │ │ │ │ │ │ Changing a Functional Module │ │ │ │ │ │

    When a functional module has been changed, for example, if a new function has │ │ │ been added or a bug has been corrected, simple code replacement is sufficient, │ │ │ -for example:

    {"2",
    │ │ │ - [{"1", [{load_module, m}]}],
    │ │ │ - [{"1", [{load_module, m}]}]
    │ │ │ -}.

    │ │ │ +for example:

    {"2",
    │ │ │ + [{"1", [{load_module, m}]}],
    │ │ │ + [{"1", [{load_module, m}]}]
    │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ Changing a Residence Module │ │ │

    │ │ │

    In a system implemented according to the OTP design principles, all processes, │ │ │ except system processes and special processes, reside in one of the behaviours │ │ │ @@ -142,46 +142,46 @@ │ │ │ │ │ │ │ │ │ │ │ │ Changing a Callback Module │ │ │ │ │ │

    A callback module is a functional module, and for code extensions simple code │ │ │ replacement is sufficient.

    Example

    When adding a function to ch3, as described in the example in │ │ │ -Release Handling, ch_app.appup looks as follows:

    {"2",
    │ │ │ - [{"1", [{load_module, ch3}]}],
    │ │ │ - [{"1", [{load_module, ch3}]}]
    │ │ │ -}.

    OTP also supports changing the internal state of behaviour processes; see │ │ │ +Release Handling, ch_app.appup looks as follows:

    {"2",
    │ │ │ + [{"1", [{load_module, ch3}]}],
    │ │ │ + [{"1", [{load_module, ch3}]}]
    │ │ │ +}.

    OTP also supports changing the internal state of behaviour processes; see │ │ │ Changing Internal State.

    │ │ │ │ │ │ │ │ │ │ │ │ Changing Internal State │ │ │

    │ │ │

    In this case, simple code replacement is not sufficient. The process must │ │ │ explicitly transform its state using the callback function code_change/3 before │ │ │ switching to the new version of the callback module. Thus, synchronized code │ │ │ replacement is used.

    Example

    Consider the ch3 module from │ │ │ gen_server Behaviour. The internal state is a term │ │ │ Chs representing the available channels. Assume you want to add a counter N, │ │ │ which keeps track of the number of alloc requests so far. This means that the │ │ │ -format must be changed to {Chs,N}.

    The .appup file can look as follows:

    {"2",
    │ │ │ - [{"1", [{update, ch3, {advanced, []}}]}],
    │ │ │ - [{"1", [{update, ch3, {advanced, []}}]}]
    │ │ │ -}.

    The third element of the update instruction is a tuple {advanced,Extra}, │ │ │ +format must be changed to {Chs,N}.

    The .appup file can look as follows:

    {"2",
    │ │ │ + [{"1", [{update, ch3, {advanced, []}}]}],
    │ │ │ + [{"1", [{update, ch3, {advanced, []}}]}]
    │ │ │ +}.

    The third element of the update instruction is a tuple {advanced,Extra}, │ │ │ which says that the affected processes are to do a state transformation before │ │ │ loading the new version of the module. This is done by the processes calling the │ │ │ callback function code_change/3 (see gen_server in STDLIB). │ │ │ -The term Extra, in this case [], is passed as is to the function:

    -module(ch3).
    │ │ │ +The term Extra, in this case [], is passed as is to the function:

    -module(ch3).
    │ │ │  ...
    │ │ │ --export([code_change/3]).
    │ │ │ +-export([code_change/3]).
    │ │ │  ...
    │ │ │ -code_change({down, _Vsn}, {Chs, N}, _Extra) ->
    │ │ │ -    {ok, Chs};
    │ │ │ -code_change(_Vsn, Chs, _Extra) ->
    │ │ │ -    {ok, {Chs, 0}}.

    The first argument is {down,Vsn} if there is a downgrade, or Vsn if there is │ │ │ +code_change({down, _Vsn}, {Chs, N}, _Extra) -> │ │ │ + {ok, Chs}; │ │ │ +code_change(_Vsn, Chs, _Extra) -> │ │ │ + {ok, {Chs, 0}}.

    The first argument is {down,Vsn} if there is a downgrade, or Vsn if there is │ │ │ a upgrade. The term Vsn is fetched from the 'original' version of the module, │ │ │ that is, the version you are upgrading from, or downgrading to.

    The version is defined by the module attribute vsn, if any. There is no such │ │ │ attribute in ch3, so in this case the version is the checksum (a huge integer) │ │ │ of the beam file, an uninteresting value, which is ignored.

    The other callback functions of ch3 must also be modified and perhaps a new │ │ │ interface function must be added, but this is not shown here.

    │ │ │ │ │ │ │ │ │ @@ -190,67 +190,67 @@ │ │ │

    │ │ │

    Assume that a module is extended by adding an interface function, as in the │ │ │ example in Release Handling, where a function │ │ │ available/0 is added to ch3.

    If a call is added to this function, say in module m1, a runtime error could │ │ │ can occur during release upgrade if the new version of m1 is loaded first and │ │ │ calls ch3:available/0 before the new version of ch3 is loaded.

    Thus, ch3 must be loaded before m1, in the upgrade case, and conversely in │ │ │ the downgrade case. m1 is said to be dependent on ch3. In a release │ │ │ -handling instruction, this is expressed by the DepMods element:

    {load_module, Module, DepMods}
    │ │ │ -{update, Module, {advanced, Extra}, DepMods}

    DepMods is a list of modules, on which Module is dependent.

    Example

    The module m1 in application myapp is dependent on ch3 when │ │ │ +handling instruction, this is expressed by the DepMods element:

    {load_module, Module, DepMods}
    │ │ │ +{update, Module, {advanced, Extra}, DepMods}

    DepMods is a list of modules, on which Module is dependent.

    Example

    The module m1 in application myapp is dependent on ch3 when │ │ │ upgrading from "1" to "2", or downgrading from "2" to "1":

    myapp.appup:
    │ │ │  
    │ │ │ -{"2",
    │ │ │ - [{"1", [{load_module, m1, [ch3]}]}],
    │ │ │ - [{"1", [{load_module, m1, [ch3]}]}]
    │ │ │ -}.
    │ │ │ +{"2",
    │ │ │ + [{"1", [{load_module, m1, [ch3]}]}],
    │ │ │ + [{"1", [{load_module, m1, [ch3]}]}]
    │ │ │ +}.
    │ │ │  
    │ │ │  ch_app.appup:
    │ │ │  
    │ │ │ -{"2",
    │ │ │ - [{"1", [{load_module, ch3}]}],
    │ │ │ - [{"1", [{load_module, ch3}]}]
    │ │ │ -}.

    If instead m1 and ch3 belong to the same application, the .appup file can │ │ │ -look as follows:

    {"2",
    │ │ │ - [{"1",
    │ │ │ -   [{load_module, ch3},
    │ │ │ -    {load_module, m1, [ch3]}]}],
    │ │ │ - [{"1",
    │ │ │ -   [{load_module, ch3},
    │ │ │ -    {load_module, m1, [ch3]}]}]
    │ │ │ -}.

    m1 is dependent on ch3 also when downgrading. systools knows the │ │ │ +{"2", │ │ │ + [{"1", [{load_module, ch3}]}], │ │ │ + [{"1", [{load_module, ch3}]}] │ │ │ +}.

    If instead m1 and ch3 belong to the same application, the .appup file can │ │ │ +look as follows:

    {"2",
    │ │ │ + [{"1",
    │ │ │ +   [{load_module, ch3},
    │ │ │ +    {load_module, m1, [ch3]}]}],
    │ │ │ + [{"1",
    │ │ │ +   [{load_module, ch3},
    │ │ │ +    {load_module, m1, [ch3]}]}]
    │ │ │ +}.

    m1 is dependent on ch3 also when downgrading. systools knows the │ │ │ difference between up- and downgrading and generates a correct relup, where │ │ │ ch3 is loaded before m1 when upgrading, but m1 is loaded before ch3 when │ │ │ downgrading.

    │ │ │ │ │ │ │ │ │ │ │ │ Changing Code for a Special Process │ │ │

    │ │ │

    In this case, simple code replacement is not sufficient. When a new version of a │ │ │ residence module for a special process is loaded, the process must make a fully │ │ │ qualified call to its loop function to switch to the new code. Thus, │ │ │ synchronized code replacement must be used.

    Note

    The name(s) of the user-defined residence module(s) must be listed in the │ │ │ Modules part of the child specification for the special process. Otherwise │ │ │ the release handler cannot find the process.

    Example

    Consider the example ch4 in sys and proc_lib. │ │ │ -When started by a supervisor, the child specification can look as follows:

    {ch4, {ch4, start_link, []},
    │ │ │ - permanent, brutal_kill, worker, [ch4]}

    If ch4 is part of the application sp_app and a new version of the module is │ │ │ +When started by a supervisor, the child specification can look as follows:

    {ch4, {ch4, start_link, []},
    │ │ │ + permanent, brutal_kill, worker, [ch4]}

    If ch4 is part of the application sp_app and a new version of the module is │ │ │ to be loaded when upgrading from version "1" to "2" of this application, │ │ │ -sp_app.appup can look as follows:

    {"2",
    │ │ │ - [{"1", [{update, ch4, {advanced, []}}]}],
    │ │ │ - [{"1", [{update, ch4, {advanced, []}}]}]
    │ │ │ -}.

    The update instruction must contain the tuple {advanced,Extra}. The │ │ │ +sp_app.appup can look as follows:

    {"2",
    │ │ │ + [{"1", [{update, ch4, {advanced, []}}]}],
    │ │ │ + [{"1", [{update, ch4, {advanced, []}}]}]
    │ │ │ +}.

    The update instruction must contain the tuple {advanced,Extra}. The │ │ │ instruction makes the special process call the callback function │ │ │ system_code_change/4, a function the user must implement. The term Extra, in │ │ │ -this case [], is passed as is to system_code_change/4:

    -module(ch4).
    │ │ │ +this case [], is passed as is to system_code_change/4:

    -module(ch4).
    │ │ │  ...
    │ │ │ --export([system_code_change/4]).
    │ │ │ +-export([system_code_change/4]).
    │ │ │  ...
    │ │ │  
    │ │ │ -system_code_change(Chs, _Module, _OldVsn, _Extra) ->
    │ │ │ -    {ok, Chs}.
    • The first argument is the internal state State, passed from │ │ │ +system_code_change(Chs, _Module, _OldVsn, _Extra) -> │ │ │ + {ok, Chs}.

    In this case, all arguments but the first are ignored and the function simply │ │ │ returns the internal state again. This is enough if the code only has been │ │ │ extended. If instead the internal state is changed (similar to the example in │ │ │ @@ -271,85 +271,85 @@ │ │ │ Changing Properties │ │ │ │ │ │

    Since the supervisor is to change its internal state, synchronized code │ │ │ replacement is required. However, a special update instruction must be used.

    First, the new version of the callback module must be loaded, both in the case │ │ │ of upgrade and downgrade. Then the new return value of init/1 can be checked │ │ │ and the internal state be changed accordingly.

    The following upgrade instruction is used for supervisors:

    {update, Module, supervisor}

    Example

    To change the restart strategy of ch_sup (from │ │ │ Supervisor Behaviour) from one_for_one to one_for_all, │ │ │ -change the callback function init/1 in ch_sup.erl:

    -module(ch_sup).
    │ │ │ +change the callback function init/1 in ch_sup.erl:

    -module(ch_sup).
    │ │ │  ...
    │ │ │  
    │ │ │ -init(_Args) ->
    │ │ │ -    {ok, {#{strategy => one_for_all, ...}, ...}}.

    The file ch_app.appup:

    {"2",
    │ │ │ - [{"1", [{update, ch_sup, supervisor}]}],
    │ │ │ - [{"1", [{update, ch_sup, supervisor}]}]
    │ │ │ -}.

    │ │ │ +init(_Args) -> │ │ │ + {ok, {#{strategy => one_for_all, ...}, ...}}.

    The file ch_app.appup:

    {"2",
    │ │ │ + [{"1", [{update, ch_sup, supervisor}]}],
    │ │ │ + [{"1", [{update, ch_sup, supervisor}]}]
    │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ Changing Child Specifications │ │ │

    │ │ │

    The instruction, and thus the .appup file, when changing an existing child │ │ │ -specification, is the same as when changing properties as described earlier:

    {"2",
    │ │ │ - [{"1", [{update, ch_sup, supervisor}]}],
    │ │ │ - [{"1", [{update, ch_sup, supervisor}]}]
    │ │ │ -}.

    The changes do not affect existing child processes. For example, changing the │ │ │ +specification, is the same as when changing properties as described earlier:

    {"2",
    │ │ │ + [{"1", [{update, ch_sup, supervisor}]}],
    │ │ │ + [{"1", [{update, ch_sup, supervisor}]}]
    │ │ │ +}.

    The changes do not affect existing child processes. For example, changing the │ │ │ start function only specifies how the child process is to be restarted, if │ │ │ needed later on.

    The id of the child specification cannot be changed.

    Changing the Modules field of the child specification can affect the release │ │ │ handling process itself, as this field is used to identify which processes are │ │ │ affected when doing a synchronized code replacement.

    │ │ │ │ │ │ │ │ │ │ │ │ Adding and Deleting Child Processes │ │ │

    │ │ │

    As stated earlier, changing child specifications does not affect existing child │ │ │ processes. New child specifications are automatically added, but not deleted. │ │ │ Child processes are not automatically started or terminated, this must be done │ │ │ using apply instructions.

    Example

    Assume a new child process m1 is to be added to ch_sup when │ │ │ upgrading ch_app from "1" to "2". This means m1 is to be deleted when │ │ │ -downgrading from "2" to "1":

    {"2",
    │ │ │ - [{"1",
    │ │ │ -   [{update, ch_sup, supervisor},
    │ │ │ -    {apply, {supervisor, restart_child, [ch_sup, m1]}}
    │ │ │ -   ]}],
    │ │ │ - [{"1",
    │ │ │ -   [{apply, {supervisor, terminate_child, [ch_sup, m1]}},
    │ │ │ -    {apply, {supervisor, delete_child, [ch_sup, m1]}},
    │ │ │ -    {update, ch_sup, supervisor}
    │ │ │ -   ]}]
    │ │ │ -}.

    The order of the instructions is important.

    The supervisor must be registered as ch_sup for the script to work. If the │ │ │ +downgrading from "2" to "1":

    {"2",
    │ │ │ + [{"1",
    │ │ │ +   [{update, ch_sup, supervisor},
    │ │ │ +    {apply, {supervisor, restart_child, [ch_sup, m1]}}
    │ │ │ +   ]}],
    │ │ │ + [{"1",
    │ │ │ +   [{apply, {supervisor, terminate_child, [ch_sup, m1]}},
    │ │ │ +    {apply, {supervisor, delete_child, [ch_sup, m1]}},
    │ │ │ +    {update, ch_sup, supervisor}
    │ │ │ +   ]}]
    │ │ │ +}.

    The order of the instructions is important.

    The supervisor must be registered as ch_sup for the script to work. If the │ │ │ supervisor is not registered, it cannot be accessed directly from the script. │ │ │ Instead a help function that finds the pid of the supervisor and calls │ │ │ supervisor:restart_child, and so on, must be written. This function is then to │ │ │ be called from the script using the apply instruction.

    If the module m1 is introduced in version "2" of ch_app, it must also be │ │ │ -loaded when upgrading and deleted when downgrading:

    {"2",
    │ │ │ - [{"1",
    │ │ │ -   [{add_module, m1},
    │ │ │ -    {update, ch_sup, supervisor},
    │ │ │ -    {apply, {supervisor, restart_child, [ch_sup, m1]}}
    │ │ │ -   ]}],
    │ │ │ - [{"1",
    │ │ │ -   [{apply, {supervisor, terminate_child, [ch_sup, m1]}},
    │ │ │ -    {apply, {supervisor, delete_child, [ch_sup, m1]}},
    │ │ │ -    {update, ch_sup, supervisor},
    │ │ │ -    {delete_module, m1}
    │ │ │ -   ]}]
    │ │ │ -}.

    As stated earlier, the order of the instructions is important. When upgrading, │ │ │ +loaded when upgrading and deleted when downgrading:

    {"2",
    │ │ │ + [{"1",
    │ │ │ +   [{add_module, m1},
    │ │ │ +    {update, ch_sup, supervisor},
    │ │ │ +    {apply, {supervisor, restart_child, [ch_sup, m1]}}
    │ │ │ +   ]}],
    │ │ │ + [{"1",
    │ │ │ +   [{apply, {supervisor, terminate_child, [ch_sup, m1]}},
    │ │ │ +    {apply, {supervisor, delete_child, [ch_sup, m1]}},
    │ │ │ +    {update, ch_sup, supervisor},
    │ │ │ +    {delete_module, m1}
    │ │ │ +   ]}]
    │ │ │ +}.

    As stated earlier, the order of the instructions is important. When upgrading, │ │ │ m1 must be loaded, and the supervisor child specification changed, before the │ │ │ new child process can be started. When downgrading, the child process must be │ │ │ terminated before the child specification is changed and the module is deleted.

    │ │ │ │ │ │ │ │ │ │ │ │ Adding or Deleting a Module │ │ │

    │ │ │ -

    _Example

    _ A new functional module m is added to ch_app:

    {"2",
    │ │ │ - [{"1", [{add_module, m}]}],
    │ │ │ - [{"1", [{delete_module, m}]}]

    │ │ │ +

    _Example

    _ A new functional module m is added to ch_app:

    {"2",
    │ │ │ + [{"1", [{add_module, m}]}],
    │ │ │ + [{"1", [{delete_module, m}]}]

    │ │ │ │ │ │ │ │ │ │ │ │ Starting or Terminating a Process │ │ │

    │ │ │

    In a system structured according to the OTP design principles, any process would │ │ │ be a child process belonging to a supervisor, see │ │ │ @@ -369,29 +369,29 @@ │ │ │ Restarting an Application │ │ │ │ │ │

    Restarting an application is useful when a change is too complicated to be made │ │ │ without restarting the processes, for example, if the supervisor hierarchy has │ │ │ been restructured.

    Example

    When adding a child m1 to ch_sup, as in │ │ │ Adding and Deleting Child Processes in Changing a │ │ │ Supervisor, an alternative to updating the supervisor is to restart the entire │ │ │ -application:

    {"2",
    │ │ │ - [{"1", [{restart_application, ch_app}]}],
    │ │ │ - [{"1", [{restart_application, ch_app}]}]
    │ │ │ -}.

    │ │ │ +application:

    {"2",
    │ │ │ + [{"1", [{restart_application, ch_app}]}],
    │ │ │ + [{"1", [{restart_application, ch_app}]}]
    │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ Changing an Application Specification │ │ │

    │ │ │

    When installing a release, the application specifications are automatically │ │ │ updated before evaluating the relup script. Thus, no instructions are needed │ │ │ -in the .appup file:

    {"2",
    │ │ │ - [{"1", []}],
    │ │ │ - [{"1", []}]
    │ │ │ -}.

    │ │ │ +in the .appup file:

    {"2",
    │ │ │ + [{"1", []}],
    │ │ │ + [{"1", []}]
    │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ Changing Application Configuration │ │ │

    │ │ │

    Changing an application configuration by updating the env key in the .app │ │ │ file is an instance of changing an application specification, see the previous │ │ │ @@ -406,26 +406,26 @@ │ │ │ applications apply to primary applications only. There are no corresponding │ │ │ instructions for included applications. However, since an included application │ │ │ is really a supervision tree with a topmost supervisor, started as a child │ │ │ process to a supervisor in the including application, a .relup file can be │ │ │ manually created.

    Example

    Assume there is a release containing an application prim_app, which │ │ │ have a supervisor prim_sup in its supervision tree.

    In a new version of the release, the application ch_app is to be included in │ │ │ prim_app. That is, its topmost supervisor ch_sup is to be started as a child │ │ │ -process to prim_sup.

    The workflow is as follows:

    Step 1) Edit the code for prim_sup:

    init(...) ->
    │ │ │ -    {ok, {...supervisor flags...,
    │ │ │ -          [...,
    │ │ │ -           {ch_sup, {ch_sup,start_link,[]},
    │ │ │ -            permanent,infinity,supervisor,[ch_sup]},
    │ │ │ -           ...]}}.

    Step 2) Edit the .app file for prim_app:

    {application, prim_app,
    │ │ │ - [...,
    │ │ │ -  {vsn, "2"},
    │ │ │ +process to prim_sup.

    The workflow is as follows:

    Step 1) Edit the code for prim_sup:

    init(...) ->
    │ │ │ +    {ok, {...supervisor flags...,
    │ │ │ +          [...,
    │ │ │ +           {ch_sup, {ch_sup,start_link,[]},
    │ │ │ +            permanent,infinity,supervisor,[ch_sup]},
    │ │ │ +           ...]}}.

    Step 2) Edit the .app file for prim_app:

    {application, prim_app,
    │ │ │ + [...,
    │ │ │ +  {vsn, "2"},
    │ │ │    ...,
    │ │ │ -  {included_applications, [ch_app]},
    │ │ │ +  {included_applications, [ch_app]},
    │ │ │    ...
    │ │ │ - ]}.

    Step 3) Create a new .rel file, including ch_app:

    {release,
    │ │ │ + ]}.

    Step 3) Create a new .rel file, including ch_app:

    {release,
    │ │ │   ...,
    │ │ │   [...,
    │ │ │    {prim_app, "2"},
    │ │ │    {ch_app, "1"}]}.

    The included application can be started in two ways. This is described in the │ │ │ next two sections.

    │ │ │ │ │ │ │ │ │ @@ -480,74 +480,74 @@ │ │ │

    Step 4b) Another way to start the included application (or stop it in the case │ │ │ of downgrade) is by combining instructions for adding and removing child │ │ │ processes to/from prim_sup with instructions for loading/unloading all │ │ │ ch_app code and its application specification.

    Again, the .relup file is created manually, either from scratch or by editing a │ │ │ generated version. Load all code for ch_app first, and also load the │ │ │ application specification, before prim_sup is updated. When downgrading, │ │ │ prim_sup is to updated first, before the code for ch_app and its application │ │ │ -specification are unloaded.

    {"B",
    │ │ │ - [{"A",
    │ │ │ -   [],
    │ │ │ -   [{load_object_code,{ch_app,"1",[ch_sup,ch3]}},
    │ │ │ -    {load_object_code,{prim_app,"2",[prim_sup]}},
    │ │ │ +specification are unloaded.

    {"B",
    │ │ │ + [{"A",
    │ │ │ +   [],
    │ │ │ +   [{load_object_code,{ch_app,"1",[ch_sup,ch3]}},
    │ │ │ +    {load_object_code,{prim_app,"2",[prim_sup]}},
    │ │ │      point_of_no_return,
    │ │ │ -    {load,{ch_sup,brutal_purge,brutal_purge}},
    │ │ │ -    {load,{ch3,brutal_purge,brutal_purge}},
    │ │ │ -    {apply,{application,load,[ch_app]}},
    │ │ │ -    {suspend,[prim_sup]},
    │ │ │ -    {load,{prim_sup,brutal_purge,brutal_purge}},
    │ │ │ -    {code_change,up,[{prim_sup,[]}]},
    │ │ │ -    {resume,[prim_sup]},
    │ │ │ -    {apply,{supervisor,restart_child,[prim_sup,ch_sup]}}]}],
    │ │ │ - [{"A",
    │ │ │ -   [],
    │ │ │ -   [{load_object_code,{prim_app,"1",[prim_sup]}},
    │ │ │ +    {load,{ch_sup,brutal_purge,brutal_purge}},
    │ │ │ +    {load,{ch3,brutal_purge,brutal_purge}},
    │ │ │ +    {apply,{application,load,[ch_app]}},
    │ │ │ +    {suspend,[prim_sup]},
    │ │ │ +    {load,{prim_sup,brutal_purge,brutal_purge}},
    │ │ │ +    {code_change,up,[{prim_sup,[]}]},
    │ │ │ +    {resume,[prim_sup]},
    │ │ │ +    {apply,{supervisor,restart_child,[prim_sup,ch_sup]}}]}],
    │ │ │ + [{"A",
    │ │ │ +   [],
    │ │ │ +   [{load_object_code,{prim_app,"1",[prim_sup]}},
    │ │ │      point_of_no_return,
    │ │ │ -    {apply,{supervisor,terminate_child,[prim_sup,ch_sup]}},
    │ │ │ -    {apply,{supervisor,delete_child,[prim_sup,ch_sup]}},
    │ │ │ -    {suspend,[prim_sup]},
    │ │ │ -    {load,{prim_sup,brutal_purge,brutal_purge}},
    │ │ │ -    {code_change,down,[{prim_sup,[]}]},
    │ │ │ -    {resume,[prim_sup]},
    │ │ │ -    {remove,{ch_sup,brutal_purge,brutal_purge}},
    │ │ │ -    {remove,{ch3,brutal_purge,brutal_purge}},
    │ │ │ -    {purge,[ch_sup,ch3]},
    │ │ │ -    {apply,{application,unload,[ch_app]}}]}]
    │ │ │ -}.

    │ │ │ + {apply,{supervisor,terminate_child,[prim_sup,ch_sup]}}, │ │ │ + {apply,{supervisor,delete_child,[prim_sup,ch_sup]}}, │ │ │ + {suspend,[prim_sup]}, │ │ │ + {load,{prim_sup,brutal_purge,brutal_purge}}, │ │ │ + {code_change,down,[{prim_sup,[]}]}, │ │ │ + {resume,[prim_sup]}, │ │ │ + {remove,{ch_sup,brutal_purge,brutal_purge}}, │ │ │ + {remove,{ch3,brutal_purge,brutal_purge}}, │ │ │ + {purge,[ch_sup,ch3]}, │ │ │ + {apply,{application,unload,[ch_app]}}]}] │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ Changing Non-Erlang Code │ │ │

    │ │ │

    Changing code for a program written in another programming language than Erlang, │ │ │ for example, a port program, is application-dependent and OTP provides no │ │ │ special support.

    Example

    When changing code for a port program, assume that the Erlang process │ │ │ controlling the port is a gen_server portc and that the port is opened in │ │ │ -the callback function init/1:

    init(...) ->
    │ │ │ +the callback function init/1:

    init(...) ->
    │ │ │      ...,
    │ │ │ -    PortPrg = filename:join(code:priv_dir(App), "portc"),
    │ │ │ -    Port = open_port({spawn,PortPrg}, [...]),
    │ │ │ +    PortPrg = filename:join(code:priv_dir(App), "portc"),
    │ │ │ +    Port = open_port({spawn,PortPrg}, [...]),
    │ │ │      ...,
    │ │ │ -    {ok, #state{port=Port, ...}}.

    If the port program is to be updated, the code for the gen_server can be │ │ │ + {ok, #state{port=Port, ...}}.

    If the port program is to be updated, the code for the gen_server can be │ │ │ extended with a code_change/3 function, which closes the old port and opens a │ │ │ new port. (If necessary, the gen_server can first request data that must be │ │ │ -saved from the port program and pass this data to the new port):

    code_change(_OldVsn, State, port) ->
    │ │ │ +saved from the port program and pass this data to the new port):

    code_change(_OldVsn, State, port) ->
    │ │ │      State#state.port ! close,
    │ │ │      receive
    │ │ │ -        {Port,close} ->
    │ │ │ +        {Port,close} ->
    │ │ │              true
    │ │ │      end,
    │ │ │ -    PortPrg = filename:join(code:priv_dir(App), "portc"),
    │ │ │ -    Port = open_port({spawn,PortPrg}, [...]),
    │ │ │ -    {ok, #state{port=Port, ...}}.

    Update the application version number in the .app file and write an .appup │ │ │ -file:

    ["2",
    │ │ │ - [{"1", [{update, portc, {advanced,port}}]}],
    │ │ │ - [{"1", [{update, portc, {advanced,port}}]}]
    │ │ │ -].

    Ensure that the priv directory, where the C program is located, is included in │ │ │ -the new release package:

    1> systools:make_tar("my_release", [{dirs,[priv]}]).
    │ │ │ +    PortPrg = filename:join(code:priv_dir(App), "portc"),
    │ │ │ +    Port = open_port({spawn,PortPrg}, [...]),
    │ │ │ +    {ok, #state{port=Port, ...}}.

    Update the application version number in the .app file and write an .appup │ │ │ +file:

    ["2",
    │ │ │ + [{"1", [{update, portc, {advanced,port}}]}],
    │ │ │ + [{"1", [{update, portc, {advanced,port}}]}]
    │ │ │ +].

    Ensure that the priv directory, where the C program is located, is included in │ │ │ +the new release package:

    1> systools:make_tar("my_release", [{dirs,[priv]}]).
    │ │ │  ...

    │ │ │ │ │ │ │ │ │ │ │ │ Runtime System Restart and Upgrade │ │ │

    │ │ │

    Two upgrade instructions restart the runtime system:

    • restart_new_emulator

      Intended when ERTS, Kernel, STDLIB, or SASL is upgraded. It is automatically │ │ │ @@ -555,22 +555,22 @@ │ │ │ executed before all other upgrade instructions. For more information about │ │ │ this instruction, see restart_new_emulator (Low-Level) in │ │ │ Release Handling Instructions.

    • restart_emulator

      Used when a restart of the runtime system is required after all other upgrade │ │ │ instructions are executed. For more information about this instruction, see │ │ │ restart_emulator (Low-Level) in │ │ │ Release Handling Instructions.

    If a runtime system restart is necessary and no upgrade instructions are needed, │ │ │ that is, if the restart itself is enough for the upgraded applications to start │ │ │ -running the new versions, a simple .relup file can be created manually:

    {"B",
    │ │ │ - [{"A",
    │ │ │ -   [],
    │ │ │ -   [restart_emulator]}],
    │ │ │ - [{"A",
    │ │ │ -   [],
    │ │ │ -   [restart_emulator]}]
    │ │ │ -}.

    In this case, the release handler framework with automatic packing and unpacking │ │ │ +running the new versions, a simple .relup file can be created manually:

    {"B",
    │ │ │ + [{"A",
    │ │ │ +   [],
    │ │ │ +   [restart_emulator]}],
    │ │ │ + [{"A",
    │ │ │ +   [],
    │ │ │ +   [restart_emulator]}]
    │ │ │ +}.

    In this case, the release handler framework with automatic packing and unpacking │ │ │ of release packages, automatic path updates, and so on, can be used without │ │ │ having to specify .appup files.

    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/benchmarking.html │ │ │ @@ -144,16 +144,16 @@ │ │ │ fast as possible, what can we do? One way could be to generate more │ │ │ than two bytes at the time.

    % erlperf 'rand:bytes(100).' 'crypto:strong_rand_bytes(100).'
    │ │ │  Code                                   ||        QPS       Time   Rel
    │ │ │  rand:bytes(100).                        1    2124 Ki     470 ns  100%
    │ │ │  crypto:strong_rand_bytes(100).          1    1915 Ki     522 ns   90%

    rand:bytes/1 is still faster when we generate 100 bytes at the time, │ │ │ but the relative difference is smaller.

    % erlperf 'rand:bytes(1000).' 'crypto:strong_rand_bytes(1000).'
    │ │ │  Code                                    ||        QPS       Time   Rel
    │ │ │ -crypto:strong_rand_bytes(1000).          1    1518 Ki     658 ns  100%
    │ │ │ -rand:bytes(1000).                        1     284 Ki    3521 ns   19%

    When we generate 1000 bytes at the time, crypto:strong_rand_bytes/1 is │ │ │ +crypto:strong_rand_bytes(1000). 1 1518 Ki 658 ns 100% │ │ │ +rand:bytes(1000). 1 284 Ki 3521 ns 19%

    When we generate 1000 bytes at the time, crypto:strong_rand_bytes/1 is │ │ │ now the fastest.

    │ │ │ │ │ │ │ │ │ │ │ │ Benchmarking using Erlang/OTP functionality │ │ │

    │ │ │

    Benchmarks can measure wall-clock time or CPU time.

    • timer:tc/3 measures wall-clock time. The advantage with wall-clock time is │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/binaryhandling.html │ │ │ @@ -114,43 +114,43 @@ │ │ │ │ │ │ Constructing and Matching Binaries │ │ │ │ │ │ │ │ │

      This section gives a few examples on how to handle binaries in an efficient way. │ │ │ The sections that follow take an in-depth look at how binaries are implemented │ │ │ and how to best take advantages of the optimizations done by the compiler and │ │ │ -runtime system.

      Binaries can be efficiently built in the following way:

      DO

      my_list_to_binary(List) ->
      │ │ │ -    my_list_to_binary(List, <<>>).
      │ │ │ +runtime system.

      Binaries can be efficiently built in the following way:

      DO

      my_list_to_binary(List) ->
      │ │ │ +    my_list_to_binary(List, <<>>).
      │ │ │  
      │ │ │ -my_list_to_binary([H|T], Acc) ->
      │ │ │ -    my_list_to_binary(T, <<Acc/binary,H>>);
      │ │ │ -my_list_to_binary([], Acc) ->
      │ │ │ +my_list_to_binary([H|T], Acc) ->
      │ │ │ +    my_list_to_binary(T, <<Acc/binary,H>>);
      │ │ │ +my_list_to_binary([], Acc) ->
      │ │ │      Acc.

      Appending data to a binary as in the example is efficient because it is │ │ │ specially optimized by the runtime system to avoid copying the Acc binary │ │ │ -every time.

      Prepending data to a binary in a loop is not efficient:

      DO NOT

      rev_list_to_binary(List) ->
      │ │ │ -    rev_list_to_binary(List, <<>>).
      │ │ │ +every time.

      Prepending data to a binary in a loop is not efficient:

      DO NOT

      rev_list_to_binary(List) ->
      │ │ │ +    rev_list_to_binary(List, <<>>).
      │ │ │  
      │ │ │ -rev_list_to_binary([H|T], Acc) ->
      │ │ │ -    rev_list_to_binary(T, <<H,Acc/binary>>);
      │ │ │ -rev_list_to_binary([], Acc) ->
      │ │ │ +rev_list_to_binary([H|T], Acc) ->
      │ │ │ +    rev_list_to_binary(T, <<H,Acc/binary>>);
      │ │ │ +rev_list_to_binary([], Acc) ->
      │ │ │      Acc.

      This is not efficient for long lists because the Acc binary is copied every │ │ │ -time. One way to make the function more efficient is like this:

      DO NOT

      rev_list_to_binary(List) ->
      │ │ │ -    rev_list_to_binary(lists:reverse(List), <<>>).
      │ │ │ +time. One way to make the function more efficient is like this:

      DO NOT

      rev_list_to_binary(List) ->
      │ │ │ +    rev_list_to_binary(lists:reverse(List), <<>>).
      │ │ │  
      │ │ │ -rev_list_to_binary([H|T], Acc) ->
      │ │ │ -    rev_list_to_binary(T, <<Acc/binary,H>>);
      │ │ │ -rev_list_to_binary([], Acc) ->
      │ │ │ -    Acc.

      Another way to avoid copying the binary each time is like this:

      DO

      rev_list_to_binary([H|T]) ->
      │ │ │ -    RevTail = rev_list_to_binary(T),
      │ │ │ -    <<RevTail/binary,H>>;
      │ │ │ -rev_list_to_binary([]) ->
      │ │ │ -    <<>>.

      Note that in each of the DO examples, the binary to be appended to is always │ │ │ -given as the first segment.

      Binaries can be efficiently matched in the following way:

      DO

      my_binary_to_list(<<H,T/binary>>) ->
      │ │ │ -    [H|my_binary_to_list(T)];
      │ │ │ -my_binary_to_list(<<>>) -> [].

      │ │ │ +rev_list_to_binary([H|T], Acc) -> │ │ │ + rev_list_to_binary(T, <<Acc/binary,H>>); │ │ │ +rev_list_to_binary([], Acc) -> │ │ │ + Acc.

      Another way to avoid copying the binary each time is like this:

      DO

      rev_list_to_binary([H|T]) ->
      │ │ │ +    RevTail = rev_list_to_binary(T),
      │ │ │ +    <<RevTail/binary,H>>;
      │ │ │ +rev_list_to_binary([]) ->
      │ │ │ +    <<>>.

      Note that in each of the DO examples, the binary to be appended to is always │ │ │ +given as the first segment.

      Binaries can be efficiently matched in the following way:

      DO

      my_binary_to_list(<<H,T/binary>>) ->
      │ │ │ +    [H|my_binary_to_list(T)];
      │ │ │ +my_binary_to_list(<<>>) -> [].

      │ │ │ │ │ │ │ │ │ │ │ │ How Binaries are Implemented │ │ │

      │ │ │

      Internally, binaries and bitstrings are implemented in the same way. In this │ │ │ section, they are called binaries because that is what they are called in the │ │ │ @@ -205,29 +205,29 @@ │ │ │ called referential transparency) of Erlang would break.

      │ │ │ │ │ │ │ │ │ │ │ │ Constructing Binaries │ │ │

      │ │ │

      Appending to a binary or bitstring in the following way is specially optimized │ │ │ -to avoid copying the binary:

      <<Binary/binary, ...>>
      │ │ │ +to avoid copying the binary:

      <<Binary/binary, ...>>
      │ │ │  %% - OR -
      │ │ │ -<<Binary/bitstring, ...>>

      This optimization is applied by the runtime system in a way that makes it │ │ │ +<<Binary/bitstring, ...>>

      This optimization is applied by the runtime system in a way that makes it │ │ │ effective in most circumstances (for exceptions, see │ │ │ Circumstances That Force Copying). The │ │ │ optimization in its basic form does not need any help from the compiler. │ │ │ However, the compiler add hints to the runtime system when it is safe to apply │ │ │ the optimization in a more efficient way.

      Change

      The compiler support for making the optimization more efficient was added in │ │ │ Erlang/OTP 26.

      To explain how the basic optimization works, let us examine the following code │ │ │ -line by line:

      Bin0 = <<0>>,                    %% 1
      │ │ │ -Bin1 = <<Bin0/binary,1,2,3>>,    %% 2
      │ │ │ -Bin2 = <<Bin1/binary,4,5,6>>,    %% 3
      │ │ │ -Bin3 = <<Bin2/binary,7,8,9>>,    %% 4
      │ │ │ -Bin4 = <<Bin1/binary,17>>,       %% 5 !!!
      │ │ │ -{Bin4,Bin3}                      %% 6
      • Line 1 (marked with the %% 1 comment), assigns a │ │ │ +line by line:

        Bin0 = <<0>>,                    %% 1
        │ │ │ +Bin1 = <<Bin0/binary,1,2,3>>,    %% 2
        │ │ │ +Bin2 = <<Bin1/binary,4,5,6>>,    %% 3
        │ │ │ +Bin3 = <<Bin2/binary,7,8,9>>,    %% 4
        │ │ │ +Bin4 = <<Bin1/binary,17>>,       %% 5 !!!
        │ │ │ +{Bin4,Bin3}                      %% 6
        • Line 1 (marked with the %% 1 comment), assigns a │ │ │ heap binary to the Bin0 variable.

        • Line 2 is an append operation. As Bin0 has not been involved in an append │ │ │ operation, a new refc binary is created and │ │ │ the contents of Bin0 is copied into it. The ProcBin part of the refc │ │ │ binary has its size set to the size of the data stored in the binary, while │ │ │ the binary object has extra space allocated. The size of the binary object is │ │ │ either twice the size of Bin1 or 256, whichever is larger. In this case it │ │ │ is 256.

        • Line 3 is more interesting. Bin1 has been used in an append operation, and │ │ │ @@ -253,23 +253,23 @@ │ │ │ handle an append operation to a heap binary by copying it to a refc binary (line │ │ │ 2), and also handle an append operation to a previous version of the binary by │ │ │ copying it (line 5). The support for doing that does not come for free. For │ │ │ example, to make it possible to know when it is necessary to copy the binary, │ │ │ for every append operation, the runtime system must create a sub binary.

          When the compiler can determine that none of those situations need to be handled │ │ │ and that the append operation cannot possibly fail, the compiler generates code │ │ │ that causes the runtime system to apply a more efficient variant of the │ │ │ -optimization.

          Example:

          -module(repack).
          │ │ │ --export([repack/1]).
          │ │ │ +optimization.

          Example:

          -module(repack).
          │ │ │ +-export([repack/1]).
          │ │ │  
          │ │ │ -repack(Bin) when is_binary(Bin) ->
          │ │ │ -    repack(Bin, <<>>).
          │ │ │ +repack(Bin) when is_binary(Bin) ->
          │ │ │ +    repack(Bin, <<>>).
          │ │ │  
          │ │ │ -repack(<<C:8,T/binary>>, Result) ->
          │ │ │ -    repack(T, <<Result/binary,C:16>>);
          │ │ │ -repack(<<>>, Result) ->
          │ │ │ +repack(<<C:8,T/binary>>, Result) ->
          │ │ │ +    repack(T, <<Result/binary,C:16>>);
          │ │ │ +repack(<<>>, Result) ->
          │ │ │      Result.

          The repack/2 function only keeps a single version of the binary, so there is │ │ │ never any need to copy the binary. The compiler rewrites the creation of the │ │ │ empty binary in repack/1 to instead create a refc binary with 256 bytes │ │ │ already reserved; thus, the append operation in repack/2 never needs to handle │ │ │ a binary not prepared for appending.

          │ │ │ │ │ │ │ │ │ @@ -281,72 +281,72 @@ │ │ │ reason is that the binary object can be moved (reallocated) during an append │ │ │ operation, and when that happens, the pointer in the ProcBin must be updated. If │ │ │ there would be more than one ProcBin pointing to the binary object, it would not │ │ │ be possible to find and update all of them.

          Therefore, certain operations on a binary mark it so that any future append │ │ │ operation will be forced to copy the binary. In most cases, the binary object │ │ │ will be shrunk at the same time to reclaim the extra space allocated for │ │ │ growing.

          When appending to a binary as follows, only the binary returned from the latest │ │ │ -append operation will support further cheap append operations:

          Bin = <<Bin0,...>>

          In the code fragment in the beginning of this section, appending to Bin will │ │ │ +append operation will support further cheap append operations:

          Bin = <<Bin0,...>>

          In the code fragment in the beginning of this section, appending to Bin will │ │ │ be cheap, while appending to Bin0 will force the creation of a new binary and │ │ │ copying of the contents of Bin0.

          If a binary is sent as a message to a process or port, the binary will be shrunk │ │ │ and any further append operation will copy the binary data into a new binary. │ │ │ For example, in the following code fragment Bin1 will be copied in the third │ │ │ -line:

          Bin1 = <<Bin0,...>>,
          │ │ │ +line:

          Bin1 = <<Bin0,...>>,
          │ │ │  PortOrPid ! Bin1,
          │ │ │ -Bin = <<Bin1,...>>  %% Bin1 will be COPIED

          The same happens if you insert a binary into an Ets table, send it to a port │ │ │ +Bin = <<Bin1,...>> %% Bin1 will be COPIED

          The same happens if you insert a binary into an Ets table, send it to a port │ │ │ using erlang:port_command/2, or pass it to │ │ │ enif_inspect_binary in a NIF.

          Matching a binary will also cause it to shrink and the next append operation │ │ │ -will copy the binary data:

          Bin1 = <<Bin0,...>>,
          │ │ │ -<<X,Y,Z,T/binary>> = Bin1,
          │ │ │ -Bin = <<Bin1,...>>  %% Bin1 will be COPIED

          The reason is that a match context contains a │ │ │ +will copy the binary data:

          Bin1 = <<Bin0,...>>,
          │ │ │ +<<X,Y,Z,T/binary>> = Bin1,
          │ │ │ +Bin = <<Bin1,...>>  %% Bin1 will be COPIED

          The reason is that a match context contains a │ │ │ direct pointer to the binary data.

          If a process simply keeps binaries (either in "loop data" or in the process │ │ │ dictionary), the garbage collector can eventually shrink the binaries. If only │ │ │ one such binary is kept, it will not be shrunk. If the process later appends to │ │ │ a binary that has been shrunk, the binary object will be reallocated to make │ │ │ place for the data to be appended.

          │ │ │ │ │ │ │ │ │ │ │ │ Matching Binaries │ │ │

          │ │ │ -

          Let us revisit the example in the beginning of the previous section:

          DO

          my_binary_to_list(<<H,T/binary>>) ->
          │ │ │ -    [H|my_binary_to_list(T)];
          │ │ │ -my_binary_to_list(<<>>) -> [].

          The first time my_binary_to_list/1 is called, a │ │ │ +

          Let us revisit the example in the beginning of the previous section:

          DO

          my_binary_to_list(<<H,T/binary>>) ->
          │ │ │ +    [H|my_binary_to_list(T)];
          │ │ │ +my_binary_to_list(<<>>) -> [].

          The first time my_binary_to_list/1 is called, a │ │ │ match context is created. The match context │ │ │ points to the first byte of the binary. 1 byte is matched out and the match │ │ │ context is updated to point to the second byte in the binary.

          At this point it would make sense to create a │ │ │ sub binary, but in this particular example the │ │ │ compiler sees that there will soon be a call to a function (in this case, to │ │ │ my_binary_to_list/1 itself) that immediately will create a new match context │ │ │ and discard the sub binary.

          Therefore my_binary_to_list/1 calls itself with the match context instead of │ │ │ with a sub binary. The instruction that initializes the matching operation │ │ │ basically does nothing when it sees that it was passed a match context instead │ │ │ of a binary.

          When the end of the binary is reached and the second clause matches, the match │ │ │ context will simply be discarded (removed in the next garbage collection, as │ │ │ there is no longer any reference to it).

          To summarize, my_binary_to_list/1 only needs to create one match context and │ │ │ no sub binaries.

          Notice that the match context in my_binary_to_list/1 was discarded when the │ │ │ entire binary had been traversed. What happens if the iteration stops before it │ │ │ -has reached the end of the binary? Will the optimization still work?

          after_zero(<<0,T/binary>>) ->
          │ │ │ +has reached the end of the binary? Will the optimization still work?

          after_zero(<<0,T/binary>>) ->
          │ │ │      T;
          │ │ │ -after_zero(<<_,T/binary>>) ->
          │ │ │ -    after_zero(T);
          │ │ │ -after_zero(<<>>) ->
          │ │ │ -    <<>>.

          Yes, it will. The compiler will remove the building of the sub binary in the │ │ │ +after_zero(<<_,T/binary>>) -> │ │ │ + after_zero(T); │ │ │ +after_zero(<<>>) -> │ │ │ + <<>>.

          Yes, it will. The compiler will remove the building of the sub binary in the │ │ │ second clause:

          ...
          │ │ │ -after_zero(<<_,T/binary>>) ->
          │ │ │ -    after_zero(T);
          │ │ │ -...

          But it will generate code that builds a sub binary in the first clause:

          after_zero(<<0,T/binary>>) ->
          │ │ │ +after_zero(<<_,T/binary>>) ->
          │ │ │ +    after_zero(T);
          │ │ │ +...

          But it will generate code that builds a sub binary in the first clause:

          after_zero(<<0,T/binary>>) ->
          │ │ │      T;
          │ │ │  ...

          Therefore, after_zero/1 builds one match context and one sub binary (assuming │ │ │ -it is passed a binary that contains a zero byte).

          Code like the following will also be optimized:

          all_but_zeroes_to_list(Buffer, Acc, 0) ->
          │ │ │ -    {lists:reverse(Acc),Buffer};
          │ │ │ -all_but_zeroes_to_list(<<0,T/binary>>, Acc, Remaining) ->
          │ │ │ -    all_but_zeroes_to_list(T, Acc, Remaining-1);
          │ │ │ -all_but_zeroes_to_list(<<Byte,T/binary>>, Acc, Remaining) ->
          │ │ │ -    all_but_zeroes_to_list(T, [Byte|Acc], Remaining-1).

          The compiler removes building of sub binaries in the second and third clauses, │ │ │ +it is passed a binary that contains a zero byte).

          Code like the following will also be optimized:

          all_but_zeroes_to_list(Buffer, Acc, 0) ->
          │ │ │ +    {lists:reverse(Acc),Buffer};
          │ │ │ +all_but_zeroes_to_list(<<0,T/binary>>, Acc, Remaining) ->
          │ │ │ +    all_but_zeroes_to_list(T, Acc, Remaining-1);
          │ │ │ +all_but_zeroes_to_list(<<Byte,T/binary>>, Acc, Remaining) ->
          │ │ │ +    all_but_zeroes_to_list(T, [Byte|Acc], Remaining-1).

          The compiler removes building of sub binaries in the second and third clauses, │ │ │ and it adds an instruction to the first clause that converts Buffer from a │ │ │ match context to a sub binary (or do nothing if Buffer is a binary already).

          But in more complicated code, how can one know whether the optimization is │ │ │ applied or not?

          │ │ │ │ │ │ │ │ │ │ │ │ Option bin_opt_info │ │ │ @@ -354,38 +354,38 @@ │ │ │

          Use the bin_opt_info option to have the compiler print a lot of information │ │ │ about binary optimizations. It can be given either to the compiler or erlc:

          erlc +bin_opt_info Mod.erl

          or passed through an environment variable:

          export ERL_COMPILER_OPTIONS=bin_opt_info

          Notice that the bin_opt_info is not meant to be a permanent option added to │ │ │ your Makefiles, because all messages that it generates cannot be eliminated. │ │ │ Therefore, passing the option through the environment is in most cases the most │ │ │ practical approach.

          The warnings look as follows:

          ./efficiency_guide.erl:60: Warning: NOT OPTIMIZED: binary is returned from the function
          │ │ │  ./efficiency_guide.erl:62: Warning: OPTIMIZED: match context reused

          To make it clearer exactly what code the warnings refer to, the warnings in the │ │ │ following examples are inserted as comments after the clause they refer to, for │ │ │ -example:

          after_zero(<<0,T/binary>>) ->
          │ │ │ +example:

          after_zero(<<0,T/binary>>) ->
          │ │ │           %% BINARY CREATED: binary is returned from the function
          │ │ │      T;
          │ │ │ -after_zero(<<_,T/binary>>) ->
          │ │ │ +after_zero(<<_,T/binary>>) ->
          │ │ │           %% OPTIMIZED: match context reused
          │ │ │ -    after_zero(T);
          │ │ │ -after_zero(<<>>) ->
          │ │ │ -    <<>>.

          The warning for the first clause says that the creation of a sub binary cannot │ │ │ + after_zero(T); │ │ │ +after_zero(<<>>) -> │ │ │ + <<>>.

          The warning for the first clause says that the creation of a sub binary cannot │ │ │ be delayed, because it will be returned. The warning for the second clause says │ │ │ that a sub binary will not be created (yet).

          │ │ │ │ │ │ │ │ │ │ │ │ Unused Variables │ │ │

          │ │ │

          The compiler figures out if a variable is unused. The same code is generated for │ │ │ -each of the following functions:

          count1(<<_,T/binary>>, Count) -> count1(T, Count+1);
          │ │ │ -count1(<<>>, Count) -> Count.
          │ │ │ +each of the following functions:

          count1(<<_,T/binary>>, Count) -> count1(T, Count+1);
          │ │ │ +count1(<<>>, Count) -> Count.
          │ │ │  
          │ │ │ -count2(<<H,T/binary>>, Count) -> count2(T, Count+1);
          │ │ │ -count2(<<>>, Count) -> Count.
          │ │ │ +count2(<<H,T/binary>>, Count) -> count2(T, Count+1);
          │ │ │ +count2(<<>>, Count) -> Count.
          │ │ │  
          │ │ │ -count3(<<_H,T/binary>>, Count) -> count3(T, Count+1);
          │ │ │ -count3(<<>>, Count) -> Count.

          In each iteration, the first 8 bits in the binary will be skipped, not matched │ │ │ +count3(<<_H,T/binary>>, Count) -> count3(T, Count+1); │ │ │ +count3(<<>>, Count) -> Count.

          In each iteration, the first 8 bits in the binary will be skipped, not matched │ │ │ out.

          │ │ │ │ │ │ │ │ │
          │ │ │
          │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Introduction │ │ │ │ │ │

          The complete specification for the bit syntax appears in the │ │ │ Reference Manual.

          In Erlang, a Bin is used for constructing binaries and matching binary patterns. │ │ │ -A Bin is written with the following syntax:

          <<E1, E2, ... En>>

          A Bin is a low-level sequence of bits or bytes. The purpose of a Bin is to │ │ │ -enable construction of binaries:

          Bin = <<E1, E2, ... En>>

          All elements must be bound. Or match a binary:

          <<E1, E2, ... En>> = Bin

          Here, Bin is bound and the elements are bound or unbound, as in any match.

          A Bin does not need to consist of a whole number of bytes.

          A bitstring is a sequence of zero or more bits, where the number of bits does │ │ │ +A Bin is written with the following syntax:

          <<E1, E2, ... En>>

          A Bin is a low-level sequence of bits or bytes. The purpose of a Bin is to │ │ │ +enable construction of binaries:

          Bin = <<E1, E2, ... En>>

          All elements must be bound. Or match a binary:

          <<E1, E2, ... En>> = Bin

          Here, Bin is bound and the elements are bound or unbound, as in any match.

          A Bin does not need to consist of a whole number of bytes.

          A bitstring is a sequence of zero or more bits, where the number of bits does │ │ │ not need to be divisible by 8. If the number of bits is divisible by 8, the │ │ │ bitstring is also a binary.

          Each element specifies a certain segment of the bitstring. A segment is a set │ │ │ of contiguous bits of the binary (not necessarily on a byte boundary). The first │ │ │ element specifies the initial segment, the second element specifies the │ │ │ following segment, and so on.

          The following examples illustrate how binaries are constructed, or matched, and │ │ │ how elements and tails are specified.

          │ │ │ │ │ │ │ │ │ │ │ │ Examples │ │ │

          │ │ │

          Example 1: A binary can be constructed from a set of constants or a string │ │ │ -literal:

          Bin11 = <<1, 17, 42>>,
          │ │ │ -Bin12 = <<"abc">>

          This gives two binaries of size 3, with the following evaluations:

          Example 2:Similarly, a binary can be constructed from a set of bound │ │ │ +literal:

          Bin11 = <<1, 17, 42>>,
          │ │ │ +Bin12 = <<"abc">>

          This gives two binaries of size 3, with the following evaluations:

          Example 2:Similarly, a binary can be constructed from a set of bound │ │ │ variables:

          A = 1, B = 17, C = 42,
          │ │ │ -Bin2 = <<A, B, C:16>>

          This gives a binary of size 4. Here, a size expression is used for the │ │ │ +Bin2 = <<A, B, C:16>>

          This gives a binary of size 4. Here, a size expression is used for the │ │ │ variable C to specify a 16-bits segment of Bin2.

          binary_to_list(Bin2) evaluates to [1, 17, 00, 42].

          Example 3: A Bin can also be used for matching. D, E, and F are unbound │ │ │ -variables, and Bin2 is bound, as in Example 2:

          <<D:16, E, F/binary>> = Bin2

          This gives D = 273, E = 00, and F binds to a binary of size 1: │ │ │ +variables, and Bin2 is bound, as in Example 2:

          <<D:16, E, F/binary>> = Bin2

          This gives D = 273, E = 00, and F binds to a binary of size 1: │ │ │ binary_to_list(F) = [42].

          Example 4: The following is a more elaborate example of matching. Here, │ │ │ Dgram is bound to the consecutive bytes of an IP datagram of IP protocol │ │ │ -version 4. The ambition is to extract the header and the data of the datagram:

          -define(IP_VERSION, 4).
          │ │ │ --define(IP_MIN_HDR_LEN, 5).
          │ │ │ +version 4. The ambition is to extract the header and the data of the datagram:

          -define(IP_VERSION, 4).
          │ │ │ +-define(IP_MIN_HDR_LEN, 5).
          │ │ │  
          │ │ │ -DgramSize = byte_size(Dgram),
          │ │ │ +DgramSize = byte_size(Dgram),
          │ │ │  case Dgram of
          │ │ │ -    <<?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16,
          │ │ │ +    <<?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16,
          │ │ │        ID:16, Flgs:3, FragOff:13,
          │ │ │        TTL:8, Proto:8, HdrChkSum:16,
          │ │ │        SrcIP:32,
          │ │ │ -      DestIP:32, RestDgram/binary>> when HLen>=5, 4*HLen=<DgramSize ->
          │ │ │ -        OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN),
          │ │ │ -        <<Opts:OptsLen/binary,Data/binary>> = RestDgram,
          │ │ │ +      DestIP:32, RestDgram/binary>> when HLen>=5, 4*HLen=<DgramSize ->
          │ │ │ +        OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN),
          │ │ │ +        <<Opts:OptsLen/binary,Data/binary>> = RestDgram,
          │ │ │      ...
          │ │ │  end.

          Here, the segment corresponding to the Opts variable has a type modifier, │ │ │ specifying that Opts is to bind to a binary. All other variables have the │ │ │ default type equal to unsigned integer.

          An IP datagram header is of variable length. This length is measured in the │ │ │ number of 32-bit words and is given in the segment corresponding to HLen. The │ │ │ minimum value of HLen is 5. It is the segment corresponding to Opts that is │ │ │ variable, so if HLen is equal to 5, Opts becomes an empty binary.

          The tail variables RestDgram and Data bind to binaries, as all tail │ │ │ @@ -218,80 +218,80 @@ │ │ │

          This section describes the rules for constructing binaries using the bit syntax. │ │ │ Unlike when constructing lists or tuples, the construction of a binary can fail │ │ │ with a badarg exception.

          There can be zero or more segments in a binary to be constructed. The expression │ │ │ <<>> constructs a zero length binary.

          Each segment in a binary can consist of zero or more bits. There are no │ │ │ alignment rules for individual segments of type integer and float. For │ │ │ binaries and bitstrings without size, the unit specifies the alignment. Since │ │ │ the default alignment for the binary type is 8, the size of a binary segment │ │ │ -must be a multiple of 8 bits, that is, only whole bytes.

          Example:

          <<Bin/binary,Bitstring/bitstring>>

          The variable Bin must contain a whole number of bytes, because the binary │ │ │ +must be a multiple of 8 bits, that is, only whole bytes.

          Example:

          <<Bin/binary,Bitstring/bitstring>>

          The variable Bin must contain a whole number of bytes, because the binary │ │ │ type defaults to unit:8. A badarg exception is generated if Bin consist │ │ │ of, for example, 17 bits.

          The Bitstring variable can consist of any number of bits, for example, 0, 1, │ │ │ 8, 11, 17, 42, and so on. This is because the default unit for bitstrings │ │ │ is 1.

          For clarity, it is recommended not to change the unit size for binaries. │ │ │ Instead, use binary when you need byte alignment and bitstring when you need │ │ │ bit alignment.

          The following example successfully constructs a bitstring of 7 bits, provided │ │ │ -that all of X and Y are integers:

          <<X:1,Y:6>>

          As mentioned earlier, segments have the following general syntax:

          Value:Size/TypeSpecifierList

          When constructing binaries, Value and Size can be any Erlang expression. │ │ │ +that all of X and Y are integers:

          <<X:1,Y:6>>

          As mentioned earlier, segments have the following general syntax:

          Value:Size/TypeSpecifierList

          When constructing binaries, Value and Size can be any Erlang expression. │ │ │ However, for syntactical reasons, both Value and Size must be enclosed in │ │ │ parenthesis if the expression consists of anything more than a single literal or │ │ │ -a variable. The following gives a compiler syntax error:

          <<X+1:8>>

          This expression must be rewritten into the following, to be accepted by the │ │ │ -compiler:

          <<(X+1):8>>

          │ │ │ +a variable. The following gives a compiler syntax error:

          <<X+1:8>>

          This expression must be rewritten into the following, to be accepted by the │ │ │ +compiler:

          <<(X+1):8>>

          │ │ │ │ │ │ │ │ │ │ │ │ Including Literal Strings │ │ │

          │ │ │ -

          A literal string can be written instead of an element:

          <<"hello">>

          This is syntactic sugar for the following:

          <<$h,$e,$l,$l,$o>>

          │ │ │ +

          A literal string can be written instead of an element:

          <<"hello">>

          This is syntactic sugar for the following:

          <<$h,$e,$l,$l,$o>>

          │ │ │ │ │ │ │ │ │ │ │ │ Matching Binaries │ │ │

          │ │ │

          This section describes the rules for matching binaries, using the bit syntax.

          There can be zero or more segments in a binary pattern. A binary pattern can │ │ │ occur wherever patterns are allowed, including inside other patterns. Binary │ │ │ patterns cannot be nested. The pattern <<>> matches a zero length binary.

          Each segment in a binary can consist of zero or more bits. A segment of type │ │ │ binary must have a size evenly divisible by 8 (or divisible by the unit size, │ │ │ if the unit size has been changed). A segment of type bitstring has no │ │ │ restrictions on the size. A segment of type float must have size 64 or 32.

          As mentioned earlier, segments have the following general syntax:

          Value:Size/TypeSpecifierList

          When matching Value, value must be either a variable or an integer, or a │ │ │ floating point literal. Expressions are not allowed.

          Size must be a │ │ │ guard expression, which can use │ │ │ -literals and previously bound variables. The following is not allowed:

          foo(N, <<X:N,T/binary>>) ->
          │ │ │ -   {X,T}.

          The two occurrences of N are not related. The compiler will complain that the │ │ │ -N in the size field is unbound.

          The correct way to write this example is as follows:

          foo(N, Bin) ->
          │ │ │ -   <<X:N,T/binary>> = Bin,
          │ │ │ -   {X,T}.

          Note

          Before OTP 23, Size was restricted to be an integer or a variable bound to │ │ │ +literals and previously bound variables. The following is not allowed:

          foo(N, <<X:N,T/binary>>) ->
          │ │ │ +   {X,T}.

          The two occurrences of N are not related. The compiler will complain that the │ │ │ +N in the size field is unbound.

          The correct way to write this example is as follows:

          foo(N, Bin) ->
          │ │ │ +   <<X:N,T/binary>> = Bin,
          │ │ │ +   {X,T}.

          Note

          Before OTP 23, Size was restricted to be an integer or a variable bound to │ │ │ an integer.

          │ │ │ │ │ │ │ │ │ │ │ │ Binding and Using a Size Variable │ │ │

          │ │ │

          There is one exception to the rule that a variable that is used as size must be │ │ │ previously bound. It is possible to match and bind a variable, and use it as a │ │ │ -size within the same binary pattern. For example:

          bar(<<Sz:8,Payload:Sz/binary-unit:8,Rest/binary>>) ->
          │ │ │ -   {Payload,Rest}.

          Here Sz is bound to the value in the first byte of the binary. Sz is then │ │ │ -used at the number of bytes to match out as a binary.

          Starting in OTP 23, the size can be a guard expression:

          bar(<<Sz:8,Payload:((Sz-1)*8)/binary,Rest/binary>>) ->
          │ │ │ -   {Payload,Rest}.

          Here Sz is the combined size of the header and the payload, so we will need to │ │ │ +size within the same binary pattern. For example:

          bar(<<Sz:8,Payload:Sz/binary-unit:8,Rest/binary>>) ->
          │ │ │ +   {Payload,Rest}.

          Here Sz is bound to the value in the first byte of the binary. Sz is then │ │ │ +used at the number of bytes to match out as a binary.

          Starting in OTP 23, the size can be a guard expression:

          bar(<<Sz:8,Payload:((Sz-1)*8)/binary,Rest/binary>>) ->
          │ │ │ +   {Payload,Rest}.

          Here Sz is the combined size of the header and the payload, so we will need to │ │ │ subtract one byte to get the size of the payload.

          │ │ │ │ │ │ │ │ │ │ │ │ Getting the Rest of the Binary or Bitstring │ │ │

          │ │ │ -

          To match out the rest of a binary, specify a binary field without size:

          foo(<<A:8,Rest/binary>>) ->

          The size of the tail must be evenly divisible by 8.

          To match out the rest of a bitstring, specify a field without size:

          foo(<<A:8,Rest/bitstring>>) ->

          There are no restrictions on the number of bits in the tail.

          │ │ │ +

          To match out the rest of a binary, specify a binary field without size:

          foo(<<A:8,Rest/binary>>) ->

          The size of the tail must be evenly divisible by 8.

          To match out the rest of a bitstring, specify a field without size:

          foo(<<A:8,Rest/bitstring>>) ->

          There are no restrictions on the number of bits in the tail.

          │ │ │ │ │ │ │ │ │ │ │ │ Appending to a Binary │ │ │

          │ │ │ -

          Appending to a binary in an efficient way can be done as follows:

          triples_to_bin(T) ->
          │ │ │ -    triples_to_bin(T, <<>>).
          │ │ │ +

          Appending to a binary in an efficient way can be done as follows:

          triples_to_bin(T) ->
          │ │ │ +    triples_to_bin(T, <<>>).
          │ │ │  
          │ │ │ -triples_to_bin([{X,Y,Z} | T], Acc) ->
          │ │ │ -    triples_to_bin(T, <<Acc/binary,X:32,Y:32,Z:32>>);
          │ │ │ -triples_to_bin([], Acc) ->
          │ │ │ +triples_to_bin([{X,Y,Z} | T], Acc) ->
          │ │ │ +    triples_to_bin(T, <<Acc/binary,X:32,Y:32,Z:32>>);
          │ │ │ +triples_to_bin([], Acc) ->
          │ │ │      Acc.
          │ │ │ │ │ │ │ │ │
          │ │ │
          │ │ │ │ │ │

          open_port/2 with │ │ │ {spawn,ExtPrg} as the first argument. The string ExtPrg is the name of the │ │ │ external program, including any command line arguments. The second argument is a │ │ │ list of options, in this case only {packet,2}. This option says that a 2 byte │ │ │ length indicator is to be used to simplify the communication between C and │ │ │ Erlang. The Erlang port automatically adds the length indicator, but this must │ │ │ be done explicitly in the external C program.

          The process is also set to trap exits, which enables detection of failure of the │ │ │ -external program:

          -module(complex1).
          │ │ │ --export([start/1, init/1]).
          │ │ │ +external program:

          -module(complex1).
          │ │ │ +-export([start/1, init/1]).
          │ │ │  
          │ │ │ -start(ExtPrg) ->
          │ │ │ -  spawn(?MODULE, init, [ExtPrg]).
          │ │ │ +start(ExtPrg) ->
          │ │ │ +  spawn(?MODULE, init, [ExtPrg]).
          │ │ │  
          │ │ │ -init(ExtPrg) ->
          │ │ │ -  register(complex, self()),
          │ │ │ -  process_flag(trap_exit, true),
          │ │ │ -  Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
          │ │ │ -  loop(Port).

          Now complex1:foo/1 and complex1:bar/1 can be implemented. Both send a │ │ │ -message to the complex process and receive the following replies:

          foo(X) ->
          │ │ │ -  call_port({foo, X}).
          │ │ │ -bar(Y) ->
          │ │ │ -  call_port({bar, Y}).
          │ │ │ +init(ExtPrg) ->
          │ │ │ +  register(complex, self()),
          │ │ │ +  process_flag(trap_exit, true),
          │ │ │ +  Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
          │ │ │ +  loop(Port).

          Now complex1:foo/1 and complex1:bar/1 can be implemented. Both send a │ │ │ +message to the complex process and receive the following replies:

          foo(X) ->
          │ │ │ +  call_port({foo, X}).
          │ │ │ +bar(Y) ->
          │ │ │ +  call_port({bar, Y}).
          │ │ │  
          │ │ │ -call_port(Msg) ->
          │ │ │ -  complex ! {call, self(), Msg},
          │ │ │ +call_port(Msg) ->
          │ │ │ +  complex ! {call, self(), Msg},
          │ │ │    receive
          │ │ │ -    {complex, Result} ->
          │ │ │ +    {complex, Result} ->
          │ │ │        Result
          │ │ │ -  end.

          The complex process does the following:

          • Encodes the message into a sequence of bytes.
          • Sends it to the port.
          • Waits for a reply.
          • Decodes the reply.
          • Sends it back to the caller:
          loop(Port) ->
          │ │ │ +  end.

          The complex process does the following:

          • Encodes the message into a sequence of bytes.
          • Sends it to the port.
          • Waits for a reply.
          • Decodes the reply.
          • Sends it back to the caller:
          loop(Port) ->
          │ │ │    receive
          │ │ │ -    {call, Caller, Msg} ->
          │ │ │ -      Port ! {self(), {command, encode(Msg)}},
          │ │ │ +    {call, Caller, Msg} ->
          │ │ │ +      Port ! {self(), {command, encode(Msg)}},
          │ │ │        receive
          │ │ │ -        {Port, {data, Data}} ->
          │ │ │ -          Caller ! {complex, decode(Data)}
          │ │ │ +        {Port, {data, Data}} ->
          │ │ │ +          Caller ! {complex, decode(Data)}
          │ │ │        end,
          │ │ │ -      loop(Port)
          │ │ │ +      loop(Port)
          │ │ │    end.

          Assuming that both the arguments and the results from the C functions are less │ │ │ than 256, a simple encoding/decoding scheme is employed. In this scheme, foo │ │ │ is represented by byte 1, bar is represented by 2, and the argument/result is │ │ │ -represented by a single byte as well:

          encode({foo, X}) -> [1, X];
          │ │ │ -encode({bar, Y}) -> [2, Y].
          │ │ │ +represented by a single byte as well:

          encode({foo, X}) -> [1, X];
          │ │ │ +encode({bar, Y}) -> [2, Y].
          │ │ │  
          │ │ │ -decode([Int]) -> Int.

          The resulting Erlang program, including functionality for stopping the port and │ │ │ -detecting port failures, is as follows:

          -module(complex1).
          │ │ │ --export([start/1, stop/0, init/1]).
          │ │ │ --export([foo/1, bar/1]).
          │ │ │ -
          │ │ │ -start(ExtPrg) ->
          │ │ │ -    spawn(?MODULE, init, [ExtPrg]).
          │ │ │ -stop() ->
          │ │ │ +decode([Int]) -> Int.

          The resulting Erlang program, including functionality for stopping the port and │ │ │ +detecting port failures, is as follows:

          -module(complex1).
          │ │ │ +-export([start/1, stop/0, init/1]).
          │ │ │ +-export([foo/1, bar/1]).
          │ │ │ +
          │ │ │ +start(ExtPrg) ->
          │ │ │ +    spawn(?MODULE, init, [ExtPrg]).
          │ │ │ +stop() ->
          │ │ │      complex ! stop.
          │ │ │  
          │ │ │ -foo(X) ->
          │ │ │ -    call_port({foo, X}).
          │ │ │ -bar(Y) ->
          │ │ │ -    call_port({bar, Y}).
          │ │ │ +foo(X) ->
          │ │ │ +    call_port({foo, X}).
          │ │ │ +bar(Y) ->
          │ │ │ +    call_port({bar, Y}).
          │ │ │  
          │ │ │ -call_port(Msg) ->
          │ │ │ -    complex ! {call, self(), Msg},
          │ │ │ +call_port(Msg) ->
          │ │ │ +    complex ! {call, self(), Msg},
          │ │ │      receive
          │ │ │ -	{complex, Result} ->
          │ │ │ +	{complex, Result} ->
          │ │ │  	    Result
          │ │ │      end.
          │ │ │  
          │ │ │ -init(ExtPrg) ->
          │ │ │ -    register(complex, self()),
          │ │ │ -    process_flag(trap_exit, true),
          │ │ │ -    Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
          │ │ │ -    loop(Port).
          │ │ │ +init(ExtPrg) ->
          │ │ │ +    register(complex, self()),
          │ │ │ +    process_flag(trap_exit, true),
          │ │ │ +    Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
          │ │ │ +    loop(Port).
          │ │ │  
          │ │ │ -loop(Port) ->
          │ │ │ +loop(Port) ->
          │ │ │      receive
          │ │ │ -	{call, Caller, Msg} ->
          │ │ │ -	    Port ! {self(), {command, encode(Msg)}},
          │ │ │ +	{call, Caller, Msg} ->
          │ │ │ +	    Port ! {self(), {command, encode(Msg)}},
          │ │ │  	    receive
          │ │ │ -		{Port, {data, Data}} ->
          │ │ │ -		    Caller ! {complex, decode(Data)}
          │ │ │ +		{Port, {data, Data}} ->
          │ │ │ +		    Caller ! {complex, decode(Data)}
          │ │ │  	    end,
          │ │ │ -	    loop(Port);
          │ │ │ +	    loop(Port);
          │ │ │  	stop ->
          │ │ │ -	    Port ! {self(), close},
          │ │ │ +	    Port ! {self(), close},
          │ │ │  	    receive
          │ │ │ -		{Port, closed} ->
          │ │ │ -		    exit(normal)
          │ │ │ +		{Port, closed} ->
          │ │ │ +		    exit(normal)
          │ │ │  	    end;
          │ │ │ -	{'EXIT', Port, Reason} ->
          │ │ │ -	    exit(port_terminated)
          │ │ │ +	{'EXIT', Port, Reason} ->
          │ │ │ +	    exit(port_terminated)
          │ │ │      end.
          │ │ │  
          │ │ │ -encode({foo, X}) -> [1, X];
          │ │ │ -encode({bar, Y}) -> [2, Y].
          │ │ │ +encode({foo, X}) -> [1, X];
          │ │ │ +encode({bar, Y}) -> [2, Y].
          │ │ │  
          │ │ │ -decode([Int]) -> Int.

          │ │ │ +decode([Int]) -> Int.

          │ │ │ │ │ │ │ │ │ │ │ │ C Program │ │ │

          │ │ │

          On the C side, it is necessary to write functions for receiving and sending data │ │ │ with 2 byte length indicators from/to Erlang. By default, the C program is to │ │ │ @@ -333,25 +333,25 @@ │ │ │ and terminates.

          │ │ │ │ │ │ │ │ │ │ │ │ Running the Example │ │ │

          │ │ │

          Step 1. Compile the C code:

          $ gcc -o extprg complex.c erl_comm.c port.c

          Step 2. Start Erlang and compile the Erlang code:

          $ erl
          │ │ │ -Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
          │ │ │ +Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
          │ │ │  
          │ │ │ -Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
          │ │ │ -1> c(complex1).
          │ │ │ -{ok,complex1}

          Step 3. Run the example:

          2> complex1:start("./extprg").
          │ │ │ +Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
          │ │ │ +1> c(complex1).
          │ │ │ +{ok,complex1}

          Step 3. Run the example:

          2> complex1:start("./extprg").
          │ │ │  <0.34.0>
          │ │ │ -3> complex1:foo(3).
          │ │ │ +3> complex1:foo(3).
          │ │ │  4
          │ │ │ -4> complex1:bar(5).
          │ │ │ +4> complex1:bar(5).
          │ │ │  10
          │ │ │ -5> complex1:stop().
          │ │ │ +5> complex1:stop().
          │ │ │  stop
          │ │ │
          │ │ │ │ │ │
          │ │ │
          │ │ │ │ │ │

          erl_ddll:load_driver/2, with the name of the shared library as │ │ │ argument.

          The port is then created using the BIF open_port/2, with the │ │ │ tuple {spawn, DriverName} as the first argument. The string SharedLib is the │ │ │ name of the port driver. The second argument is a list of options, none in this │ │ │ -case:

          -module(complex5).
          │ │ │ --export([start/1, init/1]).
          │ │ │ +case:

          -module(complex5).
          │ │ │ +-export([start/1, init/1]).
          │ │ │  
          │ │ │ -start(SharedLib) ->
          │ │ │ -    case erl_ddll:load_driver(".", SharedLib) of
          │ │ │ +start(SharedLib) ->
          │ │ │ +    case erl_ddll:load_driver(".", SharedLib) of
          │ │ │          ok -> ok;
          │ │ │ -        {error, already_loaded} -> ok;
          │ │ │ -        _ -> exit({error, could_not_load_driver})
          │ │ │ +        {error, already_loaded} -> ok;
          │ │ │ +        _ -> exit({error, could_not_load_driver})
          │ │ │      end,
          │ │ │ -    spawn(?MODULE, init, [SharedLib]).
          │ │ │ +    spawn(?MODULE, init, [SharedLib]).
          │ │ │  
          │ │ │ -init(SharedLib) ->
          │ │ │ -  register(complex, self()),
          │ │ │ -  Port = open_port({spawn, SharedLib}, []),
          │ │ │ -  loop(Port).

          Now complex5:foo/1 and complex5:bar/1 can be implemented. Both send a │ │ │ -message to the complex process and receive the following reply:

          foo(X) ->
          │ │ │ -    call_port({foo, X}).
          │ │ │ -bar(Y) ->
          │ │ │ -    call_port({bar, Y}).
          │ │ │ +init(SharedLib) ->
          │ │ │ +  register(complex, self()),
          │ │ │ +  Port = open_port({spawn, SharedLib}, []),
          │ │ │ +  loop(Port).

          Now complex5:foo/1 and complex5:bar/1 can be implemented. Both send a │ │ │ +message to the complex process and receive the following reply:

          foo(X) ->
          │ │ │ +    call_port({foo, X}).
          │ │ │ +bar(Y) ->
          │ │ │ +    call_port({bar, Y}).
          │ │ │  
          │ │ │ -call_port(Msg) ->
          │ │ │ -    complex ! {call, self(), Msg},
          │ │ │ +call_port(Msg) ->
          │ │ │ +    complex ! {call, self(), Msg},
          │ │ │      receive
          │ │ │ -        {complex, Result} ->
          │ │ │ +        {complex, Result} ->
          │ │ │              Result
          │ │ │ -    end.

          The complex process performs the following:

          • Encodes the message into a sequence of bytes.
          • Sends it to the port.
          • Waits for a reply.
          • Decodes the reply.
          • Sends it back to the caller:
          loop(Port) ->
          │ │ │ +    end.

          The complex process performs the following:

          • Encodes the message into a sequence of bytes.
          • Sends it to the port.
          • Waits for a reply.
          • Decodes the reply.
          • Sends it back to the caller:
          loop(Port) ->
          │ │ │      receive
          │ │ │ -        {call, Caller, Msg} ->
          │ │ │ -            Port ! {self(), {command, encode(Msg)}},
          │ │ │ +        {call, Caller, Msg} ->
          │ │ │ +            Port ! {self(), {command, encode(Msg)}},
          │ │ │              receive
          │ │ │ -                {Port, {data, Data}} ->
          │ │ │ -                    Caller ! {complex, decode(Data)}
          │ │ │ +                {Port, {data, Data}} ->
          │ │ │ +                    Caller ! {complex, decode(Data)}
          │ │ │              end,
          │ │ │ -            loop(Port)
          │ │ │ +            loop(Port)
          │ │ │      end.

          Assuming that both the arguments and the results from the C functions are less │ │ │ than 256, a simple encoding/decoding scheme is employed. In this scheme, foo │ │ │ is represented by byte 1, bar is represented by 2, and the argument/result is │ │ │ -represented by a single byte as well:

          encode({foo, X}) -> [1, X];
          │ │ │ -encode({bar, Y}) -> [2, Y].
          │ │ │ +represented by a single byte as well:

          encode({foo, X}) -> [1, X];
          │ │ │ +encode({bar, Y}) -> [2, Y].
          │ │ │  
          │ │ │ -decode([Int]) -> Int.

          The resulting Erlang program, including functions for stopping the port and │ │ │ +decode([Int]) -> Int.

          The resulting Erlang program, including functions for stopping the port and │ │ │ detecting port failures, is as follows:

          
          │ │ │ --module(complex5).
          │ │ │ --export([start/1, stop/0, init/1]).
          │ │ │ --export([foo/1, bar/1]).
          │ │ │ +-module(complex5).
          │ │ │ +-export([start/1, stop/0, init/1]).
          │ │ │ +-export([foo/1, bar/1]).
          │ │ │  
          │ │ │ -start(SharedLib) ->
          │ │ │ -    case erl_ddll:load_driver(".", SharedLib) of
          │ │ │ +start(SharedLib) ->
          │ │ │ +    case erl_ddll:load_driver(".", SharedLib) of
          │ │ │  	ok -> ok;
          │ │ │ -	{error, already_loaded} -> ok;
          │ │ │ -	_ -> exit({error, could_not_load_driver})
          │ │ │ +	{error, already_loaded} -> ok;
          │ │ │ +	_ -> exit({error, could_not_load_driver})
          │ │ │      end,
          │ │ │ -    spawn(?MODULE, init, [SharedLib]).
          │ │ │ +    spawn(?MODULE, init, [SharedLib]).
          │ │ │  
          │ │ │ -init(SharedLib) ->
          │ │ │ -    register(complex, self()),
          │ │ │ -    Port = open_port({spawn, SharedLib}, []),
          │ │ │ -    loop(Port).
          │ │ │ +init(SharedLib) ->
          │ │ │ +    register(complex, self()),
          │ │ │ +    Port = open_port({spawn, SharedLib}, []),
          │ │ │ +    loop(Port).
          │ │ │  
          │ │ │ -stop() ->
          │ │ │ +stop() ->
          │ │ │      complex ! stop.
          │ │ │  
          │ │ │ -foo(X) ->
          │ │ │ -    call_port({foo, X}).
          │ │ │ -bar(Y) ->
          │ │ │ -    call_port({bar, Y}).
          │ │ │ +foo(X) ->
          │ │ │ +    call_port({foo, X}).
          │ │ │ +bar(Y) ->
          │ │ │ +    call_port({bar, Y}).
          │ │ │  
          │ │ │ -call_port(Msg) ->
          │ │ │ -    complex ! {call, self(), Msg},
          │ │ │ +call_port(Msg) ->
          │ │ │ +    complex ! {call, self(), Msg},
          │ │ │      receive
          │ │ │ -	{complex, Result} ->
          │ │ │ +	{complex, Result} ->
          │ │ │  	    Result
          │ │ │      end.
          │ │ │  
          │ │ │ -loop(Port) ->
          │ │ │ +loop(Port) ->
          │ │ │      receive
          │ │ │ -	{call, Caller, Msg} ->
          │ │ │ -	    Port ! {self(), {command, encode(Msg)}},
          │ │ │ +	{call, Caller, Msg} ->
          │ │ │ +	    Port ! {self(), {command, encode(Msg)}},
          │ │ │  	    receive
          │ │ │ -		{Port, {data, Data}} ->
          │ │ │ -		    Caller ! {complex, decode(Data)}
          │ │ │ +		{Port, {data, Data}} ->
          │ │ │ +		    Caller ! {complex, decode(Data)}
          │ │ │  	    end,
          │ │ │ -	    loop(Port);
          │ │ │ +	    loop(Port);
          │ │ │  	stop ->
          │ │ │ -	    Port ! {self(), close},
          │ │ │ +	    Port ! {self(), close},
          │ │ │  	    receive
          │ │ │ -		{Port, closed} ->
          │ │ │ -		    exit(normal)
          │ │ │ +		{Port, closed} ->
          │ │ │ +		    exit(normal)
          │ │ │  	    end;
          │ │ │ -	{'EXIT', Port, Reason} ->
          │ │ │ -	    io:format("~p ~n", [Reason]),
          │ │ │ -	    exit(port_terminated)
          │ │ │ +	{'EXIT', Port, Reason} ->
          │ │ │ +	    io:format("~p ~n", [Reason]),
          │ │ │ +	    exit(port_terminated)
          │ │ │      end.
          │ │ │  
          │ │ │ -encode({foo, X}) -> [1, X];
          │ │ │ -encode({bar, Y}) -> [2, Y].
          │ │ │ +encode({foo, X}) -> [1, X];
          │ │ │ +encode({bar, Y}) -> [2, Y].
          │ │ │  
          │ │ │ -decode([Int]) -> Int.

          │ │ │ +decode([Int]) -> Int.

          │ │ │ │ │ │ │ │ │ │ │ │ C Driver │ │ │

          │ │ │

          The C driver is a module that is compiled and linked into a shared library. It │ │ │ uses a driver structure and includes the header file erl_driver.h.

          The driver structure is filled with the driver name and function pointers. It is │ │ │ @@ -347,25 +347,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ Running the Example │ │ │ │ │ │

          Step 1. Compile the C code:

          unix> gcc -o example_drv.so -fpic -shared complex.c port_driver.c
          │ │ │  windows> cl -LD -MD -Fe example_drv.dll complex.c port_driver.c

          Step 2. Start Erlang and compile the Erlang code:

          > erl
          │ │ │ -Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
          │ │ │ +Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
          │ │ │  
          │ │ │ -Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
          │ │ │ -1> c(complex5).
          │ │ │ -{ok,complex5}

          Step 3. Run the example:

          2> complex5:start("example_drv").
          │ │ │ +Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
          │ │ │ +1> c(complex5).
          │ │ │ +{ok,complex5}

          Step 3. Run the example:

          2> complex5:start("example_drv").
          │ │ │  <0.34.0>
          │ │ │ -3> complex5:foo(3).
          │ │ │ +3> complex5:foo(3).
          │ │ │  4
          │ │ │ -4> complex5:bar(5).
          │ │ │ +4> complex5:bar(5).
          │ │ │  10
          │ │ │ -5> complex5:stop().
          │ │ │ +5> complex5:stop().
          │ │ │  stop
          │ │ │
          │ │ │ │ │ │
          │ │ │
          │ │ │ │ │ │ │ │ │ Compilation │ │ │ │ │ │

          Erlang programs must be compiled to object code. The compiler can generate a │ │ │ new file that contains the object code. The current abstract machine, which runs │ │ │ the object code, is called BEAM, therefore the object files get the suffix │ │ │ -.beam. The compiler can also generate a binary which can be loaded directly.

          The compiler is located in the module compile in Compiler.

          compile:file(Module)
          │ │ │ -compile:file(Module, Options)

          The Erlang shell understands the command c(Module), which both compiles and │ │ │ +.beam. The compiler can also generate a binary which can be loaded directly.

          The compiler is located in the module compile in Compiler.

          compile:file(Module)
          │ │ │ +compile:file(Module, Options)

          The Erlang shell understands the command c(Module), which both compiles and │ │ │ loads Module.

          There is also a module make, which provides a set of functions similar to the │ │ │ UNIX type Make functions, see module make in Tools.

          The compiler can also be accessed from the OS prompt using the │ │ │ erl executable in ERTS.

          % erl -compile Module1...ModuleN
          │ │ │  % erl -make

          The erlc program provides way to compile modules from the OS │ │ │ shell, see the erlc executable in ERTS. It │ │ │ understands a number of flags that can be used to define macros, add search │ │ │ paths for include files, and more.

          % erlc <flags> File1.erl...FileN.erl

          │ │ │ @@ -156,54 +156,54 @@ │ │ │ When a module is loaded into the system for the first time, the code becomes │ │ │ 'current'. If then a new instance of the module is loaded, the code of the │ │ │ previous instance becomes 'old' and the new instance becomes 'current'.

          Both old and current code is valid, and can be evaluated concurrently. Fully │ │ │ qualified function calls always refer to current code. Old code can still be │ │ │ evaluated because of processes lingering in the old code.

          If a third instance of the module is loaded, the code server removes (purges) │ │ │ the old code and any processes lingering in it is terminated. Then the third │ │ │ instance becomes 'current' and the previously current code becomes 'old'.

          To change from old code to current code, a process must make a fully qualified │ │ │ -function call.

          Example:

          -module(m).
          │ │ │ --export([loop/0]).
          │ │ │ +function call.

          Example:

          -module(m).
          │ │ │ +-export([loop/0]).
          │ │ │  
          │ │ │ -loop() ->
          │ │ │ +loop() ->
          │ │ │      receive
          │ │ │          code_switch ->
          │ │ │ -            m:loop();
          │ │ │ +            m:loop();
          │ │ │          Msg ->
          │ │ │              ...
          │ │ │ -            loop()
          │ │ │ +            loop()
          │ │ │      end.

          To make the process change code, send the message code_switch to it. The │ │ │ process then makes a fully qualified call to m:loop() and changes to current │ │ │ code. Notice that m:loop/0 must be exported.

          For code replacement of funs to work, use the syntax │ │ │ fun Module:FunctionName/Arity.

          │ │ │ │ │ │ │ │ │ │ │ │ Running a Function When a Module is Loaded │ │ │

          │ │ │

          The -on_load() directive names a function that is to be run automatically when │ │ │ -a module is loaded.

          Its syntax is as follows:

          -on_load(Name/0).

          It is not necessary to export the function. It is called in a freshly spawned │ │ │ +a module is loaded.

          Its syntax is as follows:

          -on_load(Name/0).

          It is not necessary to export the function. It is called in a freshly spawned │ │ │ process (which terminates as soon as the function returns).

          The function must return ok if the module is to become the new current code │ │ │ for the module and become callable.

          Returning any other value or generating an exception causes the new code to be │ │ │ unloaded. If the return value is not an atom, a warning error report is sent to │ │ │ the error logger.

          If there already is current code for the module, that code will remain current │ │ │ and can be called until the on_load function has returned. If the on_load │ │ │ function fails, the current code (if any) will remain current. If there is no │ │ │ current code for a module, any process that makes an external call to the module │ │ │ before the on_load function has finished will be suspended until the on_load │ │ │ function have finished.

          Change

          Before Erlang/OTP 19, if the on_load function failed, any previously current │ │ │ code would become old, essentially leaving the system without any working and │ │ │ reachable instance of the module.

          In embedded mode, first all modules are loaded. Then all on_load functions are │ │ │ called. The system is terminated unless all of the on_load functions return │ │ │ -ok.

          Example:

          -module(m).
          │ │ │ --on_load(load_my_nifs/0).
          │ │ │ +ok.

          Example:

          -module(m).
          │ │ │ +-on_load(load_my_nifs/0).
          │ │ │  
          │ │ │ -load_my_nifs() ->
          │ │ │ +load_my_nifs() ->
          │ │ │      NifPath = ...,    %Set up the path to the NIF library.
          │ │ │      Info = ...,       %Initialize the Info term
          │ │ │ -    erlang:load_nif(NifPath, Info).

          If the call to erlang:load_nif/2 fails, the module is unloaded and a warning │ │ │ + erlang:load_nif(NifPath, Info).

          If the call to erlang:load_nif/2 fails, the module is unloaded and a warning │ │ │ report is sent to the error loader.

          │ │ │

          │ │ │ │ │ │
          │ │ │
          │ │ │ │ │ │

          │ │ │ │ │ │ │ │ │ Operator ++ │ │ │

          │ │ │

          The ++ operator copies its left-hand side operand. That is clearly │ │ │ -seen if we do our own implementation in Erlang:

          my_plus_plus([H|T], Tail) ->
          │ │ │ -    [H|my_plus_plus(T, Tail)];
          │ │ │ -my_plus_plus([], Tail) ->
          │ │ │ -    Tail.

          We must be careful how we use ++ in a loop. First is how not to use it:

          DO NOT

          naive_reverse([H|T]) ->
          │ │ │ -    naive_reverse(T) ++ [H];
          │ │ │ -naive_reverse([]) ->
          │ │ │ -    [].

          As the ++ operator copies its left-hand side operand, the growing │ │ │ -result is copied repeatedly, leading to quadratic complexity.

          On the other hand, using ++ in loop like this is perfectly fine:

          OK

          naive_but_ok_reverse(List) ->
          │ │ │ -    naive_but_ok_reverse(List, []).
          │ │ │ +seen if we do our own implementation in Erlang:

          my_plus_plus([H|T], Tail) ->
          │ │ │ +    [H|my_plus_plus(T, Tail)];
          │ │ │ +my_plus_plus([], Tail) ->
          │ │ │ +    Tail.

          We must be careful how we use ++ in a loop. First is how not to use it:

          DO NOT

          naive_reverse([H|T]) ->
          │ │ │ +    naive_reverse(T) ++ [H];
          │ │ │ +naive_reverse([]) ->
          │ │ │ +    [].

          As the ++ operator copies its left-hand side operand, the growing │ │ │ +result is copied repeatedly, leading to quadratic complexity.

          On the other hand, using ++ in loop like this is perfectly fine:

          OK

          naive_but_ok_reverse(List) ->
          │ │ │ +    naive_but_ok_reverse(List, []).
          │ │ │  
          │ │ │ -naive_but_ok_reverse([H|T], Acc) ->
          │ │ │ -    naive_but_ok_reverse(T, [H] ++ Acc);
          │ │ │ -naive_but_ok_reverse([], Acc) ->
          │ │ │ +naive_but_ok_reverse([H|T], Acc) ->
          │ │ │ +    naive_but_ok_reverse(T, [H] ++ Acc);
          │ │ │ +naive_but_ok_reverse([], Acc) ->
          │ │ │      Acc.

          Each list element is copied only once. The growing result Acc is the right-hand │ │ │ -side operand, which it is not copied.

          Experienced Erlang programmers would probably write as follows:

          DO

          vanilla_reverse([H|T], Acc) ->
          │ │ │ -    vanilla_reverse(T, [H|Acc]);
          │ │ │ -vanilla_reverse([], Acc) ->
          │ │ │ +side operand, which it is not copied.

          Experienced Erlang programmers would probably write as follows:

          DO

          vanilla_reverse([H|T], Acc) ->
          │ │ │ +    vanilla_reverse(T, [H|Acc]);
          │ │ │ +vanilla_reverse([], Acc) ->
          │ │ │      Acc.

          In principle, this is slightly more efficient because the list element [H] │ │ │ is not built before being copied and discarded. In practice, the compiler │ │ │ rewrites [H] ++ Acc to [H|Acc].

          │ │ │ │ │ │ │ │ │ │ │ │ Timer Module │ │ │ @@ -160,77 +160,77 @@ │ │ │ therefore harmless.

          │ │ │ │ │ │ │ │ │ │ │ │ Accidental Copying and Loss of Sharing │ │ │

          │ │ │

          When spawning a new process using a fun, one can accidentally copy more data to │ │ │ -the process than intended. For example:

          DO NOT

          accidental1(State) ->
          │ │ │ -    spawn(fun() ->
          │ │ │ -                  io:format("~p\n", [State#state.info])
          │ │ │ -          end).

          The code in the fun will extract one element from the record and print it. The │ │ │ +the process than intended. For example:

          DO NOT

          accidental1(State) ->
          │ │ │ +    spawn(fun() ->
          │ │ │ +                  io:format("~p\n", [State#state.info])
          │ │ │ +          end).

          The code in the fun will extract one element from the record and print it. The │ │ │ rest of the state record is not used. However, when the spawn/1 │ │ │ -function is executed, the entire record is copied to the newly created process.

          The same kind of problem can happen with a map:

          DO NOT

          accidental2(State) ->
          │ │ │ -    spawn(fun() ->
          │ │ │ -                  io:format("~p\n", [map_get(info, State)])
          │ │ │ -          end).

          In the following example (part of a module implementing the gen_server │ │ │ -behavior) the created fun is sent to another process:

          DO NOT

          handle_call(give_me_a_fun, _From, State) ->
          │ │ │ -    Fun = fun() -> State#state.size =:= 42 end,
          │ │ │ -    {reply, Fun, State}.

          How bad that unnecessary copy is depends on the contents of the record or the │ │ │ -map.

          For example, if the state record is initialized like this:

          init1() ->
          │ │ │ -    #state{data=lists:seq(1, 10000)}.

          a list with 10000 elements (or about 20000 heap words) will be copied to the │ │ │ +function is executed, the entire record is copied to the newly created process.

          The same kind of problem can happen with a map:

          DO NOT

          accidental2(State) ->
          │ │ │ +    spawn(fun() ->
          │ │ │ +                  io:format("~p\n", [map_get(info, State)])
          │ │ │ +          end).

          In the following example (part of a module implementing the gen_server │ │ │ +behavior) the created fun is sent to another process:

          DO NOT

          handle_call(give_me_a_fun, _From, State) ->
          │ │ │ +    Fun = fun() -> State#state.size =:= 42 end,
          │ │ │ +    {reply, Fun, State}.

          How bad that unnecessary copy is depends on the contents of the record or the │ │ │ +map.

          For example, if the state record is initialized like this:

          init1() ->
          │ │ │ +    #state{data=lists:seq(1, 10000)}.

          a list with 10000 elements (or about 20000 heap words) will be copied to the │ │ │ newly created process.

          An unnecessary copy of 10000 element list can be bad enough, but it can get even │ │ │ worse if the state record contains shared subterms. Here is a simple example │ │ │ -of a term with a shared subterm:

          {SubTerm, SubTerm}

          When a term is copied to another process, sharing of subterms will be lost and │ │ │ -the copied term can be many times larger than the original term. For example:

          init2() ->
          │ │ │ -    SharedSubTerms = lists:foldl(fun(_, A) -> [A|A] end, [0], lists:seq(1, 15)),
          │ │ │ -    #state{data=Shared}.

          In the process that calls init2/0, the size of the data field in the state │ │ │ +of a term with a shared subterm:

          {SubTerm, SubTerm}

          When a term is copied to another process, sharing of subterms will be lost and │ │ │ +the copied term can be many times larger than the original term. For example:

          init2() ->
          │ │ │ +    SharedSubTerms = lists:foldl(fun(_, A) -> [A|A] end, [0], lists:seq(1, 15)),
          │ │ │ +    #state{data=Shared}.

          In the process that calls init2/0, the size of the data field in the state │ │ │ record will be 32 heap words. When the record is copied to the newly created │ │ │ process, sharing will be lost and the size of the copied data field will be │ │ │ 131070 heap words. More details about │ │ │ loss off sharing are found in a later │ │ │ section.

          To avoid the problem, outside of the fun extract only the fields of the record │ │ │ -that are actually used:

          DO

          fixed_accidental1(State) ->
          │ │ │ +that are actually used:

          DO

          fixed_accidental1(State) ->
          │ │ │      Info = State#state.info,
          │ │ │ -    spawn(fun() ->
          │ │ │ -                  io:format("~p\n", [Info])
          │ │ │ -          end).

          Similarly, outside of the fun extract only the map elements that are actually │ │ │ -used:

          DO

          fixed_accidental2(State) ->
          │ │ │ -    Info = map_get(info, State),
          │ │ │ -    spawn(fun() ->
          │ │ │ -                  io:format("~p\n", [Info])
          │ │ │ -          end).

          │ │ │ + spawn(fun() -> │ │ │ + io:format("~p\n", [Info]) │ │ │ + end).

          Similarly, outside of the fun extract only the map elements that are actually │ │ │ +used:

          DO

          fixed_accidental2(State) ->
          │ │ │ +    Info = map_get(info, State),
          │ │ │ +    spawn(fun() ->
          │ │ │ +                  io:format("~p\n", [Info])
          │ │ │ +          end).

          │ │ │ │ │ │ │ │ │ │ │ │ list_to_atom/1 │ │ │

          │ │ │

          Atoms are not garbage-collected. Once an atom is created, it is never removed. │ │ │ The emulator terminates if the limit for the number of atoms (1,048,576 by │ │ │ default) is reached.

          Therefore, converting arbitrary input strings to atoms can be dangerous in a │ │ │ system that runs continuously. If only certain well-defined atoms are allowed as │ │ │ input, list_to_existing_atom/1 or │ │ │ binary_to_existing_atom/1 can be used │ │ │ to guard against a denial-of-service attack. (All atoms that are allowed must │ │ │ have been created earlier, for example, by using all of them in a module │ │ │ and loading that module.)

          Using list_to_atom/1 to construct an atom that │ │ │ -is passed to apply/3 is quite expensive.

          DO NOT

          apply(list_to_atom("some_prefix"++Var), foo, Args)

          │ │ │ +is passed to apply/3 is quite expensive.

          DO NOT

          apply(list_to_atom("some_prefix"++Var), foo, Args)

          │ │ │ │ │ │ │ │ │ │ │ │ length/1 │ │ │

          │ │ │

          The time for calculating the length of a list is proportional to the length of │ │ │ the list, as opposed to tuple_size/1, │ │ │ byte_size/1, and bit_size/1, which all │ │ │ execute in constant time.

          Normally, there is no need to worry about the speed of length/1, │ │ │ because it is efficiently implemented in C. In time-critical code, you might │ │ │ want to avoid it if the input list could potentially be very long.

          Some uses of length/1 can be replaced by matching. For example, │ │ │ -the following code:

          foo(L) when length(L) >= 3 ->
          │ │ │ -    ...

          can be rewritten to:

          foo([_,_,_|_]=L) ->
          │ │ │ +the following code:

          foo(L) when length(L) >= 3 ->
          │ │ │ +    ...

          can be rewritten to:

          foo([_,_,_|_]=L) ->
          │ │ │     ...

          One slight difference is that length(L) fails if L is an │ │ │ improper list, while the pattern in the second code fragment accepts an improper │ │ │ list.

          │ │ │ │ │ │ │ │ │ │ │ │ setelement/3 │ │ │ @@ -238,18 +238,18 @@ │ │ │

          setelement/3 copies the tuple it modifies. Therefore, │ │ │ updating a tuple in a loop using setelement/3 creates a new │ │ │ copy of the tuple every time.

          There is one exception to the rule that the tuple is copied. If the compiler │ │ │ clearly can see that destructively updating the tuple would give the same result │ │ │ as if the tuple was copied, the call to setelement/3 is │ │ │ replaced with a special destructive setelement instruction. In the following │ │ │ code sequence, the first setelement/3 call copies the tuple │ │ │ -and modifies the ninth element:

          multiple_setelement(T0) when tuple_size(T0) =:= 9 ->
          │ │ │ -    T1 = setelement(9, T0, bar),
          │ │ │ -    T2 = setelement(7, T1, foobar),
          │ │ │ -    setelement(5, T2, new_value).

          The two following setelement/3 calls modify the tuple in │ │ │ +and modifies the ninth element:

          multiple_setelement(T0) when tuple_size(T0) =:= 9 ->
          │ │ │ +    T1 = setelement(9, T0, bar),
          │ │ │ +    T2 = setelement(7, T1, foobar),
          │ │ │ +    setelement(5, T2, new_value).

          The two following setelement/3 calls modify the tuple in │ │ │ place.

          For the optimization to be applied, all the following conditions must be true:

          • The tuple argument must be known to be a tuple of a known size.
          • The indices must be integer literals, not variables or expressions.
          • The indices must be given in descending order.
          • There must be no calls to another function in between the calls to │ │ │ setelement/3.
          • The tuple returned from one setelement/3 call must only be │ │ │ used in the subsequent call to setelement/3.

          If the code cannot be structured as in the multiple_setelement/1 example, the │ │ │ best way to modify multiple elements in a large tuple is to convert the tuple to │ │ │ a list, modify the list, and convert it back to a tuple.

          │ │ │ │ │ │ │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/conc_prog.html │ │ │ @@ -132,107 +132,107 @@ │ │ │ threads of execution in an Erlang program and to allow these threads to │ │ │ communicate with each other. In Erlang, each thread of execution is called a │ │ │ process.

          (Aside: the term "process" is usually used when the threads of execution share │ │ │ no data with each other and the term "thread" when they share data in some way. │ │ │ Threads of execution in Erlang share no data, that is why they are called │ │ │ processes).

          The Erlang BIF spawn is used to create a new process: │ │ │ spawn(Module, Exported_Function, List of Arguments). Consider the following │ │ │ -module:

          -module(tut14).
          │ │ │ +module:

          -module(tut14).
          │ │ │  
          │ │ │ --export([start/0, say_something/2]).
          │ │ │ +-export([start/0, say_something/2]).
          │ │ │  
          │ │ │ -say_something(What, 0) ->
          │ │ │ +say_something(What, 0) ->
          │ │ │      done;
          │ │ │ -say_something(What, Times) ->
          │ │ │ -    io:format("~p~n", [What]),
          │ │ │ -    say_something(What, Times - 1).
          │ │ │ -
          │ │ │ -start() ->
          │ │ │ -    spawn(tut14, say_something, [hello, 3]),
          │ │ │ -    spawn(tut14, say_something, [goodbye, 3]).
          5> c(tut14).
          │ │ │ -{ok,tut14}
          │ │ │ -6> tut14:say_something(hello, 3).
          │ │ │ +say_something(What, Times) ->
          │ │ │ +    io:format("~p~n", [What]),
          │ │ │ +    say_something(What, Times - 1).
          │ │ │ +
          │ │ │ +start() ->
          │ │ │ +    spawn(tut14, say_something, [hello, 3]),
          │ │ │ +    spawn(tut14, say_something, [goodbye, 3]).
          5> c(tut14).
          │ │ │ +{ok,tut14}
          │ │ │ +6> tut14:say_something(hello, 3).
          │ │ │  hello
          │ │ │  hello
          │ │ │  hello
          │ │ │  done

          As shown, the function say_something writes its first argument the number of │ │ │ times specified by second argument. The function start starts two Erlang │ │ │ processes, one that writes "hello" three times and one that writes "goodbye" │ │ │ three times. Both processes use the function say_something. Notice that a │ │ │ function used in this way by spawn, to start a process, must be exported from │ │ │ -the module (that is, in the -export at the start of the module).

          9> tut14:start().
          │ │ │ +the module (that is, in the -export at the start of the module).

          9> tut14:start().
          │ │ │  hello
          │ │ │  goodbye
          │ │ │  <0.63.0>
          │ │ │  hello
          │ │ │  goodbye
          │ │ │  hello
          │ │ │  goodbye

          Notice that it did not write "hello" three times and then "goodbye" three times. │ │ │ Instead, the first process wrote a "hello", the second a "goodbye", the first │ │ │ another "hello" and so forth. But where did the <0.63.0> come from? The return │ │ │ value of a function is the return value of the last "thing" in the function. The │ │ │ -last thing in the function start is

          spawn(tut14, say_something, [goodbye, 3]).

          spawn returns a process identifier, or pid, which uniquely identifies the │ │ │ +last thing in the function start is

          spawn(tut14, say_something, [goodbye, 3]).

          spawn returns a process identifier, or pid, which uniquely identifies the │ │ │ process. So <0.63.0> is the pid of the spawn function call above. The next │ │ │ example shows how to use pids.

          Notice also that ~p is used instead of ~w in io:format/2. To quote the manual:

          ~p Writes the data with standard syntax in the same way as ~w, but breaks terms │ │ │ whose printed representation is longer than one line into many lines and indents │ │ │ each line sensibly. It also tries to detect flat lists of printable characters and │ │ │ to output these as strings

          │ │ │ │ │ │ │ │ │ │ │ │ Message Passing │ │ │

          │ │ │

          In the following example two processes are created and they send messages to │ │ │ -each other a number of times.

          -module(tut15).
          │ │ │ +each other a number of times.

          -module(tut15).
          │ │ │  
          │ │ │ --export([start/0, ping/2, pong/0]).
          │ │ │ +-export([start/0, ping/2, pong/0]).
          │ │ │  
          │ │ │ -ping(0, Pong_PID) ->
          │ │ │ +ping(0, Pong_PID) ->
          │ │ │      Pong_PID ! finished,
          │ │ │ -    io:format("ping finished~n", []);
          │ │ │ +    io:format("ping finished~n", []);
          │ │ │  
          │ │ │ -ping(N, Pong_PID) ->
          │ │ │ -    Pong_PID ! {ping, self()},
          │ │ │ +ping(N, Pong_PID) ->
          │ │ │ +    Pong_PID ! {ping, self()},
          │ │ │      receive
          │ │ │          pong ->
          │ │ │ -            io:format("Ping received pong~n", [])
          │ │ │ +            io:format("Ping received pong~n", [])
          │ │ │      end,
          │ │ │ -    ping(N - 1, Pong_PID).
          │ │ │ +    ping(N - 1, Pong_PID).
          │ │ │  
          │ │ │ -pong() ->
          │ │ │ +pong() ->
          │ │ │      receive
          │ │ │          finished ->
          │ │ │ -            io:format("Pong finished~n", []);
          │ │ │ -        {ping, Ping_PID} ->
          │ │ │ -            io:format("Pong received ping~n", []),
          │ │ │ +            io:format("Pong finished~n", []);
          │ │ │ +        {ping, Ping_PID} ->
          │ │ │ +            io:format("Pong received ping~n", []),
          │ │ │              Ping_PID ! pong,
          │ │ │ -            pong()
          │ │ │ +            pong()
          │ │ │      end.
          │ │ │  
          │ │ │ -start() ->
          │ │ │ -    Pong_PID = spawn(tut15, pong, []),
          │ │ │ -    spawn(tut15, ping, [3, Pong_PID]).
          1> c(tut15).
          │ │ │ -{ok,tut15}
          │ │ │ -2> tut15: start().
          │ │ │ +start() ->
          │ │ │ +    Pong_PID = spawn(tut15, pong, []),
          │ │ │ +    spawn(tut15, ping, [3, Pong_PID]).
          1> c(tut15).
          │ │ │ +{ok,tut15}
          │ │ │ +2> tut15: start().
          │ │ │  <0.36.0>
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │  ping finished
          │ │ │ -Pong finished

          The function start first creates a process, let us call it "pong":

          Pong_PID = spawn(tut15, pong, [])

          This process executes tut15:pong(). Pong_PID is the process identity of the │ │ │ -"pong" process. The function start now creates another process "ping":

          spawn(tut15, ping, [3, Pong_PID]),

          This process executes:

          tut15:ping(3, Pong_PID)

          <0.36.0> is the return value from the start function.

          The process "pong" now does:

          receive
          │ │ │ +Pong finished

          The function start first creates a process, let us call it "pong":

          Pong_PID = spawn(tut15, pong, [])

          This process executes tut15:pong(). Pong_PID is the process identity of the │ │ │ +"pong" process. The function start now creates another process "ping":

          spawn(tut15, ping, [3, Pong_PID]),

          This process executes:

          tut15:ping(3, Pong_PID)

          <0.36.0> is the return value from the start function.

          The process "pong" now does:

          receive
          │ │ │      finished ->
          │ │ │ -        io:format("Pong finished~n", []);
          │ │ │ -    {ping, Ping_PID} ->
          │ │ │ -        io:format("Pong received ping~n", []),
          │ │ │ +        io:format("Pong finished~n", []);
          │ │ │ +    {ping, Ping_PID} ->
          │ │ │ +        io:format("Pong received ping~n", []),
          │ │ │          Ping_PID ! pong,
          │ │ │ -        pong()
          │ │ │ +        pong()
          │ │ │  end.

          The receive construct is used to allow processes to wait for messages from │ │ │ other processes. It has the following format:

          receive
          │ │ │     pattern1 ->
          │ │ │         actions1;
          │ │ │     pattern2 ->
          │ │ │         actions2;
          │ │ │     ....
          │ │ │ @@ -253,84 +253,84 @@
          │ │ │  queue (keeping the first message and any other messages in the queue). If the
          │ │ │  second message does not match, the third message is tried, and so on, until the
          │ │ │  end of the queue is reached. If the end of the queue is reached, the process
          │ │ │  blocks (stops execution) and waits until a new message is received and this
          │ │ │  procedure is repeated.

          The Erlang implementation is "clever" and minimizes the number of times each │ │ │ message is tested against the patterns in each receive.

          Now back to the ping pong example.

          "Pong" is waiting for messages. If the atom finished is received, "pong" │ │ │ writes "Pong finished" to the output and, as it has nothing more to do, │ │ │ -terminates. If it receives a message with the format:

          {ping, Ping_PID}

          it writes "Pong received ping" to the output and sends the atom pong to the │ │ │ +terminates. If it receives a message with the format:

          {ping, Ping_PID}

          it writes "Pong received ping" to the output and sends the atom pong to the │ │ │ process "ping":

          Ping_PID ! pong

          Notice how the operator "!" is used to send messages. The syntax of "!" is:

          Pid ! Message

          That is, Message (any Erlang term) is sent to the process with identity Pid.

          After sending the message pong to the process "ping", "pong" calls the pong │ │ │ function again, which causes it to get back to the receive again and wait for │ │ │ -another message.

          Now let us look at the process "ping". Recall that it was started by executing:

          tut15:ping(3, Pong_PID)

          Looking at the function ping/2, the second clause of ping/2 is executed │ │ │ +another message.

          Now let us look at the process "ping". Recall that it was started by executing:

          tut15:ping(3, Pong_PID)

          Looking at the function ping/2, the second clause of ping/2 is executed │ │ │ since the value of the first argument is 3 (not 0) (first clause head is │ │ │ -ping(0,Pong_PID), second clause head is ping(N,Pong_PID), so N becomes 3).

          The second clause sends a message to "pong":

          Pong_PID ! {ping, self()},

          self/0 returns the pid of the process that executes self/0, in this case the │ │ │ +ping(0,Pong_PID), second clause head is ping(N,Pong_PID), so N becomes 3).

          The second clause sends a message to "pong":

          Pong_PID ! {ping, self()},

          self/0 returns the pid of the process that executes self/0, in this case the │ │ │ pid of "ping". (Recall the code for "pong", this lands up in the variable │ │ │ Ping_PID in the receive previously explained.)

          "Ping" now waits for a reply from "pong":

          receive
          │ │ │      pong ->
          │ │ │ -        io:format("Ping received pong~n", [])
          │ │ │ +        io:format("Ping received pong~n", [])
          │ │ │  end,

          It writes "Ping received pong" when this reply arrives, after which "ping" calls │ │ │ -the ping function again.

          ping(N - 1, Pong_PID)

          N-1 causes the first argument to be decremented until it becomes 0. When this │ │ │ -occurs, the first clause of ping/2 is executed:

          ping(0, Pong_PID) ->
          │ │ │ +the ping function again.

          ping(N - 1, Pong_PID)

          N-1 causes the first argument to be decremented until it becomes 0. When this │ │ │ +occurs, the first clause of ping/2 is executed:

          ping(0, Pong_PID) ->
          │ │ │      Pong_PID !  finished,
          │ │ │ -    io:format("ping finished~n", []);

          The atom finished is sent to "pong" (causing it to terminate as described │ │ │ + io:format("ping finished~n", []);

          The atom finished is sent to "pong" (causing it to terminate as described │ │ │ above) and "ping finished" is written to the output. "Ping" then terminates as │ │ │ it has nothing left to do.

          │ │ │ │ │ │ │ │ │ │ │ │ Registered Process Names │ │ │

          │ │ │

          In the above example, "pong" was first created to be able to give the identity │ │ │ of "pong" when "ping" was started. That is, in some way "ping" must be able to │ │ │ know the identity of "pong" to be able to send a message to it. Sometimes │ │ │ processes which need to know each other's identities are started independently │ │ │ of each other. Erlang thus provides a mechanism for processes to be given names │ │ │ so that these names can be used as identities instead of pids. This is done by │ │ │ -using the register BIF:

          register(some_atom, Pid)

          Let us now rewrite the ping pong example using this and give the name pong to │ │ │ -the "pong" process:

          -module(tut16).
          │ │ │ +using the register BIF:

          register(some_atom, Pid)

          Let us now rewrite the ping pong example using this and give the name pong to │ │ │ +the "pong" process:

          -module(tut16).
          │ │ │  
          │ │ │ --export([start/0, ping/1, pong/0]).
          │ │ │ +-export([start/0, ping/1, pong/0]).
          │ │ │  
          │ │ │ -ping(0) ->
          │ │ │ +ping(0) ->
          │ │ │      pong ! finished,
          │ │ │ -    io:format("ping finished~n", []);
          │ │ │ +    io:format("ping finished~n", []);
          │ │ │  
          │ │ │ -ping(N) ->
          │ │ │ -    pong ! {ping, self()},
          │ │ │ +ping(N) ->
          │ │ │ +    pong ! {ping, self()},
          │ │ │      receive
          │ │ │          pong ->
          │ │ │ -            io:format("Ping received pong~n", [])
          │ │ │ +            io:format("Ping received pong~n", [])
          │ │ │      end,
          │ │ │ -    ping(N - 1).
          │ │ │ +    ping(N - 1).
          │ │ │  
          │ │ │ -pong() ->
          │ │ │ +pong() ->
          │ │ │      receive
          │ │ │          finished ->
          │ │ │ -            io:format("Pong finished~n", []);
          │ │ │ -        {ping, Ping_PID} ->
          │ │ │ -            io:format("Pong received ping~n", []),
          │ │ │ +            io:format("Pong finished~n", []);
          │ │ │ +        {ping, Ping_PID} ->
          │ │ │ +            io:format("Pong received ping~n", []),
          │ │ │              Ping_PID ! pong,
          │ │ │ -            pong()
          │ │ │ +            pong()
          │ │ │      end.
          │ │ │  
          │ │ │ -start() ->
          │ │ │ -    register(pong, spawn(tut16, pong, [])),
          │ │ │ -    spawn(tut16, ping, [3]).
          2> c(tut16).
          │ │ │ -{ok, tut16}
          │ │ │ -3> tut16:start().
          │ │ │ +start() ->
          │ │ │ +    register(pong, spawn(tut16, pong, [])),
          │ │ │ +    spawn(tut16, ping, [3]).
          2> c(tut16).
          │ │ │ +{ok, tut16}
          │ │ │ +3> tut16:start().
          │ │ │  <0.38.0>
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │  ping finished
          │ │ │ -Pong finished

          Here the start/0 function,

          register(pong, spawn(tut16, pong, [])),

          both spawns the "pong" process and gives it the name pong. In the "ping" │ │ │ -process, messages can be sent to pong by:

          pong ! {ping, self()},

          ping/2 now becomes ping/1 as the argument Pong_PID is not needed.

          │ │ │ +Pong finished

          Here the start/0 function,

          register(pong, spawn(tut16, pong, [])),

          both spawns the "pong" process and gives it the name pong. In the "ping" │ │ │ +process, messages can be sent to pong by:

          pong ! {ping, self()},

          ping/2 now becomes ping/1 as the argument Pong_PID is not needed.

          │ │ │ │ │ │ │ │ │ │ │ │ Distributed Programming │ │ │

          │ │ │

          Let us rewrite the ping pong program with "ping" and "pong" on different │ │ │ computers. First a few things are needed to set up to get this to work. The │ │ │ @@ -350,106 +350,106 @@ │ │ │ of the file. This is a requirement.

          When you start an Erlang system that is going to talk to other Erlang systems, │ │ │ you must give it a name, for example:

          $ erl -sname my_name

          We will see more details of this later. If you want to experiment with │ │ │ distributed Erlang, but you only have one computer to work on, you can start two │ │ │ separate Erlang systems on the same computer but give them different names. Each │ │ │ Erlang system running on a computer is called an Erlang node.

          (Note: erl -sname assumes that all nodes are in the same IP domain and we can │ │ │ use only the first component of the IP address, if we want to use nodes in │ │ │ different domains we use -name instead, but then all IP address must be given │ │ │ -in full.)

          Here is the ping pong example modified to run on two separate nodes:

          -module(tut17).
          │ │ │ +in full.)

          Here is the ping pong example modified to run on two separate nodes:

          -module(tut17).
          │ │ │  
          │ │ │ --export([start_ping/1, start_pong/0,  ping/2, pong/0]).
          │ │ │ +-export([start_ping/1, start_pong/0,  ping/2, pong/0]).
          │ │ │  
          │ │ │ -ping(0, Pong_Node) ->
          │ │ │ -    {pong, Pong_Node} ! finished,
          │ │ │ -    io:format("ping finished~n", []);
          │ │ │ +ping(0, Pong_Node) ->
          │ │ │ +    {pong, Pong_Node} ! finished,
          │ │ │ +    io:format("ping finished~n", []);
          │ │ │  
          │ │ │ -ping(N, Pong_Node) ->
          │ │ │ -    {pong, Pong_Node} ! {ping, self()},
          │ │ │ +ping(N, Pong_Node) ->
          │ │ │ +    {pong, Pong_Node} ! {ping, self()},
          │ │ │      receive
          │ │ │          pong ->
          │ │ │ -            io:format("Ping received pong~n", [])
          │ │ │ +            io:format("Ping received pong~n", [])
          │ │ │      end,
          │ │ │ -    ping(N - 1, Pong_Node).
          │ │ │ +    ping(N - 1, Pong_Node).
          │ │ │  
          │ │ │ -pong() ->
          │ │ │ +pong() ->
          │ │ │      receive
          │ │ │          finished ->
          │ │ │ -            io:format("Pong finished~n", []);
          │ │ │ -        {ping, Ping_PID} ->
          │ │ │ -            io:format("Pong received ping~n", []),
          │ │ │ +            io:format("Pong finished~n", []);
          │ │ │ +        {ping, Ping_PID} ->
          │ │ │ +            io:format("Pong received ping~n", []),
          │ │ │              Ping_PID ! pong,
          │ │ │ -            pong()
          │ │ │ +            pong()
          │ │ │      end.
          │ │ │  
          │ │ │ -start_pong() ->
          │ │ │ -    register(pong, spawn(tut17, pong, [])).
          │ │ │ +start_pong() ->
          │ │ │ +    register(pong, spawn(tut17, pong, [])).
          │ │ │  
          │ │ │ -start_ping(Pong_Node) ->
          │ │ │ -    spawn(tut17, ping, [3, Pong_Node]).

          Let us assume there are two computers called gollum and kosken. First a node is │ │ │ +start_ping(Pong_Node) -> │ │ │ + spawn(tut17, ping, [3, Pong_Node]).

          Let us assume there are two computers called gollum and kosken. First a node is │ │ │ started on kosken, called ping, and then a node on gollum, called pong.

          On kosken (on a Linux/UNIX system):

          kosken> erl -sname ping
          │ │ │  Erlang (BEAM) emulator version 5.2.3.7 [hipe] [threads:0]
          │ │ │  
          │ │ │  Eshell V5.2.3.7  (abort with ^G)
          │ │ │  (ping@kosken)1>

          On gollum:

          gollum> erl -sname pong
          │ │ │  Erlang (BEAM) emulator version 5.2.3.7 [hipe] [threads:0]
          │ │ │  
          │ │ │  Eshell V5.2.3.7  (abort with ^G)
          │ │ │ -(pong@gollum)1>

          Now the "pong" process on gollum is started:

          (pong@gollum)1> tut17:start_pong().
          │ │ │ +(pong@gollum)1>

          Now the "pong" process on gollum is started:

          (pong@gollum)1> tut17:start_pong().
          │ │ │  true

          And the "ping" process on kosken is started (from the code above you can see │ │ │ that a parameter of the start_ping function is the node name of the Erlang │ │ │ -system where "pong" is running):

          (ping@kosken)1> tut17:start_ping(pong@gollum).
          │ │ │ +system where "pong" is running):

          (ping@kosken)1> tut17:start_ping(pong@gollum).
          │ │ │  <0.37.0>
          │ │ │  Ping received pong
          │ │ │  Ping received pong
          │ │ │  Ping received pong
          │ │ │  ping finished

          As shown, the ping pong program has run. On the "pong" side:

          (pong@gollum)2> 
          │ │ │  Pong received ping
          │ │ │  Pong received ping
          │ │ │  Pong received ping
          │ │ │  Pong finished
          │ │ │ -(pong@gollum)2> 

          Looking at the tut17 code, you see that the pong function itself is │ │ │ +(pong@gollum)2>

          Looking at the tut17 code, you see that the pong function itself is │ │ │ unchanged, the following lines work in the same way irrespective of on which │ │ │ -node the "ping" process is executes:

          {ping, Ping_PID} ->
          │ │ │ -    io:format("Pong received ping~n", []),
          │ │ │ +node the "ping" process is executes:

          {ping, Ping_PID} ->
          │ │ │ +    io:format("Pong received ping~n", []),
          │ │ │      Ping_PID ! pong,

          Thus, Erlang pids contain information about where the process executes. So if │ │ │ you know the pid of a process, the ! operator can be used to send it a │ │ │ -message disregarding if the process is on the same node or on a different node.

          A difference is how messages are sent to a registered process on another node:

          {pong, Pong_Node} ! {ping, self()},

          A tuple {registered_name,node_name} is used instead of just the │ │ │ +message disregarding if the process is on the same node or on a different node.

          A difference is how messages are sent to a registered process on another node:

          {pong, Pong_Node} ! {ping, self()},

          A tuple {registered_name,node_name} is used instead of just the │ │ │ registered_name.

          In the previous example, "ping" and "pong" were started from the shells of two │ │ │ separate Erlang nodes. spawn can also be used to start processes in other │ │ │ nodes.

          The next example is the ping pong program, yet again, but this time "ping" is │ │ │ -started in another node:

          -module(tut18).
          │ │ │ +started in another node:

          -module(tut18).
          │ │ │  
          │ │ │ --export([start/1,  ping/2, pong/0]).
          │ │ │ +-export([start/1,  ping/2, pong/0]).
          │ │ │  
          │ │ │ -ping(0, Pong_Node) ->
          │ │ │ -    {pong, Pong_Node} ! finished,
          │ │ │ -    io:format("ping finished~n", []);
          │ │ │ +ping(0, Pong_Node) ->
          │ │ │ +    {pong, Pong_Node} ! finished,
          │ │ │ +    io:format("ping finished~n", []);
          │ │ │  
          │ │ │ -ping(N, Pong_Node) ->
          │ │ │ -    {pong, Pong_Node} ! {ping, self()},
          │ │ │ +ping(N, Pong_Node) ->
          │ │ │ +    {pong, Pong_Node} ! {ping, self()},
          │ │ │      receive
          │ │ │          pong ->
          │ │ │ -            io:format("Ping received pong~n", [])
          │ │ │ +            io:format("Ping received pong~n", [])
          │ │ │      end,
          │ │ │ -    ping(N - 1, Pong_Node).
          │ │ │ +    ping(N - 1, Pong_Node).
          │ │ │  
          │ │ │ -pong() ->
          │ │ │ +pong() ->
          │ │ │      receive
          │ │ │          finished ->
          │ │ │ -            io:format("Pong finished~n", []);
          │ │ │ -        {ping, Ping_PID} ->
          │ │ │ -            io:format("Pong received ping~n", []),
          │ │ │ +            io:format("Pong finished~n", []);
          │ │ │ +        {ping, Ping_PID} ->
          │ │ │ +            io:format("Pong received ping~n", []),
          │ │ │              Ping_PID ! pong,
          │ │ │ -            pong()
          │ │ │ +            pong()
          │ │ │      end.
          │ │ │  
          │ │ │ -start(Ping_Node) ->
          │ │ │ -    register(pong, spawn(tut18, pong, [])),
          │ │ │ -    spawn(Ping_Node, tut18, ping, [3, node()]).

          Assuming an Erlang system called ping (but not the "ping" process) has already │ │ │ -been started on kosken, then on gollum this is done:

          (pong@gollum)1> tut18:start(ping@kosken).
          │ │ │ +start(Ping_Node) ->
          │ │ │ +    register(pong, spawn(tut18, pong, [])),
          │ │ │ +    spawn(Ping_Node, tut18, ping, [3, node()]).

          Assuming an Erlang system called ping (but not the "ping" process) has already │ │ │ +been started on kosken, then on gollum this is done:

          (pong@gollum)1> tut18:start(ping@kosken).
          │ │ │  <3934.39.0>
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │  Pong received ping
          │ │ │  Ping received pong
          │ │ │ @@ -516,188 +516,188 @@
          │ │ │  %%% Started: messenger:client(Server_Node, Name)
          │ │ │  %%% To client: logoff
          │ │ │  %%% To client: {message_to, ToName, Message}
          │ │ │  %%%
          │ │ │  %%% Configuration: change the server_node() function to return the
          │ │ │  %%% name of the node where the messenger server runs
          │ │ │  
          │ │ │ --module(messenger).
          │ │ │ --export([start_server/0, server/1, logon/1, logoff/0, message/2, client/2]).
          │ │ │ +-module(messenger).
          │ │ │ +-export([start_server/0, server/1, logon/1, logoff/0, message/2, client/2]).
          │ │ │  
          │ │ │  %%% Change the function below to return the name of the node where the
          │ │ │  %%% messenger server runs
          │ │ │ -server_node() ->
          │ │ │ +server_node() ->
          │ │ │      messenger@super.
          │ │ │  
          │ │ │  %%% This is the server process for the "messenger"
          │ │ │  %%% the user list has the format [{ClientPid1, Name1},{ClientPid22, Name2},...]
          │ │ │ -server(User_List) ->
          │ │ │ +server(User_List) ->
          │ │ │      receive
          │ │ │ -        {From, logon, Name} ->
          │ │ │ -            New_User_List = server_logon(From, Name, User_List),
          │ │ │ -            server(New_User_List);
          │ │ │ -        {From, logoff} ->
          │ │ │ -            New_User_List = server_logoff(From, User_List),
          │ │ │ -            server(New_User_List);
          │ │ │ -        {From, message_to, To, Message} ->
          │ │ │ -            server_transfer(From, To, Message, User_List),
          │ │ │ -            io:format("list is now: ~p~n", [User_List]),
          │ │ │ -            server(User_List)
          │ │ │ +        {From, logon, Name} ->
          │ │ │ +            New_User_List = server_logon(From, Name, User_List),
          │ │ │ +            server(New_User_List);
          │ │ │ +        {From, logoff} ->
          │ │ │ +            New_User_List = server_logoff(From, User_List),
          │ │ │ +            server(New_User_List);
          │ │ │ +        {From, message_to, To, Message} ->
          │ │ │ +            server_transfer(From, To, Message, User_List),
          │ │ │ +            io:format("list is now: ~p~n", [User_List]),
          │ │ │ +            server(User_List)
          │ │ │      end.
          │ │ │  
          │ │ │  %%% Start the server
          │ │ │ -start_server() ->
          │ │ │ -    register(messenger, spawn(messenger, server, [[]])).
          │ │ │ +start_server() ->
          │ │ │ +    register(messenger, spawn(messenger, server, [[]])).
          │ │ │  
          │ │ │  
          │ │ │  %%% Server adds a new user to the user list
          │ │ │ -server_logon(From, Name, User_List) ->
          │ │ │ +server_logon(From, Name, User_List) ->
          │ │ │      %% check if logged on anywhere else
          │ │ │ -    case lists:keymember(Name, 2, User_List) of
          │ │ │ +    case lists:keymember(Name, 2, User_List) of
          │ │ │          true ->
          │ │ │ -            From ! {messenger, stop, user_exists_at_other_node},  %reject logon
          │ │ │ +            From ! {messenger, stop, user_exists_at_other_node},  %reject logon
          │ │ │              User_List;
          │ │ │          false ->
          │ │ │ -            From ! {messenger, logged_on},
          │ │ │ -            [{From, Name} | User_List]        %add user to the list
          │ │ │ +            From ! {messenger, logged_on},
          │ │ │ +            [{From, Name} | User_List]        %add user to the list
          │ │ │      end.
          │ │ │  
          │ │ │  %%% Server deletes a user from the user list
          │ │ │ -server_logoff(From, User_List) ->
          │ │ │ -    lists:keydelete(From, 1, User_List).
          │ │ │ +server_logoff(From, User_List) ->
          │ │ │ +    lists:keydelete(From, 1, User_List).
          │ │ │  
          │ │ │  
          │ │ │  %%% Server transfers a message between user
          │ │ │ -server_transfer(From, To, Message, User_List) ->
          │ │ │ +server_transfer(From, To, Message, User_List) ->
          │ │ │      %% check that the user is logged on and who he is
          │ │ │ -    case lists:keysearch(From, 1, User_List) of
          │ │ │ +    case lists:keysearch(From, 1, User_List) of
          │ │ │          false ->
          │ │ │ -            From ! {messenger, stop, you_are_not_logged_on};
          │ │ │ -        {value, {From, Name}} ->
          │ │ │ -            server_transfer(From, Name, To, Message, User_List)
          │ │ │ +            From ! {messenger, stop, you_are_not_logged_on};
          │ │ │ +        {value, {From, Name}} ->
          │ │ │ +            server_transfer(From, Name, To, Message, User_List)
          │ │ │      end.
          │ │ │  %%% If the user exists, send the message
          │ │ │ -server_transfer(From, Name, To, Message, User_List) ->
          │ │ │ +server_transfer(From, Name, To, Message, User_List) ->
          │ │ │      %% Find the receiver and send the message
          │ │ │ -    case lists:keysearch(To, 2, User_List) of
          │ │ │ +    case lists:keysearch(To, 2, User_List) of
          │ │ │          false ->
          │ │ │ -            From ! {messenger, receiver_not_found};
          │ │ │ -        {value, {ToPid, To}} ->
          │ │ │ -            ToPid ! {message_from, Name, Message},
          │ │ │ -            From ! {messenger, sent}
          │ │ │ +            From ! {messenger, receiver_not_found};
          │ │ │ +        {value, {ToPid, To}} ->
          │ │ │ +            ToPid ! {message_from, Name, Message},
          │ │ │ +            From ! {messenger, sent}
          │ │ │      end.
          │ │ │  
          │ │ │  
          │ │ │  %%% User Commands
          │ │ │ -logon(Name) ->
          │ │ │ -    case whereis(mess_client) of
          │ │ │ +logon(Name) ->
          │ │ │ +    case whereis(mess_client) of
          │ │ │          undefined ->
          │ │ │ -            register(mess_client,
          │ │ │ -                     spawn(messenger, client, [server_node(), Name]));
          │ │ │ +            register(mess_client,
          │ │ │ +                     spawn(messenger, client, [server_node(), Name]));
          │ │ │          _ -> already_logged_on
          │ │ │      end.
          │ │ │  
          │ │ │ -logoff() ->
          │ │ │ +logoff() ->
          │ │ │      mess_client ! logoff.
          │ │ │  
          │ │ │ -message(ToName, Message) ->
          │ │ │ -    case whereis(mess_client) of % Test if the client is running
          │ │ │ +message(ToName, Message) ->
          │ │ │ +    case whereis(mess_client) of % Test if the client is running
          │ │ │          undefined ->
          │ │ │              not_logged_on;
          │ │ │ -        _ -> mess_client ! {message_to, ToName, Message},
          │ │ │ +        _ -> mess_client ! {message_to, ToName, Message},
          │ │ │               ok
          │ │ │  end.
          │ │ │  
          │ │ │  
          │ │ │  %%% The client process which runs on each server node
          │ │ │ -client(Server_Node, Name) ->
          │ │ │ -    {messenger, Server_Node} ! {self(), logon, Name},
          │ │ │ -    await_result(),
          │ │ │ -    client(Server_Node).
          │ │ │ +client(Server_Node, Name) ->
          │ │ │ +    {messenger, Server_Node} ! {self(), logon, Name},
          │ │ │ +    await_result(),
          │ │ │ +    client(Server_Node).
          │ │ │  
          │ │ │ -client(Server_Node) ->
          │ │ │ +client(Server_Node) ->
          │ │ │      receive
          │ │ │          logoff ->
          │ │ │ -            {messenger, Server_Node} ! {self(), logoff},
          │ │ │ -            exit(normal);
          │ │ │ -        {message_to, ToName, Message} ->
          │ │ │ -            {messenger, Server_Node} ! {self(), message_to, ToName, Message},
          │ │ │ -            await_result();
          │ │ │ -        {message_from, FromName, Message} ->
          │ │ │ -            io:format("Message from ~p: ~p~n", [FromName, Message])
          │ │ │ +            {messenger, Server_Node} ! {self(), logoff},
          │ │ │ +            exit(normal);
          │ │ │ +        {message_to, ToName, Message} ->
          │ │ │ +            {messenger, Server_Node} ! {self(), message_to, ToName, Message},
          │ │ │ +            await_result();
          │ │ │ +        {message_from, FromName, Message} ->
          │ │ │ +            io:format("Message from ~p: ~p~n", [FromName, Message])
          │ │ │      end,
          │ │ │ -    client(Server_Node).
          │ │ │ +    client(Server_Node).
          │ │ │  
          │ │ │  %%% wait for a response from the server
          │ │ │ -await_result() ->
          │ │ │ +await_result() ->
          │ │ │      receive
          │ │ │ -        {messenger, stop, Why} -> % Stop the client
          │ │ │ -            io:format("~p~n", [Why]),
          │ │ │ -            exit(normal);
          │ │ │ -        {messenger, What} ->  % Normal response
          │ │ │ -            io:format("~p~n", [What])
          │ │ │ +        {messenger, stop, Why} -> % Stop the client
          │ │ │ +            io:format("~p~n", [Why]),
          │ │ │ +            exit(normal);
          │ │ │ +        {messenger, What} ->  % Normal response
          │ │ │ +            io:format("~p~n", [What])
          │ │ │      end.

          To use this program, you need to:

          • Configure the server_node() function.
          • Copy the compiled code (messenger.beam) to the directory on each computer │ │ │ where you start Erlang.

          In the following example using this program, nodes are started on four different │ │ │ computers. If you do not have that many machines available on your network, you │ │ │ can start several nodes on the same machine.

          Four Erlang nodes are started up: messenger@super, c1@bilbo, c2@kosken, │ │ │ -c3@gollum.

          First the server at messenger@super is started up:

          (messenger@super)1> messenger:start_server().
          │ │ │ -true

          Now Peter logs on at c1@bilbo:

          (c1@bilbo)1> messenger:logon(peter).
          │ │ │ +c3@gollum.

          First the server at messenger@super is started up:

          (messenger@super)1> messenger:start_server().
          │ │ │ +true

          Now Peter logs on at c1@bilbo:

          (c1@bilbo)1> messenger:logon(peter).
          │ │ │  true
          │ │ │ -logged_on

          James logs on at c2@kosken:

          (c2@kosken)1> messenger:logon(james).
          │ │ │ +logged_on

          James logs on at c2@kosken:

          (c2@kosken)1> messenger:logon(james).
          │ │ │  true
          │ │ │ -logged_on

          And Fred logs on at c3@gollum:

          (c3@gollum)1> messenger:logon(fred).
          │ │ │ +logged_on

          And Fred logs on at c3@gollum:

          (c3@gollum)1> messenger:logon(fred).
          │ │ │  true
          │ │ │ -logged_on

          Now Peter sends Fred a message:

          (c1@bilbo)2> messenger:message(fred, "hello").
          │ │ │ +logged_on

          Now Peter sends Fred a message:

          (c1@bilbo)2> messenger:message(fred, "hello").
          │ │ │  ok
          │ │ │  sent

          Fred receives the message and sends a message to Peter and logs off:

          Message from peter: "hello"
          │ │ │ -(c3@gollum)2> messenger:message(peter, "go away, I'm busy").
          │ │ │ +(c3@gollum)2> messenger:message(peter, "go away, I'm busy").
          │ │ │  ok
          │ │ │  sent
          │ │ │ -(c3@gollum)3> messenger:logoff().
          │ │ │ -logoff

          James now tries to send a message to Fred:

          (c2@kosken)2> messenger:message(fred, "peter doesn't like you").
          │ │ │ +(c3@gollum)3> messenger:logoff().
          │ │ │ +logoff

          James now tries to send a message to Fred:

          (c2@kosken)2> messenger:message(fred, "peter doesn't like you").
          │ │ │  ok
          │ │ │  receiver_not_found

          But this fails as Fred has already logged off.

          First let us look at some of the new concepts that have been introduced.

          There are two versions of the server_transfer function: one with four │ │ │ arguments (server_transfer/4) and one with five (server_transfer/5). These │ │ │ are regarded by Erlang as two separate functions.

          Notice how to write the server function so that it calls itself, through │ │ │ server(User_List), and thus creates a loop. The Erlang compiler is "clever" │ │ │ and optimizes the code so that this really is a sort of loop and not a proper │ │ │ function call. But this only works if there is no code after the call. │ │ │ Otherwise, the compiler expects the call to return and make a proper function │ │ │ call. This would result in the process getting bigger and bigger for every loop.

          Functions in the lists module are used. This is a very useful module and a │ │ │ study of the manual page is recommended (erl -man lists). │ │ │ lists:keymember(Key,Position,Lists) looks through a list of tuples and looks │ │ │ at Position in each tuple to see if it is the same as Key. The first element │ │ │ is position 1. If it finds a tuple where the element at Position is the same │ │ │ -as Key, it returns true, otherwise false.

          3> lists:keymember(a, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
          │ │ │ +as Key, it returns true, otherwise false.

          3> lists:keymember(a, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
          │ │ │  true
          │ │ │ -4> lists:keymember(p, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
          │ │ │ +4> lists:keymember(p, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
          │ │ │  false

          lists:keydelete works in the same way but deletes the first tuple found (if │ │ │ -any) and returns the remaining list:

          5> lists:keydelete(a, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
          │ │ │ -[{x,y,z},{b,b,b},{q,r,s}]

          lists:keysearch is like lists:keymember, but it returns │ │ │ +any) and returns the remaining list:

          5> lists:keydelete(a, 2, [{x,y,z},{b,b,b},{b,a,c},{q,r,s}]).
          │ │ │ +[{x,y,z},{b,b,b},{q,r,s}]

          lists:keysearch is like lists:keymember, but it returns │ │ │ {value,Tuple_Found} or the atom false.

          There are many very useful functions in the lists module.

          An Erlang process (conceptually) runs until it does a receive and there is no │ │ │ message which it wants to receive in the message queue. "conceptually" is used │ │ │ here because the Erlang system shares the CPU time between the active processes │ │ │ in the system.

          A process terminates when there is nothing more for it to do, that is, the last │ │ │ function it calls simply returns and does not call another function. Another way │ │ │ for a process to terminate is for it to call exit/1. The argument │ │ │ to exit/1 has a special meaning, which is discussed later. In this │ │ │ example, exit(normal) is done, which has the same effect as a │ │ │ process running out of functions to call.

          The BIF whereis(RegisteredName) checks if a registered process │ │ │ of name RegisteredName exists. If it exists, the pid of that process is │ │ │ returned. If it does not exist, the atom undefined is returned.

          You should by now be able to understand most of the code in the │ │ │ messenger-module. Let us study one case in detail: a message is sent from one │ │ │ -user to another.

          The first user "sends" the message in the example above by:

          messenger:message(fred, "hello")

          After testing that the client process exists:

          whereis(mess_client)

          And a message is sent to mess_client:

          mess_client ! {message_to, fred, "hello"}

          The client sends the message to the server by:

          {messenger, messenger@super} ! {self(), message_to, fred, "hello"},

          And waits for a reply from the server.

          The server receives this message and calls:

          server_transfer(From, fred, "hello", User_List),

          This checks that the pid From is in the User_List:

          lists:keysearch(From, 1, User_List)

          If keysearch returns the atom false, some error has occurred and the server │ │ │ -sends back the message:

          From ! {messenger, stop, you_are_not_logged_on}

          This is received by the client, which in turn does exit(normal) │ │ │ +user to another.

          The first user "sends" the message in the example above by:

          messenger:message(fred, "hello")

          After testing that the client process exists:

          whereis(mess_client)

          And a message is sent to mess_client:

          mess_client ! {message_to, fred, "hello"}

          The client sends the message to the server by:

          {messenger, messenger@super} ! {self(), message_to, fred, "hello"},

          And waits for a reply from the server.

          The server receives this message and calls:

          server_transfer(From, fred, "hello", User_List),

          This checks that the pid From is in the User_List:

          lists:keysearch(From, 1, User_List)

          If keysearch returns the atom false, some error has occurred and the server │ │ │ +sends back the message:

          From ! {messenger, stop, you_are_not_logged_on}

          This is received by the client, which in turn does exit(normal) │ │ │ and terminates. If keysearch returns {value,{From,Name}} it is certain that │ │ │ -the user is logged on and that his name (peter) is in variable Name.

          Let us now call:

          server_transfer(From, peter, fred, "hello", User_List)

          Notice that as this is server_transfer/5, it is not the same as the previous │ │ │ +the user is logged on and that his name (peter) is in variable Name.

          Let us now call:

          server_transfer(From, peter, fred, "hello", User_List)

          Notice that as this is server_transfer/5, it is not the same as the previous │ │ │ function server_transfer/4. Another keysearch is done on User_List to find │ │ │ -the pid of the client corresponding to fred:

          lists:keysearch(fred, 2, User_List)

          This time argument 2 is used, which is the second element in the tuple. If this │ │ │ +the pid of the client corresponding to fred:

          lists:keysearch(fred, 2, User_List)

          This time argument 2 is used, which is the second element in the tuple. If this │ │ │ returns the atom false, fred is not logged on and the following message is │ │ │ -sent:

          From ! {messenger, receiver_not_found};

          This is received by the client.

          If keysearch returns:

          {value, {ToPid, fred}}

          The following message is sent to fred's client:

          ToPid ! {message_from, peter, "hello"},

          The following message is sent to peter's client:

          From ! {messenger, sent}

          Fred's client receives the message and prints it:

          {message_from, peter, "hello"} ->
          │ │ │ -    io:format("Message from ~p: ~p~n", [peter, "hello"])

          Peter's client receives the message in the await_result function.

          │ │ │ +sent:

          From ! {messenger, receiver_not_found};

          This is received by the client.

          If keysearch returns:

          {value, {ToPid, fred}}

          The following message is sent to fred's client:

          ToPid ! {message_from, peter, "hello"},

          The following message is sent to peter's client:

          From ! {messenger, sent}

          Fred's client receives the message and prints it:

          {message_from, peter, "hello"} ->
          │ │ │ +    io:format("Message from ~p: ~p~n", [peter, "hello"])

          Peter's client receives the message in the await_result function.

          │ │ │

          │ │ │ │ │ │
          │ │ │
          │ │ │ │ │ │

          rel(4) manual page in │ │ │ SASL), which specifies the ERTS version and lists all applications that are to │ │ │ be included in the new basic target system. An example is the following │ │ │ mysystem.rel file:

          %% mysystem.rel
          │ │ │ -{release,
          │ │ │ - {"MYSYSTEM", "FIRST"},
          │ │ │ - {erts, "5.10.4"},
          │ │ │ - [{kernel, "2.16.4"},
          │ │ │ -  {stdlib, "1.19.4"},
          │ │ │ -  {sasl, "2.3.4"},
          │ │ │ -  {pea, "1.0"}]}.

          The listed applications are not only original Erlang/OTP applications but │ │ │ +{release, │ │ │ + {"MYSYSTEM", "FIRST"}, │ │ │ + {erts, "5.10.4"}, │ │ │ + [{kernel, "2.16.4"}, │ │ │ + {stdlib, "1.19.4"}, │ │ │ + {sasl, "2.3.4"}, │ │ │ + {pea, "1.0"}]}.

          The listed applications are not only original Erlang/OTP applications but │ │ │ possibly also new applications that you have written (here exemplified by the │ │ │ application Pea (pea)).

          Step 2. Start Erlang/OTP from the directory where the mysystem.rel file │ │ │ resides:

          % erl -pa /home/user/target_system/myapps/pea-1.0/ebin

          The -pa argument prepends the path to the ebin directory for │ │ │ the Pea application to the code path.

          Step 3. Create the target system:

          1> target_system:create("mysystem").

          The function target_system:create/1 performs the following:

          1. Reads the file mysystem.rel and creates a new file plain.rel. │ │ │ The new file is identical to the original, except that it only │ │ │ lists the Kernel and STDLIB applications.

          2. From the files mysystem.rel and plain.rel creates the files │ │ │ mysystem.script, mysystem.boot, plain.script, and plain.boot │ │ │ @@ -242,25 +242,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ Creating the Next Version │ │ │ │ │ │

            In this example the Pea application has been changed, and so are the │ │ │ applications ERTS, Kernel, STDLIB and SASL.

            Step 1. Create the file .rel:

            %% mysystem2.rel
            │ │ │ -{release,
            │ │ │ - {"MYSYSTEM", "SECOND"},
            │ │ │ - {erts, "6.0"},
            │ │ │ - [{kernel, "3.0"},
            │ │ │ -  {stdlib, "2.0"},
            │ │ │ -  {sasl, "2.4"},
            │ │ │ -  {pea, "2.0"}]}.

            Step 2. Create the application upgrade file (see │ │ │ +{release, │ │ │ + {"MYSYSTEM", "SECOND"}, │ │ │ + {erts, "6.0"}, │ │ │ + [{kernel, "3.0"}, │ │ │ + {stdlib, "2.0"}, │ │ │ + {sasl, "2.4"}, │ │ │ + {pea, "2.0"}]}.

          Step 2. Create the application upgrade file (see │ │ │ appup in SASL) for Pea, for example:

          %% pea.appup
          │ │ │ -{"2.0",
          │ │ │ - [{"1.0",[{load_module,pea_lib}]}],
          │ │ │ - [{"1.0",[{load_module,pea_lib}]}]}.

          Step 3. From the directory where the file mysystem2.rel resides, start the │ │ │ +{"2.0", │ │ │ + [{"1.0",[{load_module,pea_lib}]}], │ │ │ + [{"1.0",[{load_module,pea_lib}]}]}.

      Step 3. From the directory where the file mysystem2.rel resides, start the │ │ │ Erlang/OTP system, giving the path to the new version of Pea:

      % erl -pa /home/user/target_system/myapps/pea-2.0/ebin

      Step 4. Create the release upgrade file (see relup │ │ │ in SASL):

      1> systools:make_relup("mysystem2",["mysystem"],["mysystem"],
      │ │ │      [{path,["/home/user/target_system/myapps/pea-1.0/ebin",
      │ │ │      "/my/old/erlang/lib/*/ebin"]}]).

      Here "mysystem" is the base release and "mysystem2" is the release to │ │ │ upgrade to.

      The path option is used for pointing out the old version of all applications. │ │ │ (The new versions are already in the code path - assuming of course that the │ │ │ Erlang node on which this is executed is running the correct version of │ │ │ @@ -292,21 +292,21 @@ │ │ │ {continue_after_restart,"FIRST",[]} │ │ │ heart: Tue Apr 1 12:15:10 2014: Erlang has closed. │ │ │ heart: Tue Apr 1 12:15:11 2014: Executed "/usr/local/erl-target/bin/start /usr/local/erl-target/releases/new_start_erl.data" -> 0. Terminating. │ │ │ [End]

      The above return value and output after the call to │ │ │ release_handler:install_release/1 means that the release_handler has │ │ │ restarted the node by using heart. This is always done when the upgrade │ │ │ involves a change of the applications ERTS, Kernel, STDLIB, or SASL. For more │ │ │ -information, see Upgrade when Erlang/OTP has Changed.

      The node is accessible through a new pipe:

      % /usr/local/erl-target/bin/to_erl /tmp/erlang.pipe.2

      List the available releases in the system:

      1> release_handler:which_releases().
      │ │ │ -[{"MYSYSTEM","SECOND",
      │ │ │ -  ["kernel-3.0","stdlib-2.0","sasl-2.4","pea-2.0"],
      │ │ │ -  current},
      │ │ │ - {"MYSYSTEM","FIRST",
      │ │ │ -  ["kernel-2.16.4","stdlib-1.19.4","sasl-2.3.4","pea-1.0"],
      │ │ │ -  permanent}]

      Our new release, "SECOND", is now the current release, but we can also see that │ │ │ +information, see Upgrade when Erlang/OTP has Changed.

      The node is accessible through a new pipe:

      % /usr/local/erl-target/bin/to_erl /tmp/erlang.pipe.2

      List the available releases in the system:

      1> release_handler:which_releases().
      │ │ │ +[{"MYSYSTEM","SECOND",
      │ │ │ +  ["kernel-3.0","stdlib-2.0","sasl-2.4","pea-2.0"],
      │ │ │ +  current},
      │ │ │ + {"MYSYSTEM","FIRST",
      │ │ │ +  ["kernel-2.16.4","stdlib-1.19.4","sasl-2.3.4","pea-1.0"],
      │ │ │ +  permanent}]

      Our new release, "SECOND", is now the current release, but we can also see that │ │ │ our "FIRST" release is still permanent. This means that if the node would be │ │ │ restarted now, it would come up running the "FIRST" release again.

      Step 3. Make the new release permanent:

      2> release_handler:make_permanent("SECOND").

      Check the releases again:

      3> release_handler:which_releases().
      │ │ │  [{"MYSYSTEM","SECOND",
      │ │ │    ["kernel-3.0","stdlib-2.0","sasl-2.4","pea-2.0"],
      │ │ │    permanent},
      │ │ │   {"MYSYSTEM","FIRST",
      │ │ │    ["kernel-2.16.4","stdlib-1.19.4","sasl-2.3.4","pea-1.0"],
      │ │ │ @@ -315,268 +315,268 @@
      │ │ │    
      │ │ │      
      │ │ │    
      │ │ │    Listing of target_system.erl
      │ │ │  
      │ │ │  

      This module can also be found in the examples directory of the SASL │ │ │ application.

      
      │ │ │ --module(target_system).
      │ │ │ --export([create/1, create/2, install/2]).
      │ │ │ +-module(target_system).
      │ │ │ +-export([create/1, create/2, install/2]).
      │ │ │  
      │ │ │  %% Note: RelFileName below is the *stem* without trailing .rel,
      │ │ │  %% .script etc.
      │ │ │  %%
      │ │ │  
      │ │ │  %% create(RelFileName)
      │ │ │  %%
      │ │ │ -create(RelFileName) ->
      │ │ │ -    create(RelFileName,[]).
      │ │ │ +create(RelFileName) ->
      │ │ │ +    create(RelFileName,[]).
      │ │ │  
      │ │ │ -create(RelFileName,SystoolsOpts) ->
      │ │ │ +create(RelFileName,SystoolsOpts) ->
      │ │ │      RelFile = RelFileName ++ ".rel",
      │ │ │ -    Dir = filename:dirname(RelFileName),
      │ │ │ -    PlainRelFileName = filename:join(Dir,"plain"),
      │ │ │ +    Dir = filename:dirname(RelFileName),
      │ │ │ +    PlainRelFileName = filename:join(Dir,"plain"),
      │ │ │      PlainRelFile = PlainRelFileName ++ ".rel",
      │ │ │ -    io:fwrite("Reading file: ~ts ...~n", [RelFile]),
      │ │ │ -    {ok, [RelSpec]} = file:consult(RelFile),
      │ │ │ -    io:fwrite("Creating file: ~ts from ~ts ...~n",
      │ │ │ -              [PlainRelFile, RelFile]),
      │ │ │ -    {release,
      │ │ │ -     {RelName, RelVsn},
      │ │ │ -     {erts, ErtsVsn},
      │ │ │ -     AppVsns} = RelSpec,
      │ │ │ -    PlainRelSpec = {release,
      │ │ │ -                    {RelName, RelVsn},
      │ │ │ -                    {erts, ErtsVsn},
      │ │ │ -                    lists:filter(fun({kernel, _}) ->
      │ │ │ +    io:fwrite("Reading file: ~ts ...~n", [RelFile]),
      │ │ │ +    {ok, [RelSpec]} = file:consult(RelFile),
      │ │ │ +    io:fwrite("Creating file: ~ts from ~ts ...~n",
      │ │ │ +              [PlainRelFile, RelFile]),
      │ │ │ +    {release,
      │ │ │ +     {RelName, RelVsn},
      │ │ │ +     {erts, ErtsVsn},
      │ │ │ +     AppVsns} = RelSpec,
      │ │ │ +    PlainRelSpec = {release,
      │ │ │ +                    {RelName, RelVsn},
      │ │ │ +                    {erts, ErtsVsn},
      │ │ │ +                    lists:filter(fun({kernel, _}) ->
      │ │ │                                           true;
      │ │ │ -                                    ({stdlib, _}) ->
      │ │ │ +                                    ({stdlib, _}) ->
      │ │ │                                           true;
      │ │ │ -                                    (_) ->
      │ │ │ +                                    (_) ->
      │ │ │                                           false
      │ │ │ -                                 end, AppVsns)
      │ │ │ -                   },
      │ │ │ -    {ok, Fd} = file:open(PlainRelFile, [write]),
      │ │ │ -    io:fwrite(Fd, "~p.~n", [PlainRelSpec]),
      │ │ │ -    file:close(Fd),
      │ │ │ -
      │ │ │ -    io:fwrite("Making \"~ts.script\" and \"~ts.boot\" files ...~n",
      │ │ │ -	      [PlainRelFileName,PlainRelFileName]),
      │ │ │ -    make_script(PlainRelFileName,SystoolsOpts),
      │ │ │ -
      │ │ │ -    io:fwrite("Making \"~ts.script\" and \"~ts.boot\" files ...~n",
      │ │ │ -              [RelFileName, RelFileName]),
      │ │ │ -    make_script(RelFileName,SystoolsOpts),
      │ │ │ +                                 end, AppVsns)
      │ │ │ +                   },
      │ │ │ +    {ok, Fd} = file:open(PlainRelFile, [write]),
      │ │ │ +    io:fwrite(Fd, "~p.~n", [PlainRelSpec]),
      │ │ │ +    file:close(Fd),
      │ │ │ +
      │ │ │ +    io:fwrite("Making \"~ts.script\" and \"~ts.boot\" files ...~n",
      │ │ │ +	      [PlainRelFileName,PlainRelFileName]),
      │ │ │ +    make_script(PlainRelFileName,SystoolsOpts),
      │ │ │ +
      │ │ │ +    io:fwrite("Making \"~ts.script\" and \"~ts.boot\" files ...~n",
      │ │ │ +              [RelFileName, RelFileName]),
      │ │ │ +    make_script(RelFileName,SystoolsOpts),
      │ │ │  
      │ │ │      TarFileName = RelFileName ++ ".tar.gz",
      │ │ │ -    io:fwrite("Creating tar file ~ts ...~n", [TarFileName]),
      │ │ │ -    make_tar(RelFileName,SystoolsOpts),
      │ │ │ +    io:fwrite("Creating tar file ~ts ...~n", [TarFileName]),
      │ │ │ +    make_tar(RelFileName,SystoolsOpts),
      │ │ │  
      │ │ │ -    TmpDir = filename:join(Dir,"tmp"),
      │ │ │ -    io:fwrite("Creating directory ~tp ...~n",[TmpDir]),
      │ │ │ -    file:make_dir(TmpDir),
      │ │ │ -
      │ │ │ -    io:fwrite("Extracting ~ts into directory ~ts ...~n", [TarFileName,TmpDir]),
      │ │ │ -    extract_tar(TarFileName, TmpDir),
      │ │ │ -
      │ │ │ -    TmpBinDir = filename:join([TmpDir, "bin"]),
      │ │ │ -    ErtsBinDir = filename:join([TmpDir, "erts-" ++ ErtsVsn, "bin"]),
      │ │ │ -    io:fwrite("Deleting \"erl\" and \"start\" in directory ~ts ...~n",
      │ │ │ -              [ErtsBinDir]),
      │ │ │ -    file:delete(filename:join([ErtsBinDir, "erl"])),
      │ │ │ -    file:delete(filename:join([ErtsBinDir, "start"])),
      │ │ │ -
      │ │ │ -    io:fwrite("Creating temporary directory ~ts ...~n", [TmpBinDir]),
      │ │ │ -    file:make_dir(TmpBinDir),
      │ │ │ -
      │ │ │ -    io:fwrite("Copying file \"~ts.boot\" to ~ts ...~n",
      │ │ │ -              [PlainRelFileName, filename:join([TmpBinDir, "start.boot"])]),
      │ │ │ -    copy_file(PlainRelFileName++".boot",filename:join([TmpBinDir, "start.boot"])),
      │ │ │ +    TmpDir = filename:join(Dir,"tmp"),
      │ │ │ +    io:fwrite("Creating directory ~tp ...~n",[TmpDir]),
      │ │ │ +    file:make_dir(TmpDir),
      │ │ │ +
      │ │ │ +    io:fwrite("Extracting ~ts into directory ~ts ...~n", [TarFileName,TmpDir]),
      │ │ │ +    extract_tar(TarFileName, TmpDir),
      │ │ │ +
      │ │ │ +    TmpBinDir = filename:join([TmpDir, "bin"]),
      │ │ │ +    ErtsBinDir = filename:join([TmpDir, "erts-" ++ ErtsVsn, "bin"]),
      │ │ │ +    io:fwrite("Deleting \"erl\" and \"start\" in directory ~ts ...~n",
      │ │ │ +              [ErtsBinDir]),
      │ │ │ +    file:delete(filename:join([ErtsBinDir, "erl"])),
      │ │ │ +    file:delete(filename:join([ErtsBinDir, "start"])),
      │ │ │ +
      │ │ │ +    io:fwrite("Creating temporary directory ~ts ...~n", [TmpBinDir]),
      │ │ │ +    file:make_dir(TmpBinDir),
      │ │ │ +
      │ │ │ +    io:fwrite("Copying file \"~ts.boot\" to ~ts ...~n",
      │ │ │ +              [PlainRelFileName, filename:join([TmpBinDir, "start.boot"])]),
      │ │ │ +    copy_file(PlainRelFileName++".boot",filename:join([TmpBinDir, "start.boot"])),
      │ │ │  
      │ │ │ -    io:fwrite("Copying files \"epmd\", \"run_erl\" and \"to_erl\" from \n"
      │ │ │ +    io:fwrite("Copying files \"epmd\", \"run_erl\" and \"to_erl\" from \n"
      │ │ │                "~ts to ~ts ...~n",
      │ │ │ -              [ErtsBinDir, TmpBinDir]),
      │ │ │ -    copy_file(filename:join([ErtsBinDir, "epmd"]),
      │ │ │ -              filename:join([TmpBinDir, "epmd"]), [preserve]),
      │ │ │ -    copy_file(filename:join([ErtsBinDir, "run_erl"]),
      │ │ │ -              filename:join([TmpBinDir, "run_erl"]), [preserve]),
      │ │ │ -    copy_file(filename:join([ErtsBinDir, "to_erl"]),
      │ │ │ -              filename:join([TmpBinDir, "to_erl"]), [preserve]),
      │ │ │ +              [ErtsBinDir, TmpBinDir]),
      │ │ │ +    copy_file(filename:join([ErtsBinDir, "epmd"]),
      │ │ │ +              filename:join([TmpBinDir, "epmd"]), [preserve]),
      │ │ │ +    copy_file(filename:join([ErtsBinDir, "run_erl"]),
      │ │ │ +              filename:join([TmpBinDir, "run_erl"]), [preserve]),
      │ │ │ +    copy_file(filename:join([ErtsBinDir, "to_erl"]),
      │ │ │ +              filename:join([TmpBinDir, "to_erl"]), [preserve]),
      │ │ │  
      │ │ │      %% This is needed if 'start' script created from 'start.src' shall
      │ │ │      %% be used as it points out this directory as log dir for 'run_erl'
      │ │ │ -    TmpLogDir = filename:join([TmpDir, "log"]),
      │ │ │ -    io:fwrite("Creating temporary directory ~ts ...~n", [TmpLogDir]),
      │ │ │ -    ok = file:make_dir(TmpLogDir),
      │ │ │ -
      │ │ │ -    StartErlDataFile = filename:join([TmpDir, "releases", "start_erl.data"]),
      │ │ │ -    io:fwrite("Creating ~ts ...~n", [StartErlDataFile]),
      │ │ │ -    StartErlData = io_lib:fwrite("~s ~s~n", [ErtsVsn, RelVsn]),
      │ │ │ -    write_file(StartErlDataFile, StartErlData),
      │ │ │ -
      │ │ │ -    io:fwrite("Recreating tar file ~ts from contents in directory ~ts ...~n",
      │ │ │ -	      [TarFileName,TmpDir]),
      │ │ │ -    {ok, Tar} = erl_tar:open(TarFileName, [write, compressed]),
      │ │ │ +    TmpLogDir = filename:join([TmpDir, "log"]),
      │ │ │ +    io:fwrite("Creating temporary directory ~ts ...~n", [TmpLogDir]),
      │ │ │ +    ok = file:make_dir(TmpLogDir),
      │ │ │ +
      │ │ │ +    StartErlDataFile = filename:join([TmpDir, "releases", "start_erl.data"]),
      │ │ │ +    io:fwrite("Creating ~ts ...~n", [StartErlDataFile]),
      │ │ │ +    StartErlData = io_lib:fwrite("~s ~s~n", [ErtsVsn, RelVsn]),
      │ │ │ +    write_file(StartErlDataFile, StartErlData),
      │ │ │ +
      │ │ │ +    io:fwrite("Recreating tar file ~ts from contents in directory ~ts ...~n",
      │ │ │ +	      [TarFileName,TmpDir]),
      │ │ │ +    {ok, Tar} = erl_tar:open(TarFileName, [write, compressed]),
      │ │ │      %% {ok, Cwd} = file:get_cwd(),
      │ │ │      %% file:set_cwd("tmp"),
      │ │ │      ErtsDir = "erts-"++ErtsVsn,
      │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,"bin"), "bin", []),
      │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,ErtsDir), ErtsDir, []),
      │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,"releases"), "releases", []),
      │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,"lib"), "lib", []),
      │ │ │ -    erl_tar:add(Tar, filename:join(TmpDir,"log"), "log", []),
      │ │ │ -    erl_tar:close(Tar),
      │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,"bin"), "bin", []),
      │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,ErtsDir), ErtsDir, []),
      │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,"releases"), "releases", []),
      │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,"lib"), "lib", []),
      │ │ │ +    erl_tar:add(Tar, filename:join(TmpDir,"log"), "log", []),
      │ │ │ +    erl_tar:close(Tar),
      │ │ │      %% file:set_cwd(Cwd),
      │ │ │ -    io:fwrite("Removing directory ~ts ...~n",[TmpDir]),
      │ │ │ -    remove_dir_tree(TmpDir),
      │ │ │ +    io:fwrite("Removing directory ~ts ...~n",[TmpDir]),
      │ │ │ +    remove_dir_tree(TmpDir),
      │ │ │      ok.
      │ │ │  
      │ │ │  
      │ │ │ -install(RelFileName, RootDir) ->
      │ │ │ +install(RelFileName, RootDir) ->
      │ │ │      TarFile = RelFileName ++ ".tar.gz",
      │ │ │ -    io:fwrite("Extracting ~ts ...~n", [TarFile]),
      │ │ │ -    extract_tar(TarFile, RootDir),
      │ │ │ -    StartErlDataFile = filename:join([RootDir, "releases", "start_erl.data"]),
      │ │ │ -    {ok, StartErlData} = read_txt_file(StartErlDataFile),
      │ │ │ -    [ErlVsn, _RelVsn| _] = string:tokens(StartErlData, " \n"),
      │ │ │ -    ErtsBinDir = filename:join([RootDir, "erts-" ++ ErlVsn, "bin"]),
      │ │ │ -    BinDir = filename:join([RootDir, "bin"]),
      │ │ │ -    io:fwrite("Substituting in erl.src, start.src and start_erl.src to "
      │ │ │ -              "form erl, start and start_erl ...\n"),
      │ │ │ -    subst_src_scripts(["erl", "start", "start_erl"], ErtsBinDir, BinDir,
      │ │ │ -                      [{"FINAL_ROOTDIR", RootDir}, {"EMU", "beam"}],
      │ │ │ -                      [preserve]),
      │ │ │ +    io:fwrite("Extracting ~ts ...~n", [TarFile]),
      │ │ │ +    extract_tar(TarFile, RootDir),
      │ │ │ +    StartErlDataFile = filename:join([RootDir, "releases", "start_erl.data"]),
      │ │ │ +    {ok, StartErlData} = read_txt_file(StartErlDataFile),
      │ │ │ +    [ErlVsn, _RelVsn| _] = string:tokens(StartErlData, " \n"),
      │ │ │ +    ErtsBinDir = filename:join([RootDir, "erts-" ++ ErlVsn, "bin"]),
      │ │ │ +    BinDir = filename:join([RootDir, "bin"]),
      │ │ │ +    io:fwrite("Substituting in erl.src, start.src and start_erl.src to "
      │ │ │ +              "form erl, start and start_erl ...\n"),
      │ │ │ +    subst_src_scripts(["erl", "start", "start_erl"], ErtsBinDir, BinDir,
      │ │ │ +                      [{"FINAL_ROOTDIR", RootDir}, {"EMU", "beam"}],
      │ │ │ +                      [preserve]),
      │ │ │      %%! Workaround for pre OTP 17.0: start.src and start_erl.src did
      │ │ │      %%! not have correct permissions, so the above 'preserve' option did not help
      │ │ │ -    ok = file:change_mode(filename:join(BinDir,"start"),8#0755),
      │ │ │ -    ok = file:change_mode(filename:join(BinDir,"start_erl"),8#0755),
      │ │ │ +    ok = file:change_mode(filename:join(BinDir,"start"),8#0755),
      │ │ │ +    ok = file:change_mode(filename:join(BinDir,"start_erl"),8#0755),
      │ │ │  
      │ │ │ -    io:fwrite("Creating the RELEASES file ...\n"),
      │ │ │ -    create_RELEASES(RootDir, filename:join([RootDir, "releases",
      │ │ │ -					    filename:basename(RelFileName)])).
      │ │ │ +    io:fwrite("Creating the RELEASES file ...\n"),
      │ │ │ +    create_RELEASES(RootDir, filename:join([RootDir, "releases",
      │ │ │ +					    filename:basename(RelFileName)])).
      │ │ │  
      │ │ │  %% LOCALS
      │ │ │  
      │ │ │  %% make_script(RelFileName,Opts)
      │ │ │  %%
      │ │ │ -make_script(RelFileName,Opts) ->
      │ │ │ -    systools:make_script(RelFileName, [no_module_tests,
      │ │ │ -				       {outdir,filename:dirname(RelFileName)}
      │ │ │ -				       |Opts]).
      │ │ │ +make_script(RelFileName,Opts) ->
      │ │ │ +    systools:make_script(RelFileName, [no_module_tests,
      │ │ │ +				       {outdir,filename:dirname(RelFileName)}
      │ │ │ +				       |Opts]).
      │ │ │  
      │ │ │  %% make_tar(RelFileName,Opts)
      │ │ │  %%
      │ │ │ -make_tar(RelFileName,Opts) ->
      │ │ │ -    RootDir = code:root_dir(),
      │ │ │ -    systools:make_tar(RelFileName, [{erts, RootDir},
      │ │ │ -				    {outdir,filename:dirname(RelFileName)}
      │ │ │ -				    |Opts]).
      │ │ │ +make_tar(RelFileName,Opts) ->
      │ │ │ +    RootDir = code:root_dir(),
      │ │ │ +    systools:make_tar(RelFileName, [{erts, RootDir},
      │ │ │ +				    {outdir,filename:dirname(RelFileName)}
      │ │ │ +				    |Opts]).
      │ │ │  
      │ │ │  %% extract_tar(TarFile, DestDir)
      │ │ │  %%
      │ │ │ -extract_tar(TarFile, DestDir) ->
      │ │ │ -    erl_tar:extract(TarFile, [{cwd, DestDir}, compressed]).
      │ │ │ +extract_tar(TarFile, DestDir) ->
      │ │ │ +    erl_tar:extract(TarFile, [{cwd, DestDir}, compressed]).
      │ │ │  
      │ │ │ -create_RELEASES(DestDir, RelFileName) ->
      │ │ │ -    release_handler:create_RELEASES(DestDir, RelFileName ++ ".rel").
      │ │ │ +create_RELEASES(DestDir, RelFileName) ->
      │ │ │ +    release_handler:create_RELEASES(DestDir, RelFileName ++ ".rel").
      │ │ │  
      │ │ │ -subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) ->
      │ │ │ -    lists:foreach(fun(Script) ->
      │ │ │ -                          subst_src_script(Script, SrcDir, DestDir,
      │ │ │ -                                           Vars, Opts)
      │ │ │ -                  end, Scripts).
      │ │ │ -
      │ │ │ -subst_src_script(Script, SrcDir, DestDir, Vars, Opts) ->
      │ │ │ -    subst_file(filename:join([SrcDir, Script ++ ".src"]),
      │ │ │ -               filename:join([DestDir, Script]),
      │ │ │ -               Vars, Opts).
      │ │ │ -
      │ │ │ -subst_file(Src, Dest, Vars, Opts) ->
      │ │ │ -    {ok, Conts} = read_txt_file(Src),
      │ │ │ -    NConts = subst(Conts, Vars),
      │ │ │ -    write_file(Dest, NConts),
      │ │ │ -    case lists:member(preserve, Opts) of
      │ │ │ +subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) ->
      │ │ │ +    lists:foreach(fun(Script) ->
      │ │ │ +                          subst_src_script(Script, SrcDir, DestDir,
      │ │ │ +                                           Vars, Opts)
      │ │ │ +                  end, Scripts).
      │ │ │ +
      │ │ │ +subst_src_script(Script, SrcDir, DestDir, Vars, Opts) ->
      │ │ │ +    subst_file(filename:join([SrcDir, Script ++ ".src"]),
      │ │ │ +               filename:join([DestDir, Script]),
      │ │ │ +               Vars, Opts).
      │ │ │ +
      │ │ │ +subst_file(Src, Dest, Vars, Opts) ->
      │ │ │ +    {ok, Conts} = read_txt_file(Src),
      │ │ │ +    NConts = subst(Conts, Vars),
      │ │ │ +    write_file(Dest, NConts),
      │ │ │ +    case lists:member(preserve, Opts) of
      │ │ │          true ->
      │ │ │ -            {ok, FileInfo} = file:read_file_info(Src),
      │ │ │ -            file:write_file_info(Dest, FileInfo);
      │ │ │ +            {ok, FileInfo} = file:read_file_info(Src),
      │ │ │ +            file:write_file_info(Dest, FileInfo);
      │ │ │          false ->
      │ │ │              ok
      │ │ │      end.
      │ │ │  
      │ │ │  %% subst(Str, Vars)
      │ │ │  %% Vars = [{Var, Val}]
      │ │ │  %% Var = Val = string()
      │ │ │  %% Substitute all occurrences of %Var% for Val in Str, using the list
      │ │ │  %% of variables in Vars.
      │ │ │  %%
      │ │ │ -subst(Str, Vars) ->
      │ │ │ -    subst(Str, Vars, []).
      │ │ │ +subst(Str, Vars) ->
      │ │ │ +    subst(Str, Vars, []).
      │ │ │  
      │ │ │ -subst([$%, C| Rest], Vars, Result) when $A =< C, C =< $Z ->
      │ │ │ -    subst_var([C| Rest], Vars, Result, []);
      │ │ │ -subst([$%, C| Rest], Vars, Result) when $a =< C, C =< $z ->
      │ │ │ -    subst_var([C| Rest], Vars, Result, []);
      │ │ │ -subst([$%, C| Rest], Vars, Result) when  C == $_ ->
      │ │ │ -    subst_var([C| Rest], Vars, Result, []);
      │ │ │ -subst([C| Rest], Vars, Result) ->
      │ │ │ -    subst(Rest, Vars, [C| Result]);
      │ │ │ -subst([], _Vars, Result) ->
      │ │ │ -    lists:reverse(Result).
      │ │ │ -
      │ │ │ -subst_var([$%| Rest], Vars, Result, VarAcc) ->
      │ │ │ -    Key = lists:reverse(VarAcc),
      │ │ │ -    case lists:keysearch(Key, 1, Vars) of
      │ │ │ -        {value, {Key, Value}} ->
      │ │ │ -            subst(Rest, Vars, lists:reverse(Value, Result));
      │ │ │ +subst([$%, C| Rest], Vars, Result) when $A =< C, C =< $Z ->
      │ │ │ +    subst_var([C| Rest], Vars, Result, []);
      │ │ │ +subst([$%, C| Rest], Vars, Result) when $a =< C, C =< $z ->
      │ │ │ +    subst_var([C| Rest], Vars, Result, []);
      │ │ │ +subst([$%, C| Rest], Vars, Result) when  C == $_ ->
      │ │ │ +    subst_var([C| Rest], Vars, Result, []);
      │ │ │ +subst([C| Rest], Vars, Result) ->
      │ │ │ +    subst(Rest, Vars, [C| Result]);
      │ │ │ +subst([], _Vars, Result) ->
      │ │ │ +    lists:reverse(Result).
      │ │ │ +
      │ │ │ +subst_var([$%| Rest], Vars, Result, VarAcc) ->
      │ │ │ +    Key = lists:reverse(VarAcc),
      │ │ │ +    case lists:keysearch(Key, 1, Vars) of
      │ │ │ +        {value, {Key, Value}} ->
      │ │ │ +            subst(Rest, Vars, lists:reverse(Value, Result));
      │ │ │          false ->
      │ │ │ -            subst(Rest, Vars, [$%| VarAcc ++ [$%| Result]])
      │ │ │ +            subst(Rest, Vars, [$%| VarAcc ++ [$%| Result]])
      │ │ │      end;
      │ │ │ -subst_var([C| Rest], Vars, Result, VarAcc) ->
      │ │ │ -    subst_var(Rest, Vars, Result, [C| VarAcc]);
      │ │ │ -subst_var([], Vars, Result, VarAcc) ->
      │ │ │ -    subst([], Vars, [VarAcc ++ [$%| Result]]).
      │ │ │ -
      │ │ │ -copy_file(Src, Dest) ->
      │ │ │ -    copy_file(Src, Dest, []).
      │ │ │ -
      │ │ │ -copy_file(Src, Dest, Opts) ->
      │ │ │ -    {ok,_} = file:copy(Src, Dest),
      │ │ │ -    case lists:member(preserve, Opts) of
      │ │ │ +subst_var([C| Rest], Vars, Result, VarAcc) ->
      │ │ │ +    subst_var(Rest, Vars, Result, [C| VarAcc]);
      │ │ │ +subst_var([], Vars, Result, VarAcc) ->
      │ │ │ +    subst([], Vars, [VarAcc ++ [$%| Result]]).
      │ │ │ +
      │ │ │ +copy_file(Src, Dest) ->
      │ │ │ +    copy_file(Src, Dest, []).
      │ │ │ +
      │ │ │ +copy_file(Src, Dest, Opts) ->
      │ │ │ +    {ok,_} = file:copy(Src, Dest),
      │ │ │ +    case lists:member(preserve, Opts) of
      │ │ │          true ->
      │ │ │ -            {ok, FileInfo} = file:read_file_info(Src),
      │ │ │ -            file:write_file_info(Dest, FileInfo);
      │ │ │ +            {ok, FileInfo} = file:read_file_info(Src),
      │ │ │ +            file:write_file_info(Dest, FileInfo);
      │ │ │          false ->
      │ │ │              ok
      │ │ │      end.
      │ │ │  
      │ │ │ -write_file(FName, Conts) ->
      │ │ │ -    Enc = file:native_name_encoding(),
      │ │ │ -    {ok, Fd} = file:open(FName, [write]),
      │ │ │ -    file:write(Fd, unicode:characters_to_binary(Conts,Enc,Enc)),
      │ │ │ -    file:close(Fd).
      │ │ │ -
      │ │ │ -read_txt_file(File) ->
      │ │ │ -    {ok, Bin} = file:read_file(File),
      │ │ │ -    {ok, binary_to_list(Bin)}.
      │ │ │ -
      │ │ │ -remove_dir_tree(Dir) ->
      │ │ │ -    remove_all_files(".", [Dir]).
      │ │ │ -
      │ │ │ -remove_all_files(Dir, Files) ->
      │ │ │ -    lists:foreach(fun(File) ->
      │ │ │ -                          FilePath = filename:join([Dir, File]),
      │ │ │ -                          case filelib:is_dir(FilePath) of
      │ │ │ +write_file(FName, Conts) ->
      │ │ │ +    Enc = file:native_name_encoding(),
      │ │ │ +    {ok, Fd} = file:open(FName, [write]),
      │ │ │ +    file:write(Fd, unicode:characters_to_binary(Conts,Enc,Enc)),
      │ │ │ +    file:close(Fd).
      │ │ │ +
      │ │ │ +read_txt_file(File) ->
      │ │ │ +    {ok, Bin} = file:read_file(File),
      │ │ │ +    {ok, binary_to_list(Bin)}.
      │ │ │ +
      │ │ │ +remove_dir_tree(Dir) ->
      │ │ │ +    remove_all_files(".", [Dir]).
      │ │ │ +
      │ │ │ +remove_all_files(Dir, Files) ->
      │ │ │ +    lists:foreach(fun(File) ->
      │ │ │ +                          FilePath = filename:join([Dir, File]),
      │ │ │ +                          case filelib:is_dir(FilePath) of
      │ │ │                                true ->
      │ │ │ -                                  {ok, DirFiles} = file:list_dir(FilePath),
      │ │ │ -                                  remove_all_files(FilePath, DirFiles),
      │ │ │ -                                  file:del_dir(FilePath);
      │ │ │ +                                  {ok, DirFiles} = file:list_dir(FilePath),
      │ │ │ +                                  remove_all_files(FilePath, DirFiles),
      │ │ │ +                                  file:del_dir(FilePath);
      │ │ │                                _ ->
      │ │ │ -                                  file:delete(FilePath)
      │ │ │ +                                  file:delete(FilePath)
      │ │ │                            end
      │ │ │ -                  end, Files).
      │ │ │ + end, Files).
      │ │ │ │ │ │ │ │ │
      │ │ │
      │ │ │ │ │ │ │ │ │ Representation of Floating Point Numbers │ │ │ │ │ │

      When working with floats you may not see what you expect when printing or doing │ │ │ arithmetic operations. This is because floats are represented by a fixed number │ │ │ of bits in a base-2 system while printed floats are represented with a base-10 │ │ │ system. Erlang uses 64-bit floats. Here are examples of this phenomenon:

      1> 0.1+0.2.
      │ │ │ -0.30000000000000004

      The real numbers 0.1 and 0.2 cannot be represented exactly as floats.

      1> {36028797018963968.0, 36028797018963968 == 36028797018963968.0,
      │ │ │ -  36028797018963970.0, 36028797018963970 == 36028797018963970.0}.
      │ │ │ -{3.602879701896397e16, true,
      │ │ │ - 3.602879701896397e16, false}.

      The value 36028797018963968 can be represented exactly as a float value but │ │ │ +0.30000000000000004

    The real numbers 0.1 and 0.2 cannot be represented exactly as floats.

    1> {36028797018963968.0, 36028797018963968 == 36028797018963968.0,
    │ │ │ +  36028797018963970.0, 36028797018963970 == 36028797018963970.0}.
    │ │ │ +{3.602879701896397e16, true,
    │ │ │ + 3.602879701896397e16, false}.

    The value 36028797018963968 can be represented exactly as a float value but │ │ │ Erlang's pretty printer rounds 36028797018963968.0 to 3.602879701896397e16 │ │ │ (=36028797018963970.0) as all values in the range │ │ │ [36028797018963966.0, 36028797018963972.0] are represented by │ │ │ 36028797018963968.0.

    For more information about floats and issues with them see:

    If you need to work with exact decimal fractions, for instance to represent │ │ │ money, it is recommended to use a library that handles that, or work in │ │ │ cents instead of dollars or euros so that decimal fractions are not needed.

    Also note that Erlang's floats do not exactly match IEEE 754 floats, │ │ │ in that neither Inf nor NaN are supported in Erlang. Any │ │ │ @@ -237,52 +237,52 @@ │ │ │ by eight are called binaries.

    Examples:

    1> <<10,20>>.
    │ │ │  <<10,20>>
    │ │ │  2> <<"ABC">>.
    │ │ │  <<"ABC">>
    │ │ │  3> <<1:1,0:1>>.
    │ │ │  <<2:2>>

    The is_bitstring/1 BIF tests whether a │ │ │ term is a bit string, and the is_binary/1 │ │ │ -BIF tests whether a term is a binary.

    Examples:

    1> is_bitstring(<<1:1>>).
    │ │ │ +BIF tests whether a term is a binary.

    Examples:

    1> is_bitstring(<<1:1>>).
    │ │ │  true
    │ │ │ -2> is_binary(<<1:1>>).
    │ │ │ +2> is_binary(<<1:1>>).
    │ │ │  false
    │ │ │ -3> is_binary(<<42>>).
    │ │ │ +3> is_binary(<<42>>).
    │ │ │  true
    │ │ │  

    For more examples, see Programming Examples.

    │ │ │ │ │ │ │ │ │ │ │ │ Reference │ │ │

    │ │ │

    A term that is unique │ │ │ among connected nodes. A reference is created by calling the │ │ │ make_ref/0 BIF. The │ │ │ is_reference/1 BIF tests whether a term │ │ │ -is a reference.

    Examples:

    1> Ref = make_ref().
    │ │ │ +is a reference.

    Examples:

    1> Ref = make_ref().
    │ │ │  #Ref<0.76482849.3801088007.198204>
    │ │ │ -2> is_reference(Ref).
    │ │ │ +2> is_reference(Ref).
    │ │ │  true

    │ │ │ │ │ │ │ │ │ │ │ │ Fun │ │ │

    │ │ │

    A fun is a functional object. Funs make it possible to create an anonymous │ │ │ function and pass the function itself — not its name — as argument to other │ │ │ -functions.

    Examples:

    1> Fun1 = fun (X) -> X+1 end.
    │ │ │ +functions.

    Examples:

    1> Fun1 = fun (X) -> X+1 end.
    │ │ │  #Fun<erl_eval.6.39074546>
    │ │ │ -2> Fun1(2).
    │ │ │ +2> Fun1(2).
    │ │ │  3

    The is_function/1 and is_function/2 │ │ │ -BIFs tests whether a term is a fun.

    Examples:

    1> F = fun() -> ok end.
    │ │ │ +BIFs tests whether a term is a fun.

    Examples:

    1> F = fun() -> ok end.
    │ │ │  #Fun<erl_eval.43.105768164>
    │ │ │ -2> is_function(F).
    │ │ │ +2> is_function(F).
    │ │ │  true
    │ │ │ -3> is_function(F, 0).
    │ │ │ +3> is_function(F, 0).
    │ │ │  true
    │ │ │ -4> is_function(F, 1).
    │ │ │ +4> is_function(F, 1).
    │ │ │  false

    Read more about funs in Fun Expressions. For more │ │ │ examples, see Programming Examples.

    │ │ │ │ │ │ │ │ │ │ │ │ Port Identifier │ │ │

    │ │ │ @@ -300,94 +300,94 @@ │ │ │ for a new process after a while.

    The BIF self/0 returns the Pid of the calling process. When │ │ │ creating a new process, the parent │ │ │ process will be able to get the Pid of the child process either via the return │ │ │ value, as is the case when calling the spawn/3 BIF, or via │ │ │ a message, which is the case when calling the │ │ │ spawn_request/5 BIF. A Pid is typically used when │ │ │ when sending a process a signal. The │ │ │ -is_pid/1 BIF tests whether a term is a Pid.

    Example:

    -module(m).
    │ │ │ --export([loop/0]).
    │ │ │ +is_pid/1 BIF tests whether a term is a Pid.

    Example:

    -module(m).
    │ │ │ +-export([loop/0]).
    │ │ │  
    │ │ │ -loop() ->
    │ │ │ +loop() ->
    │ │ │      receive
    │ │ │          who_are_you ->
    │ │ │ -            io:format("I am ~p~n", [self()]),
    │ │ │ -            loop()
    │ │ │ +            io:format("I am ~p~n", [self()]),
    │ │ │ +            loop()
    │ │ │      end.
    │ │ │  
    │ │ │ -1> P = spawn(m, loop, []).
    │ │ │ +1> P = spawn(m, loop, []).
    │ │ │  <0.58.0>
    │ │ │  2> P ! who_are_you.
    │ │ │  I am <0.58.0>
    │ │ │  who_are_you

    Read more about processes in Processes.

    │ │ │ │ │ │ │ │ │ │ │ │ Tuple │ │ │

    │ │ │

    A tuple is a compound data type with a fixed number of terms:

    {Term1,...,TermN}

    Each term Term in the tuple is called an element. The number of elements is │ │ │ -said to be the size of the tuple.

    There exists a number of BIFs to manipulate tuples.

    Examples:

    1> P = {adam,24,{july,29}}.
    │ │ │ -{adam,24,{july,29}}
    │ │ │ -2> element(1,P).
    │ │ │ +said to be the size of the tuple.

    There exists a number of BIFs to manipulate tuples.

    Examples:

    1> P = {adam,24,{july,29}}.
    │ │ │ +{adam,24,{july,29}}
    │ │ │ +2> element(1,P).
    │ │ │  adam
    │ │ │ -3> element(3,P).
    │ │ │ -{july,29}
    │ │ │ -4> P2 = setelement(2,P,25).
    │ │ │ -{adam,25,{july,29}}
    │ │ │ -5> tuple_size(P).
    │ │ │ +3> element(3,P).
    │ │ │ +{july,29}
    │ │ │ +4> P2 = setelement(2,P,25).
    │ │ │ +{adam,25,{july,29}}
    │ │ │ +5> tuple_size(P).
    │ │ │  3
    │ │ │ -6> tuple_size({}).
    │ │ │ +6> tuple_size({}).
    │ │ │  0
    │ │ │ -7> is_tuple({a,b,c}).
    │ │ │ +7> is_tuple({a,b,c}).
    │ │ │  true

    │ │ │ │ │ │ │ │ │ │ │ │ Map │ │ │

    │ │ │

    A map is a compound data type with a variable number of key-value associations:

    #{Key1 => Value1, ..., KeyN => ValueN}

    Each key-value association in the map is called an association pair. The key │ │ │ and value parts of the pair are called elements. The number of association │ │ │ -pairs is said to be the size of the map.

    There exists a number of BIFs to manipulate maps.

    Examples:

    1> M1 = #{name => adam, age => 24, date => {july,29}}.
    │ │ │ -#{age => 24,date => {july,29},name => adam}
    │ │ │ -2> maps:get(name, M1).
    │ │ │ +pairs is said to be the size of the map.

    There exists a number of BIFs to manipulate maps.

    Examples:

    1> M1 = #{name => adam, age => 24, date => {july,29}}.
    │ │ │ +#{age => 24,date => {july,29},name => adam}
    │ │ │ +2> maps:get(name, M1).
    │ │ │  adam
    │ │ │ -3> maps:get(date, M1).
    │ │ │ -{july,29}
    │ │ │ -4> M2 = maps:update(age, 25, M1).
    │ │ │ -#{age => 25,date => {july,29},name => adam}
    │ │ │ -5> map_size(M).
    │ │ │ +3> maps:get(date, M1).
    │ │ │ +{july,29}
    │ │ │ +4> M2 = maps:update(age, 25, M1).
    │ │ │ +#{age => 25,date => {july,29},name => adam}
    │ │ │ +5> map_size(M).
    │ │ │  3
    │ │ │ -6> map_size(#{}).
    │ │ │ +6> map_size(#{}).
    │ │ │  0

    A collection of maps processing functions are found in module maps │ │ │ in STDLIB.

    Read more about maps in Map Expressions.

    Change

    Maps were introduced as an experimental feature in Erlang/OTP R17. Their │ │ │ functionality was extended and became fully supported in Erlang/OTP 18.

    │ │ │ │ │ │ │ │ │ │ │ │ List │ │ │

    │ │ │

    A list is a compound data type with a variable number of terms.

    [Term1,...,TermN]

    Each term Term in the list is called an element. The number of elements is │ │ │ said to be the length of the list.

    Formally, a list is either the empty list [] or consists of a head (first │ │ │ element) and a tail (remainder of the list). The tail is also a list. The │ │ │ latter can be expressed as [H|T]. The notation [Term1,...,TermN] above is │ │ │ equivalent with the list [Term1|[...|[TermN|[]]]].

    Example:

    [] is a list, thus
    [c|[]] is a list, thus
    [b|[c|[]]] is a list, thus
    [a|[b|[c|[]]]] is a list, or in short [a,b,c]

    A list where the tail is a list is sometimes called a proper list. It is │ │ │ allowed to have a list where the tail is not a list, for example, [a|b]. │ │ │ -However, this type of list is of little practical use.

    Examples:

    1> L1 = [a,2,{c,4}].
    │ │ │ -[a,2,{c,4}]
    │ │ │ -2> [H|T] = L1.
    │ │ │ -[a,2,{c,4}]
    │ │ │ +However, this type of list is of little practical use.

    Examples:

    1> L1 = [a,2,{c,4}].
    │ │ │ +[a,2,{c,4}]
    │ │ │ +2> [H|T] = L1.
    │ │ │ +[a,2,{c,4}]
    │ │ │  3> H.
    │ │ │  a
    │ │ │  4> T.
    │ │ │ -[2,{c,4}]
    │ │ │ -5> L2 = [d|T].
    │ │ │ -[d,2,{c,4}]
    │ │ │ -6> length(L1).
    │ │ │ +[2,{c,4}]
    │ │ │ +5> L2 = [d|T].
    │ │ │ +[d,2,{c,4}]
    │ │ │ +6> length(L1).
    │ │ │  3
    │ │ │ -7> length([]).
    │ │ │ +7> length([]).
    │ │ │  0

    A collection of list processing functions are found in module │ │ │ lists in STDLIB.

    │ │ │ │ │ │ │ │ │ │ │ │ String │ │ │

    │ │ │ @@ -507,41 +507,41 @@ │ │ │ Record │ │ │ │ │ │

    A record is a data structure for storing a fixed number of elements. It has │ │ │ named fields and is similar to a struct in C. However, a record is not a true │ │ │ data type. Instead, record expressions are translated to tuple expressions │ │ │ during compilation. Therefore, record expressions are not understood by the │ │ │ shell unless special actions are taken. For details, see module shell │ │ │ -in STDLIB.

    Examples:

    -module(person).
    │ │ │ --export([new/2]).
    │ │ │ +in STDLIB.

    Examples:

    -module(person).
    │ │ │ +-export([new/2]).
    │ │ │  
    │ │ │ --record(person, {name, age}).
    │ │ │ +-record(person, {name, age}).
    │ │ │  
    │ │ │ -new(Name, Age) ->
    │ │ │ -    #person{name=Name, age=Age}.
    │ │ │ +new(Name, Age) ->
    │ │ │ +    #person{name=Name, age=Age}.
    │ │ │  
    │ │ │ -1> person:new(ernie, 44).
    │ │ │ -{person,ernie,44}

    Read more about records in Records. More examples are │ │ │ +1> person:new(ernie, 44). │ │ │ +{person,ernie,44}

    Read more about records in Records. More examples are │ │ │ found in Programming Examples.

    │ │ │ │ │ │ │ │ │ │ │ │ Boolean │ │ │

    │ │ │

    There is no Boolean data type in Erlang. Instead the atoms true and false │ │ │ are used to denote Boolean values. The is_boolean/1 │ │ │ BIF tests whether a term is a boolean.

    Examples:

    1> 2 =< 3.
    │ │ │  true
    │ │ │  2> true or false.
    │ │ │  true
    │ │ │ -3> is_boolean(true).
    │ │ │ +3> is_boolean(true).
    │ │ │  true
    │ │ │ -4> is_boolean(false).
    │ │ │ +4> is_boolean(false).
    │ │ │  true
    │ │ │ -5> is_boolean(ok).
    │ │ │ +5> is_boolean(ok).
    │ │ │  false

    │ │ │ │ │ │ │ │ │ │ │ │ Escape Sequences │ │ │

    │ │ │

    Within strings ("-delimited), quoted atoms, and the content of │ │ │ @@ -559,47 +559,47 @@ │ │ │ ~b or ~s sigils the escape sequences for normal │ │ │ strings, above, are used.

    Change

    Triple-quoted strings and sigils were introduced in Erlang/OTP 27.

    │ │ │ │ │ │ │ │ │ │ │ │ Type Conversions │ │ │

    │ │ │ -

    There are a number of BIFs for type conversions.

    Examples:

    1> atom_to_list(hello).
    │ │ │ +

    There are a number of BIFs for type conversions.

    Examples:

    1> atom_to_list(hello).
    │ │ │  "hello"
    │ │ │ -2> list_to_atom("hello").
    │ │ │ +2> list_to_atom("hello").
    │ │ │  hello
    │ │ │ -3> binary_to_list(<<"hello">>).
    │ │ │ +3> binary_to_list(<<"hello">>).
    │ │ │  "hello"
    │ │ │ -4> binary_to_list(<<104,101,108,108,111>>).
    │ │ │ +4> binary_to_list(<<104,101,108,108,111>>).
    │ │ │  "hello"
    │ │ │ -5> list_to_binary("hello").
    │ │ │ -<<104,101,108,108,111>>
    │ │ │ -6> float_to_list(7.0).
    │ │ │ +5> list_to_binary("hello").
    │ │ │ +<<104,101,108,108,111>>
    │ │ │ +6> float_to_list(7.0).
    │ │ │  "7.00000000000000000000e+00"
    │ │ │ -7> list_to_float("7.000e+00").
    │ │ │ +7> list_to_float("7.000e+00").
    │ │ │  7.0
    │ │ │ -8> integer_to_list(77).
    │ │ │ +8> integer_to_list(77).
    │ │ │  "77"
    │ │ │ -9> list_to_integer("77").
    │ │ │ +9> list_to_integer("77").
    │ │ │  77
    │ │ │ -10> tuple_to_list({a,b,c}).
    │ │ │ -[a,b,c]
    │ │ │ -11> list_to_tuple([a,b,c]).
    │ │ │ -{a,b,c}
    │ │ │ -12> term_to_binary({a,b,c}).
    │ │ │ -<<131,104,3,100,0,1,97,100,0,1,98,100,0,1,99>>
    │ │ │ -13> binary_to_term(<<131,104,3,100,0,1,97,100,0,1,98,100,0,1,99>>).
    │ │ │ -{a,b,c}
    │ │ │ -14> binary_to_integer(<<"77">>).
    │ │ │ +10> tuple_to_list({a,b,c}).
    │ │ │ +[a,b,c]
    │ │ │ +11> list_to_tuple([a,b,c]).
    │ │ │ +{a,b,c}
    │ │ │ +12> term_to_binary({a,b,c}).
    │ │ │ +<<131,104,3,100,0,1,97,100,0,1,98,100,0,1,99>>
    │ │ │ +13> binary_to_term(<<131,104,3,100,0,1,97,100,0,1,98,100,0,1,99>>).
    │ │ │ +{a,b,c}
    │ │ │ +14> binary_to_integer(<<"77">>).
    │ │ │  77
    │ │ │ -15> integer_to_binary(77).
    │ │ │ -<<"77">>
    │ │ │ -16> float_to_binary(7.0).
    │ │ │ -<<"7.00000000000000000000e+00">>
    │ │ │ -17> binary_to_float(<<"7.000e+00">>).
    │ │ │ +15> integer_to_binary(77).
    │ │ │ +<<"77">>
    │ │ │ +16> float_to_binary(7.0).
    │ │ │ +<<"7.00000000000000000000e+00">>
    │ │ │ +17> binary_to_float(<<"7.000e+00">>).
    │ │ │  7.0
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │

    -module(ch1).
    │ │ │ --export([start/0]).
    │ │ │ --export([alloc/0, free/1]).
    │ │ │ --export([init/0]).
    │ │ │ +respectively.

    -module(ch1).
    │ │ │ +-export([start/0]).
    │ │ │ +-export([alloc/0, free/1]).
    │ │ │ +-export([init/0]).
    │ │ │  
    │ │ │ -start() ->
    │ │ │ -    spawn(ch1, init, []).
    │ │ │ +start() ->
    │ │ │ +    spawn(ch1, init, []).
    │ │ │  
    │ │ │ -alloc() ->
    │ │ │ -    ch1 ! {self(), alloc},
    │ │ │ +alloc() ->
    │ │ │ +    ch1 ! {self(), alloc},
    │ │ │      receive
    │ │ │ -        {ch1, Res} ->
    │ │ │ +        {ch1, Res} ->
    │ │ │              Res
    │ │ │      end.
    │ │ │  
    │ │ │ -free(Ch) ->
    │ │ │ -    ch1 ! {free, Ch},
    │ │ │ +free(Ch) ->
    │ │ │ +    ch1 ! {free, Ch},
    │ │ │      ok.
    │ │ │  
    │ │ │ -init() ->
    │ │ │ -    register(ch1, self()),
    │ │ │ -    Chs = channels(),
    │ │ │ -    loop(Chs).
    │ │ │ +init() ->
    │ │ │ +    register(ch1, self()),
    │ │ │ +    Chs = channels(),
    │ │ │ +    loop(Chs).
    │ │ │  
    │ │ │ -loop(Chs) ->
    │ │ │ +loop(Chs) ->
    │ │ │      receive
    │ │ │ -        {From, alloc} ->
    │ │ │ -            {Ch, Chs2} = alloc(Chs),
    │ │ │ -            From ! {ch1, Ch},
    │ │ │ -            loop(Chs2);
    │ │ │ -        {free, Ch} ->
    │ │ │ -            Chs2 = free(Ch, Chs),
    │ │ │ -            loop(Chs2)
    │ │ │ -    end.

    The code for the server can be rewritten into a generic part server.erl:

    -module(server).
    │ │ │ --export([start/1]).
    │ │ │ --export([call/2, cast/2]).
    │ │ │ --export([init/1]).
    │ │ │ +        {From, alloc} ->
    │ │ │ +            {Ch, Chs2} = alloc(Chs),
    │ │ │ +            From ! {ch1, Ch},
    │ │ │ +            loop(Chs2);
    │ │ │ +        {free, Ch} ->
    │ │ │ +            Chs2 = free(Ch, Chs),
    │ │ │ +            loop(Chs2)
    │ │ │ +    end.

    The code for the server can be rewritten into a generic part server.erl:

    -module(server).
    │ │ │ +-export([start/1]).
    │ │ │ +-export([call/2, cast/2]).
    │ │ │ +-export([init/1]).
    │ │ │  
    │ │ │ -start(Mod) ->
    │ │ │ -    spawn(server, init, [Mod]).
    │ │ │ +start(Mod) ->
    │ │ │ +    spawn(server, init, [Mod]).
    │ │ │  
    │ │ │ -call(Name, Req) ->
    │ │ │ -    Name ! {call, self(), Req},
    │ │ │ +call(Name, Req) ->
    │ │ │ +    Name ! {call, self(), Req},
    │ │ │      receive
    │ │ │ -        {Name, Res} ->
    │ │ │ +        {Name, Res} ->
    │ │ │              Res
    │ │ │      end.
    │ │ │  
    │ │ │ -cast(Name, Req) ->
    │ │ │ -    Name ! {cast, Req},
    │ │ │ +cast(Name, Req) ->
    │ │ │ +    Name ! {cast, Req},
    │ │ │      ok.
    │ │ │  
    │ │ │ -init(Mod) ->
    │ │ │ -    register(Mod, self()),
    │ │ │ -    State = Mod:init(),
    │ │ │ -    loop(Mod, State).
    │ │ │ +init(Mod) ->
    │ │ │ +    register(Mod, self()),
    │ │ │ +    State = Mod:init(),
    │ │ │ +    loop(Mod, State).
    │ │ │  
    │ │ │ -loop(Mod, State) ->
    │ │ │ +loop(Mod, State) ->
    │ │ │      receive
    │ │ │ -        {call, From, Req} ->
    │ │ │ -            {Res, State2} = Mod:handle_call(Req, State),
    │ │ │ -            From ! {Mod, Res},
    │ │ │ -            loop(Mod, State2);
    │ │ │ -        {cast, Req} ->
    │ │ │ -            State2 = Mod:handle_cast(Req, State),
    │ │ │ -            loop(Mod, State2)
    │ │ │ -    end.

    And a callback module ch2.erl:

    -module(ch2).
    │ │ │ --export([start/0]).
    │ │ │ --export([alloc/0, free/1]).
    │ │ │ --export([init/0, handle_call/2, handle_cast/2]).
    │ │ │ -
    │ │ │ -start() ->
    │ │ │ -    server:start(ch2).
    │ │ │ -
    │ │ │ -alloc() ->
    │ │ │ -    server:call(ch2, alloc).
    │ │ │ -
    │ │ │ -free(Ch) ->
    │ │ │ -    server:cast(ch2, {free, Ch}).
    │ │ │ +        {call, From, Req} ->
    │ │ │ +            {Res, State2} = Mod:handle_call(Req, State),
    │ │ │ +            From ! {Mod, Res},
    │ │ │ +            loop(Mod, State2);
    │ │ │ +        {cast, Req} ->
    │ │ │ +            State2 = Mod:handle_cast(Req, State),
    │ │ │ +            loop(Mod, State2)
    │ │ │ +    end.

    And a callback module ch2.erl:

    -module(ch2).
    │ │ │ +-export([start/0]).
    │ │ │ +-export([alloc/0, free/1]).
    │ │ │ +-export([init/0, handle_call/2, handle_cast/2]).
    │ │ │ +
    │ │ │ +start() ->
    │ │ │ +    server:start(ch2).
    │ │ │ +
    │ │ │ +alloc() ->
    │ │ │ +    server:call(ch2, alloc).
    │ │ │ +
    │ │ │ +free(Ch) ->
    │ │ │ +    server:cast(ch2, {free, Ch}).
    │ │ │  
    │ │ │ -init() ->
    │ │ │ -    channels().
    │ │ │ +init() ->
    │ │ │ +    channels().
    │ │ │  
    │ │ │ -handle_call(alloc, Chs) ->
    │ │ │ -    alloc(Chs). % => {Ch,Chs2}
    │ │ │ +handle_call(alloc, Chs) ->
    │ │ │ +    alloc(Chs). % => {Ch,Chs2}
    │ │ │  
    │ │ │ -handle_cast({free, Ch}, Chs) ->
    │ │ │ -    free(Ch, Chs). % => Chs2

    Notice the following:

    • The code in server can be reused to build many different servers.
    • The server name, in this example the atom ch2, is hidden from the users of │ │ │ +handle_cast({free, Ch}, Chs) -> │ │ │ + free(Ch, Chs). % => Chs2

    Notice the following:

    • The code in server can be reused to build many different servers.
    • The server name, in this example the atom ch2, is hidden from the users of │ │ │ the client functions. This means that the name can be changed without │ │ │ affecting them.
    • The protocol (messages sent to and received from the server) is also hidden. │ │ │ This is good programming practice and allows one to change the protocol │ │ │ without changing the code using the interface functions.
    • The functionality of server can be extended without having to change ch2 │ │ │ or any other callback module.

    In ch1.erl and ch2.erl above, the implementation of channels/0, alloc/1, │ │ │ and free/2 has been intentionally left out, as it is not relevant to the │ │ │ example. For completeness, one way to write these functions is given below. This │ │ │ is an example only, a realistic implementation must be able to handle situations │ │ │ -like running out of channels to allocate, and so on.

    channels() ->
    │ │ │ -   {_Allocated = [], _Free = lists:seq(1, 100)}.
    │ │ │ +like running out of channels to allocate, and so on.

    channels() ->
    │ │ │ +   {_Allocated = [], _Free = lists:seq(1, 100)}.
    │ │ │  
    │ │ │ -alloc({Allocated, [H|T] = _Free}) ->
    │ │ │ -   {H, {[H|Allocated], T}}.
    │ │ │ +alloc({Allocated, [H|T] = _Free}) ->
    │ │ │ +   {H, {[H|Allocated], T}}.
    │ │ │  
    │ │ │ -free(Ch, {Alloc, Free} = Channels) ->
    │ │ │ -   case lists:member(Ch, Alloc) of
    │ │ │ +free(Ch, {Alloc, Free} = Channels) ->
    │ │ │ +   case lists:member(Ch, Alloc) of
    │ │ │        true ->
    │ │ │ -         {lists:delete(Ch, Alloc), [Ch|Free]};
    │ │ │ +         {lists:delete(Ch, Alloc), [Ch|Free]};
    │ │ │        false ->
    │ │ │           Channels
    │ │ │     end.

    Code written without using behaviours can be more efficient, but the increased │ │ │ efficiency is at the expense of generality. The ability to manage all │ │ │ applications in the system in a consistent manner is important.

    Using behaviours also makes it easier to read and understand code written by │ │ │ other programmers. Improvised programming structures, while possibly more │ │ │ efficient, are always more difficult to understand.

    The server module corresponds, greatly simplified, to the Erlang/OTP behaviour │ │ │ gen_server.

    The standard Erlang/OTP behaviours are:

    • gen_server

      For implementing the server of a client-server relation

    • gen_statem

      For implementing state machines

    • gen_event

      For implementing event handling functionality

    • supervisor

      For implementing a supervisor in a supervision tree

    The compiler understands the module attribute -behaviour(Behaviour) and issues │ │ │ -warnings about missing callback functions, for example:

    -module(chs3).
    │ │ │ --behaviour(gen_server).
    │ │ │ +warnings about missing callback functions, for example:

    -module(chs3).
    │ │ │ +-behaviour(gen_server).
    │ │ │  ...
    │ │ │  
    │ │ │ -3> c(chs3).
    │ │ │ +3> c(chs3).
    │ │ │  ./chs3.erl:10: Warning: undefined call-back function handle_call/3
    │ │ │ -{ok,chs3}

    │ │ │ +{ok,chs3}

    │ │ │ │ │ │ │ │ │ │ │ │ Applications │ │ │

    │ │ │

    Erlang/OTP comes with a number of components, each implementing some specific │ │ │ functionality. Components are with Erlang/OTP terminology called applications. │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/distributed.html │ │ │ @@ -142,25 +142,25 @@ │ │ │ │ │ │

    A node is an executing Erlang runtime system that has been given a name, using │ │ │ the command-line flag -name (long names) or │ │ │ -sname (short names).

    The format of the node name is an atom name@host. name is the name given by │ │ │ the user. host is the full host name if long names are used, or the first part │ │ │ of the host name if short names are used. Function node() │ │ │ returns the name of the node.

    Example:

    % erl -name dilbert
    │ │ │ -(dilbert@uab.ericsson.se)1> node().
    │ │ │ +(dilbert@uab.ericsson.se)1> node().
    │ │ │  'dilbert@uab.ericsson.se'
    │ │ │  
    │ │ │  % erl -sname dilbert
    │ │ │ -(dilbert@uab)1> node().
    │ │ │ +(dilbert@uab)1> node().
    │ │ │  dilbert@uab

    The node name can also be given in runtime by calling net_kernel:start/1.

    Example:

    % erl
    │ │ │ -1> node().
    │ │ │ +1> node().
    │ │ │  nonode@nohost
    │ │ │ -2> net_kernel:start([dilbert,shortnames]).
    │ │ │ -{ok,<0.102.0>}
    │ │ │ -(dilbert@uab)3> node().
    │ │ │ +2> net_kernel:start([dilbert,shortnames]).
    │ │ │ +{ok,<0.102.0>}
    │ │ │ +(dilbert@uab)3> node().
    │ │ │  dilbert@uab

    Note

    A node with a long node name cannot communicate with a node with a short node │ │ │ name.

    │ │ │ │ │ │ │ │ │ │ │ │ Node Connections │ │ │

    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/distributed_applications.html │ │ │ @@ -150,36 +150,36 @@ │ │ │ (within the time-out specified by sync_nodes_timeout).
  • sync_nodes_timeout = integer() | infinity - Specifies how many milliseconds │ │ │ to wait for the other nodes to start.

  • When started, the node waits for all nodes specified by sync_nodes_mandatory │ │ │ and sync_nodes_optional to come up. When all nodes are up, or when all │ │ │ mandatory nodes are up and the time specified by sync_nodes_timeout has │ │ │ elapsed, all applications start. If not all mandatory nodes are up, the node │ │ │ terminates.

    Example:

    An application myapp is to run at the node cp1@cave. If this node goes down, │ │ │ myapp is to be restarted at cp2@cave or cp3@cave. A system configuration │ │ │ -file cp1.config for cp1@cave can look as follows:

    [{kernel,
    │ │ │ -  [{distributed, [{myapp, 5000, [cp1@cave, {cp2@cave, cp3@cave}]}]},
    │ │ │ -   {sync_nodes_mandatory, [cp2@cave, cp3@cave]},
    │ │ │ -   {sync_nodes_timeout, 5000}
    │ │ │ -  ]
    │ │ │ - }
    │ │ │ -].

    The system configuration files for cp2@cave and cp3@cave are identical, │ │ │ +file cp1.config for cp1@cave can look as follows:

    [{kernel,
    │ │ │ +  [{distributed, [{myapp, 5000, [cp1@cave, {cp2@cave, cp3@cave}]}]},
    │ │ │ +   {sync_nodes_mandatory, [cp2@cave, cp3@cave]},
    │ │ │ +   {sync_nodes_timeout, 5000}
    │ │ │ +  ]
    │ │ │ + }
    │ │ │ +].

    The system configuration files for cp2@cave and cp3@cave are identical, │ │ │ except for the list of mandatory nodes, which is to be [cp1@cave, cp3@cave] │ │ │ for cp2@cave and [cp1@cave, cp2@cave] for cp3@cave.

    Note

    All involved nodes must have the same value for distributed and │ │ │ sync_nodes_timeout. Otherwise the system behavior is undefined.

    │ │ │ │ │ │ │ │ │ │ │ │ Starting and Stopping Distributed Applications │ │ │

    │ │ │

    When all involved (mandatory) nodes have been started, the distributed │ │ │ application can be started by calling application:start(Application) at all │ │ │ of these nodes.

    A boot script (see Releases) can be used that │ │ │ automatically starts the application.

    The application is started at the first operational node that is listed in the │ │ │ list of nodes in the distributed configuration parameter. The application is │ │ │ started as usual. That is, an application master is created and calls the │ │ │ -application callback function:

    Module:start(normal, StartArgs)

    Example:

    Continuing the example from the previous section, the three nodes are started, │ │ │ +application callback function:

    Module:start(normal, StartArgs)

    Example:

    Continuing the example from the previous section, the three nodes are started, │ │ │ specifying the system configuration file:

    > erl -sname cp1 -config cp1
    │ │ │  > erl -sname cp2 -config cp2
    │ │ │  > erl -sname cp3 -config cp3

    When all nodes are operational, myapp can be started. This is achieved by │ │ │ calling application:start(myapp) at all three nodes. It is then started at │ │ │ cp1, as shown in the following figure:

    Application myapp - Situation 1

    Similarly, the application must be stopped by calling │ │ │ application:stop(Application) at all involved nodes.

    │ │ │ │ │ │ @@ -187,30 +187,30 @@ │ │ │ │ │ │ Failover │ │ │

    │ │ │

    If the node where the application is running goes down, the application is │ │ │ restarted (after the specified time-out) at the first operational node that is │ │ │ listed in the list of nodes in the distributed configuration parameter. This │ │ │ is called a failover.

    The application is started the normal way at the new node, that is, by the │ │ │ -application master calling:

    Module:start(normal, StartArgs)

    An exception is if the application has the start_phases key defined (see │ │ │ +application master calling:

    Module:start(normal, StartArgs)

    An exception is if the application has the start_phases key defined (see │ │ │ Included Applications). The application is then │ │ │ -instead started by calling:

    Module:start({failover, Node}, StartArgs)

    Here Node is the terminated node.

    Example:

    If cp1 goes down, the system checks which one of the other nodes, cp2 or │ │ │ +instead started by calling:

    Module:start({failover, Node}, StartArgs)

    Here Node is the terminated node.

    Example:

    If cp1 goes down, the system checks which one of the other nodes, cp2 or │ │ │ cp3, has the least number of running applications, but waits for 5 seconds for │ │ │ cp1 to restart. If cp1 does not restart and cp2 runs fewer applications │ │ │ than cp3, myapp is restarted on cp2.

    Application myapp - Situation 2

    Suppose now that cp2 goes also down and does not restart within 5 seconds. │ │ │ myapp is now restarted on cp3.

    Application myapp - Situation 3

    │ │ │ │ │ │ │ │ │ │ │ │ Takeover │ │ │

    │ │ │

    If a node is started, which has higher priority according to distributed than │ │ │ the node where a distributed application is running, the application is │ │ │ restarted at the new node and stopped at the old node. This is called a │ │ │ -takeover.

    The application is started by the application master calling:

    Module:start({takeover, Node}, StartArgs)

    Here Node is the old node.

    Example:

    If myapp is running at cp3, and if cp2 now restarts, it does not restart │ │ │ +takeover.

    The application is started by the application master calling:

    Module:start({takeover, Node}, StartArgs)

    Here Node is the old node.

    Example:

    If myapp is running at cp3, and if cp2 now restarts, it does not restart │ │ │ myapp, as the order between the cp2 and cp3 nodes is undefined.

    Application myapp - Situation 4

    However, if cp1 also restarts, the function application:takeover/2 moves │ │ │ myapp to cp1, as cp1 has a higher priority than cp3 for this │ │ │ application. In this case, Module:start({takeover, cp3@cave}, StartArgs) is │ │ │ executed at cp1 to start the application.

    Application myapp - Situation 5

    │ │ │
    │ │ │ │ │ │
    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/documentation.html │ │ │ @@ -112,23 +112,23 @@ │ │ │ │ │ │ │ │ │ │ │ │ Documentation │ │ │ │ │ │ │ │ │

    Documentation in Erlang is done through the -moduledoc and -doc │ │ │ -attributes. For example:

    -module(arith).
    │ │ │ +attributes. For example:

    -module(arith).
    │ │ │  -moduledoc """
    │ │ │  A module for basic arithmetic.
    │ │ │  """.
    │ │ │  
    │ │ │ --export([add/2]).
    │ │ │ +-export([add/2]).
    │ │ │  
    │ │ │  -doc "Adds two numbers.".
    │ │ │ -add(One, Two) -> One + Two.

    The -moduledoc attribute has to be located before the first -doc attribute │ │ │ +add(One, Two) -> One + Two.

    The -moduledoc attribute has to be located before the first -doc attribute │ │ │ or function declaration. It documents the overall purpose of the module.

    The -doc attribute always precedes the function or │ │ │ attribute it documents. The │ │ │ attributes that can be documented are │ │ │ user-defined types │ │ │ (-type and -opaque) and │ │ │ behaviour module attributes │ │ │ (-callback).

    By default the format used for documentation attributes is │ │ │ @@ -140,55 +140,55 @@ │ │ │ Documentation Attributes.

    -doc attributes have been available since Erlang/OTP 27.

    │ │ │ │ │ │ │ │ │ │ │ │ Documentation metadata │ │ │

    │ │ │

    It is possible to add metadata to the documentation entry. You do this by adding │ │ │ -a -moduledoc or -doc attribute with a map as argument. For example:

    -module(arith).
    │ │ │ +a -moduledoc or -doc attribute with a map as argument. For example:

    -module(arith).
    │ │ │  -moduledoc """
    │ │ │  A module for basic arithmetic.
    │ │ │  """.
    │ │ │ --moduledoc #{since => "1.0"}.
    │ │ │ +-moduledoc #{since => "1.0"}.
    │ │ │  
    │ │ │ --export([add/2]).
    │ │ │ +-export([add/2]).
    │ │ │  
    │ │ │  -doc "Adds two numbers.".
    │ │ │ --doc(#{since => "1.0"}).
    │ │ │ -add(One, Two) -> One + Two.

    The metadata is used by documentation tools to provide extra information to the │ │ │ +-doc(#{since => "1.0"}). │ │ │ +add(One, Two) -> One + Two.

    The metadata is used by documentation tools to provide extra information to the │ │ │ user. There can be multiple metadata documentation entries, in which case the │ │ │ maps will be merged with the latest taking precedence if there are duplicate │ │ │ keys. Example:

    -doc "Adds two numbers.".
    │ │ │ --doc #{since => "1.0", author => "Joe"}.
    │ │ │ --doc #{since => "2.0"}.
    │ │ │ -add(One, Two) -> One + Two.

    This will result in a metadata entry of #{since => "2.0", author => "Joe"}.

    The keys and values in the metadata map can be any type, but it is recommended │ │ │ +-doc #{since => "1.0", author => "Joe"}. │ │ │ +-doc #{since => "2.0"}. │ │ │ +add(One, Two) -> One + Two.

    This will result in a metadata entry of #{since => "2.0", author => "Joe"}.

    The keys and values in the metadata map can be any type, but it is recommended │ │ │ that only atoms are used for keys and │ │ │ strings for the values.

    │ │ │ │ │ │ │ │ │ │ │ │ External documentation files │ │ │

    │ │ │

    The -moduledoc and -doc can also be placed in external files. To do so use │ │ │ -doc {file, "path/to/doc.md"} to point to the documentation. The path used is │ │ │ relative to the file where the -doc attribute is located. For example:

    %% doc/add.md
    │ │ │  Adds two numbers.

    and

    %% src/arith.erl
    │ │ │ --doc({file, "../doc/add.md"}).
    │ │ │ -add(One, Two) -> One + Two.

    │ │ │ +-doc({file, "../doc/add.md"}). │ │ │ +add(One, Two) -> One + Two.

    │ │ │ │ │ │ │ │ │ │ │ │ Documenting a module │ │ │

    │ │ │

    The module description should include details on how to use the API and examples │ │ │ of the different functions working together. Here is a good place to use images │ │ │ and other diagrams to better show the usage of the module. Instead of writing a │ │ │ long text in the moduledoc attribute, it could be better to break it out into │ │ │ an external page.

    The moduledoc attribute should start with a short paragraph describing the │ │ │ -module and then go into greater details. For example:

    -module(arith).
    │ │ │ +module and then go into greater details. For example:

    -module(arith).
    │ │ │  -moduledoc """
    │ │ │     A module for basic arithmetic.
    │ │ │  
    │ │ │     This module can be used to add and subtract values. For example:
    │ │ │  
    │ │ │     ```erlang
    │ │ │     1> arith:substract(arith:add(2, 3), 1).
    │ │ │ @@ -203,94 +203,94 @@
    │ │ │  

    There are three reserved metadata keys for -moduledoc:

    • since - Shows in which version of the application the module was added. │ │ │ If this is added, all functions, types, and callbacks within will also receive │ │ │ the same since value unless specified in the metadata of the function, type │ │ │ or callback.
    • deprecated - Shows a text in the documentation explaining that it is │ │ │ deprecated and what to use instead.
    • format - The format to use for all documentation in this module. The │ │ │ default is text/markdown. It should be written using the │ │ │ mime type │ │ │ -of the format.

    Example:

    -moduledoc {file, "../doc/arith.asciidoc"}.
    │ │ │ --moduledoc #{since => "0.1", format => "text/asciidoc"}.
    │ │ │ --moduledoc #{deprecated => "Use the Erlang arithmetic operators instead."}.

    │ │ │ +of the format.

    Example:

    -moduledoc {file, "../doc/arith.asciidoc"}.
    │ │ │ +-moduledoc #{since => "0.1", format => "text/asciidoc"}.
    │ │ │ +-moduledoc #{deprecated => "Use the Erlang arithmetic operators instead."}.

    │ │ │ │ │ │ │ │ │ │ │ │ Documenting functions, user-defined types, and callbacks │ │ │

    │ │ │

    Functions, types, and callbacks can be documented using the -doc attribute. │ │ │ Each entry should start with a short paragraph describing the purpose of entity, │ │ │ and then go into greater detail in needed.

    It is not recommended to include images or diagrams in this documentation as it │ │ │ is used by IDEs and c:h/1 to show the documentation to the user.

    For example:

    -doc """
    │ │ │  A number that can be used by the arith module.
    │ │ │  
    │ │ │  We use a special number here so that we know
    │ │ │  that this number comes from this module.
    │ │ │  """.
    │ │ │ --opaque number() :: {arith, erlang:number()}.
    │ │ │ +-opaque number() :: {arith, erlang:number()}.
    │ │ │  
    │ │ │  -doc """
    │ │ │  Adds two numbers.
    │ │ │  
    │ │ │  ### Example:
    │ │ │  
    │ │ │  ```
    │ │ │  1> arith:add(arith:number(1), arith:number(2)). {number, 3}
    │ │ │  ```
    │ │ │  """.
    │ │ │ --spec add(number(), number()) -> number().
    │ │ │ -add({number, One}, {number, Two}) -> {number, One + Two}.

    │ │ │ +-spec add(number(), number()) -> number(). │ │ │ +add({number, One}, {number, Two}) -> {number, One + Two}.

    │ │ │ │ │ │ │ │ │ │ │ │ Doc metadata │ │ │

    │ │ │

    There are four reserved metadata keys for -doc:

    • since => unicode:chardata() - Shows which version of the application the │ │ │ module was added.

    • deprecated => unicode:chardata() - Shows a text in the documentation │ │ │ explaining that it is deprecated and what to use instead. The compiler will │ │ │ automatically insert this key if there is a -deprecated attribute marking a │ │ │ function as deprecated.

    • equiv => unicode:chardata() | F/A | F(...) - Notes that this function is equivalent to │ │ │ another function in this module. The equivalence can be described using either │ │ │ -Func/Arity, Func(Args) or a unicode string. For example:

      -doc #{equiv => add/3}.
      │ │ │ -add(One, Two) -> add(One, Two, []).
      │ │ │ -add(One, Two, Options) -> ...

      or

      -doc #{equiv => add(One, Two, [])}.
      │ │ │ --spec add(One :: number(), Two :: number()) -> number().
      │ │ │ -add(One, Two) -> add(One, Two, []).
      │ │ │ -add(One, Two, Options) -> ...

      The entry into the EEP-48 doc chunk metadata is │ │ │ +Func/Arity, Func(Args) or a unicode string. For example:

      -doc #{equiv => add/3}.
      │ │ │ +add(One, Two) -> add(One, Two, []).
      │ │ │ +add(One, Two, Options) -> ...

      or

      -doc #{equiv => add(One, Two, [])}.
      │ │ │ +-spec add(One :: number(), Two :: number()) -> number().
      │ │ │ +add(One, Two) -> add(One, Two, []).
      │ │ │ +add(One, Two, Options) -> ...

      The entry into the EEP-48 doc chunk metadata is │ │ │ the value converted to a string.

    • exported => boolean() - A boolean/0 signifying if the entry is exported │ │ │ or not. This value is automatically set by the compiler and should not be set │ │ │ by the user.

    │ │ │ │ │ │ │ │ │ │ │ │ Doc signatures │ │ │

    │ │ │

    The doc signature is a short text shown to describe the function and its arguments. │ │ │ By default it is determined by looking at the names of the arguments in the │ │ │ --spec or function. For example:

    add(One, Two) -> One + Two.
    │ │ │ +-spec or function. For example:

    add(One, Two) -> One + Two.
    │ │ │  
    │ │ │ --spec sub(One :: integer(), Two :: integer()) -> integer().
    │ │ │ -sub(X, Y) -> X - Y.

    will have a signature of add(One, Two) and sub(One, Two).

    For types or callbacks, the signature is derived from the type or callback │ │ │ -specification. For example:

    -type number(Value) :: {number, Value}.
    │ │ │ +-spec sub(One :: integer(), Two :: integer()) -> integer().
    │ │ │ +sub(X, Y) -> X - Y.

    will have a signature of add(One, Two) and sub(One, Two).

    For types or callbacks, the signature is derived from the type or callback │ │ │ +specification. For example:

    -type number(Value) :: {number, Value}.
    │ │ │  %% signature will be `number(Value)`
    │ │ │  
    │ │ │ --opaque number() :: {number, number()}.
    │ │ │ +-opaque number() :: {number, number()}.
    │ │ │  %% signature will be `number()`
    │ │ │  
    │ │ │ --callback increment(In :: number()) -> Out.
    │ │ │ +-callback increment(In :: number()) -> Out.
    │ │ │  %% signature will be `increment(In)`
    │ │ │  
    │ │ │ --callback increment(In) -> Out when In :: number().
    │ │ │ +-callback increment(In) -> Out when In :: number().
    │ │ │  %% signature will be `increment(In)`

    If it is not possible to "easily" figure out a nice signature from the code, the │ │ │ MFA syntax is used instead. For example: add/2, number/1, increment/1

    It is possible to supply a custom signature by placing it as the first line of the │ │ │ -doc attribute. The provided signature must be in the form of a function │ │ │ declaration up until the ->. For example:

    -doc """
    │ │ │  add(One, Two)
    │ │ │  
    │ │ │  Adds two numbers.
    │ │ │  """.
    │ │ │ -add(A, B) -> A + B.

    Will create the signature add(One, Two). The signature will be removed from the │ │ │ +add(A, B) -> A + B.

    Will create the signature add(One, Two). The signature will be removed from the │ │ │ documentation string, so in the example above only the text "Adds two numbers" │ │ │ will be part of the documentation. This works for functions, types, and │ │ │ callbacks.

    │ │ │ │ │ │ │ │ │ │ │ │ Compiling and getting documentation │ │ │ @@ -375,21 +375,21 @@ │ │ │ Using ExDoc to generate HTML/ePub documentation │ │ │

    │ │ │

    ExDoc has built-in support to generate │ │ │ documentation from Markdown. The simplest way is by using the │ │ │ rebar3_ex_doc plugin. To set up a │ │ │ rebar3 project to use ExDoc to generate │ │ │ documentation add the following to your rebar3.config.

    %% Enable the plugin
    │ │ │ -{plugins, [rebar3_ex_doc]}.
    │ │ │ +{plugins, [rebar3_ex_doc]}.
    │ │ │  
    │ │ │ -{ex_doc, [
    │ │ │ -  {extras, ["README.md"]},
    │ │ │ -  {main, "README.md"},
    │ │ │ -  {source_url, "https://github.com/namespace/your_app"}
    │ │ │ -]}.

    When configured you can run rebar3 ex_doc to generate the │ │ │ +{ex_doc, [ │ │ │ + {extras, ["README.md"]}, │ │ │ + {main, "README.md"}, │ │ │ + {source_url, "https://github.com/namespace/your_app"} │ │ │ +]}.

    When configured you can run rebar3 ex_doc to generate the │ │ │ documentation to doc/index.html. For more details and options see │ │ │ the rebar3_ex_doc documentation.

    You can also download the │ │ │ release escript bundle from │ │ │ github and run it from the command line. The documentation for using the escript │ │ │ is found by running ex_doc --help.

    If you are writing documentation that will be using │ │ │ ExDoc to generate HTML/ePub it is highly │ │ │ recommended to read its documentation.

    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/drivers.html │ │ │ @@ -122,23 +122,23 @@ │ │ │ Drivers and Concurrency │ │ │ │ │ │

    The runtime system always takes a lock before running any code in a driver.

    By default, that lock is at the driver level, that is, if several ports have │ │ │ been opened to the same driver, only code for one port at the same time can be │ │ │ running.

    A driver can be configured to have one lock for each port instead.

    If a driver is used in a functional way (that is, holds no state, but only does │ │ │ some heavy calculation and returns a result), several ports with registered │ │ │ names can be opened beforehand, and the port to be used can be chosen based on │ │ │ -the scheduler ID as follows:

    -define(PORT_NAMES(),
    │ │ │ -	{some_driver_01, some_driver_02, some_driver_03, some_driver_04,
    │ │ │ +the scheduler ID as follows:

    -define(PORT_NAMES(),
    │ │ │ +	{some_driver_01, some_driver_02, some_driver_03, some_driver_04,
    │ │ │  	 some_driver_05, some_driver_06, some_driver_07, some_driver_08,
    │ │ │  	 some_driver_09, some_driver_10, some_driver_11, some_driver_12,
    │ │ │ -	 some_driver_13, some_driver_14, some_driver_15, some_driver_16}).
    │ │ │ +	 some_driver_13, some_driver_14, some_driver_15, some_driver_16}).
    │ │ │  
    │ │ │ -client_port() ->
    │ │ │ -    element(erlang:system_info(scheduler_id) rem tuple_size(?PORT_NAMES()) + 1,
    │ │ │ -	    ?PORT_NAMES()).

    As long as there are no more than 16 schedulers, there will never be any lock │ │ │ +client_port() -> │ │ │ + element(erlang:system_info(scheduler_id) rem tuple_size(?PORT_NAMES()) + 1, │ │ │ + ?PORT_NAMES()).

    As long as there are no more than 16 schedulers, there will never be any lock │ │ │ contention on the port lock for the driver.

    │ │ │ │ │ │ │ │ │ │ │ │ Avoiding Copying Binaries When Calling a Driver │ │ │

    │ │ │

    There are basically two ways to avoid copying a binary that is sent to a driver:

    • If the Data argument for port_control/3 is a │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/eff_guide_functions.html │ │ │ @@ -122,67 +122,67 @@ │ │ │ Pattern Matching │ │ │ │ │ │

      Pattern matching in function head as well as in case and receive clauses are │ │ │ optimized by the compiler. With a few exceptions, there is nothing to gain by │ │ │ rearranging clauses.

      One exception is pattern matching of binaries. The compiler does not rearrange │ │ │ clauses that match binaries. Placing the clause that matches against the empty │ │ │ binary last is usually slightly faster than placing it first.

      The following is a rather unnatural example to show another exception where │ │ │ -rearranging clauses is beneficial:

      DO NOT

      atom_map1(one) -> 1;
      │ │ │ -atom_map1(two) -> 2;
      │ │ │ -atom_map1(three) -> 3;
      │ │ │ -atom_map1(Int) when is_integer(Int) -> Int;
      │ │ │ -atom_map1(four) -> 4;
      │ │ │ -atom_map1(five) -> 5;
      │ │ │ -atom_map1(six) -> 6.

      The problem is the clause with the variable Int. As a variable can match │ │ │ +rearranging clauses is beneficial:

      DO NOT

      atom_map1(one) -> 1;
      │ │ │ +atom_map1(two) -> 2;
      │ │ │ +atom_map1(three) -> 3;
      │ │ │ +atom_map1(Int) when is_integer(Int) -> Int;
      │ │ │ +atom_map1(four) -> 4;
      │ │ │ +atom_map1(five) -> 5;
      │ │ │ +atom_map1(six) -> 6.

      The problem is the clause with the variable Int. As a variable can match │ │ │ anything, including the atoms four, five, and six, which the following │ │ │ clauses also match, the compiler must generate suboptimal code that executes as │ │ │ follows:

      • First, the input value is compared to one, two, and three (using a │ │ │ single instruction that does a binary search; thus, quite efficient even if │ │ │ there are many values) to select which one of the first three clauses to │ │ │ execute (if any).
      • If none of the first three clauses match, the fourth clause match as a │ │ │ variable always matches.
      • If the guard test is_integer(Int) succeeds, the fourth │ │ │ clause is executed.
      • If the guard test fails, the input value is compared to four, five, and │ │ │ six, and the appropriate clause is selected. (There is a function_clause │ │ │ -exception if none of the values matched.)

      Rewriting to either:

      DO

      atom_map2(one) -> 1;
      │ │ │ -atom_map2(two) -> 2;
      │ │ │ -atom_map2(three) -> 3;
      │ │ │ -atom_map2(four) -> 4;
      │ │ │ -atom_map2(five) -> 5;
      │ │ │ -atom_map2(six) -> 6;
      │ │ │ -atom_map2(Int) when is_integer(Int) -> Int.

      or:

      DO

      atom_map3(Int) when is_integer(Int) -> Int;
      │ │ │ -atom_map3(one) -> 1;
      │ │ │ -atom_map3(two) -> 2;
      │ │ │ -atom_map3(three) -> 3;
      │ │ │ -atom_map3(four) -> 4;
      │ │ │ -atom_map3(five) -> 5;
      │ │ │ -atom_map3(six) -> 6.

      gives slightly more efficient matching code.

      Another example:

      DO NOT

      map_pairs1(_Map, [], Ys) ->
      │ │ │ +exception if none of the values matched.)

    Rewriting to either:

    DO

    atom_map2(one) -> 1;
    │ │ │ +atom_map2(two) -> 2;
    │ │ │ +atom_map2(three) -> 3;
    │ │ │ +atom_map2(four) -> 4;
    │ │ │ +atom_map2(five) -> 5;
    │ │ │ +atom_map2(six) -> 6;
    │ │ │ +atom_map2(Int) when is_integer(Int) -> Int.

    or:

    DO

    atom_map3(Int) when is_integer(Int) -> Int;
    │ │ │ +atom_map3(one) -> 1;
    │ │ │ +atom_map3(two) -> 2;
    │ │ │ +atom_map3(three) -> 3;
    │ │ │ +atom_map3(four) -> 4;
    │ │ │ +atom_map3(five) -> 5;
    │ │ │ +atom_map3(six) -> 6.

    gives slightly more efficient matching code.

    Another example:

    DO NOT

    map_pairs1(_Map, [], Ys) ->
    │ │ │      Ys;
    │ │ │ -map_pairs1(_Map, Xs, []) ->
    │ │ │ +map_pairs1(_Map, Xs, []) ->
    │ │ │      Xs;
    │ │ │ -map_pairs1(Map, [X|Xs], [Y|Ys]) ->
    │ │ │ -    [Map(X, Y)|map_pairs1(Map, Xs, Ys)].

    The first argument is not a problem. It is variable, but it is a variable in │ │ │ +map_pairs1(Map, [X|Xs], [Y|Ys]) -> │ │ │ + [Map(X, Y)|map_pairs1(Map, Xs, Ys)].

    The first argument is not a problem. It is variable, but it is a variable in │ │ │ all clauses. The problem is the variable in the second argument, Xs, in the │ │ │ middle clause. Because the variable can match anything, the compiler is not │ │ │ allowed to rearrange the clauses, but must generate code that matches them in │ │ │ the order written.

    If the function is rewritten as follows, the compiler is free to rearrange the │ │ │ -clauses:

    DO

    map_pairs2(_Map, [], Ys) ->
    │ │ │ +clauses:

    DO

    map_pairs2(_Map, [], Ys) ->
    │ │ │      Ys;
    │ │ │ -map_pairs2(_Map, [_|_]=Xs, [] ) ->
    │ │ │ +map_pairs2(_Map, [_|_]=Xs, [] ) ->
    │ │ │      Xs;
    │ │ │ -map_pairs2(Map, [X|Xs], [Y|Ys]) ->
    │ │ │ -    [Map(X, Y)|map_pairs2(Map, Xs, Ys)].

    The compiler will generate code similar to this:

    DO NOT (already done by the compiler)

    explicit_map_pairs(Map, Xs0, Ys0) ->
    │ │ │ +map_pairs2(Map, [X|Xs], [Y|Ys]) ->
    │ │ │ +    [Map(X, Y)|map_pairs2(Map, Xs, Ys)].

    The compiler will generate code similar to this:

    DO NOT (already done by the compiler)

    explicit_map_pairs(Map, Xs0, Ys0) ->
    │ │ │      case Xs0 of
    │ │ │ -	[X|Xs] ->
    │ │ │ +	[X|Xs] ->
    │ │ │  	    case Ys0 of
    │ │ │ -		[Y|Ys] ->
    │ │ │ -		    [Map(X, Y)|explicit_map_pairs(Map, Xs, Ys)];
    │ │ │ -		[] ->
    │ │ │ +		[Y|Ys] ->
    │ │ │ +		    [Map(X, Y)|explicit_map_pairs(Map, Xs, Ys)];
    │ │ │ +		[] ->
    │ │ │  		    Xs0
    │ │ │  	    end;
    │ │ │ -	[] ->
    │ │ │ +	[] ->
    │ │ │  	    Ys0
    │ │ │      end.

    This is slightly faster for probably the most common case that the input lists │ │ │ are not empty or very short. (Another advantage is that Dialyzer can deduce a │ │ │ better type for the Xs variable.)

    │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/eff_guide_processes.html │ │ │ @@ -119,45 +119,45 @@ │ │ │ │ │ │ │ │ │ │ │ │ Creating an Erlang Process │ │ │

    │ │ │

    An Erlang process is lightweight compared to threads and processes in operating │ │ │ systems.

    A newly spawned Erlang process uses 327 words of memory. The size can be found │ │ │ -as follows:

    Erlang/OTP 27 [erts-14.2.3] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
    │ │ │ +as follows:

    Erlang/OTP 27 [erts-14.2.3] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
    │ │ │  
    │ │ │ -Eshell V14.2.3 (press Ctrl+G to abort, type help(). for help)
    │ │ │ -1> Fun = fun() -> receive after infinity -> ok end end.
    │ │ │ +Eshell V14.2.3 (press Ctrl+G to abort, type help(). for help)
    │ │ │ +1> Fun = fun() -> receive after infinity -> ok end end.
    │ │ │  #Fun<erl_eval.43.39164016>
    │ │ │ -2> {_,Bytes} = process_info(spawn(Fun), memory).
    │ │ │ -{memory,2616}
    │ │ │ -3> Bytes div erlang:system_info(wordsize).
    │ │ │ +2> {_,Bytes} = process_info(spawn(Fun), memory).
    │ │ │ +{memory,2616}
    │ │ │ +3> Bytes div erlang:system_info(wordsize).
    │ │ │  327

    The size includes 233 words for the heap area (which includes the stack). The │ │ │ garbage collector increases the heap as needed.

    The main (outer) loop for a process must be tail-recursive. Otherwise, the │ │ │ -stack grows until the process terminates.

    DO NOT

    loop() ->
    │ │ │ +stack grows until the process terminates.

    DO NOT

    loop() ->
    │ │ │    receive
    │ │ │ -     {sys, Msg} ->
    │ │ │ -         handle_sys_msg(Msg),
    │ │ │ -         loop();
    │ │ │ -     {From, Msg} ->
    │ │ │ -          Reply = handle_msg(Msg),
    │ │ │ +     {sys, Msg} ->
    │ │ │ +         handle_sys_msg(Msg),
    │ │ │ +         loop();
    │ │ │ +     {From, Msg} ->
    │ │ │ +          Reply = handle_msg(Msg),
    │ │ │            From ! Reply,
    │ │ │ -          loop()
    │ │ │ +          loop()
    │ │ │    end,
    │ │ │ -  io:format("Message is processed~n", []).

    The call to io:format/2 will never be executed, but a return address will │ │ │ + io:format("Message is processed~n", []).

    The call to io:format/2 will never be executed, but a return address will │ │ │ still be pushed to the stack each time loop/0 is called recursively. The │ │ │ -correct tail-recursive version of the function looks as follows:

    DO

    loop() ->
    │ │ │ +correct tail-recursive version of the function looks as follows:

    DO

    loop() ->
    │ │ │     receive
    │ │ │ -      {sys, Msg} ->
    │ │ │ -         handle_sys_msg(Msg),
    │ │ │ -         loop();
    │ │ │ -      {From, Msg} ->
    │ │ │ -         Reply = handle_msg(Msg),
    │ │ │ +      {sys, Msg} ->
    │ │ │ +         handle_sys_msg(Msg),
    │ │ │ +         loop();
    │ │ │ +      {From, Msg} ->
    │ │ │ +         Reply = handle_msg(Msg),
    │ │ │           From ! Reply,
    │ │ │ -         loop()
    │ │ │ +         loop()
    │ │ │   end.

    │ │ │ │ │ │ │ │ │ │ │ │ Initial Heap Size │ │ │

    │ │ │

    The default initial heap size of 233 words is quite conservative to support │ │ │ @@ -189,30 +189,30 @@ │ │ │ │ │ │ │ │ │ Receiving messages │ │ │ │ │ │

    The cost of receiving messages depends on how complicated the receive │ │ │ expression is. A simple expression that matches any message is very cheap │ │ │ because it retrieves the first message in the message queue:

    DO

    receive
    │ │ │ -    Message -> handle_msg(Message)
    │ │ │ +    Message -> handle_msg(Message)
    │ │ │  end.

    However, this is not always convenient: we can receive a message that we do not │ │ │ know how to handle at this point, so it is common to only match the messages we │ │ │ expect:

    receive
    │ │ │ -    {Tag, Message} -> handle_msg(Message)
    │ │ │ +    {Tag, Message} -> handle_msg(Message)
    │ │ │  end.

    While this is convenient it means that the entire message queue must be searched │ │ │ until it finds a matching message. This is very expensive for processes with │ │ │ long message queues, so there is an optimization for the common case of │ │ │ -sending a request and waiting for a response shortly after:

    DO

    MRef = monitor(process, Process),
    │ │ │ -Process ! {self(), MRef, Request},
    │ │ │ +sending a request and waiting for a response shortly after:

    DO

    MRef = monitor(process, Process),
    │ │ │ +Process ! {self(), MRef, Request},
    │ │ │  receive
    │ │ │ -    {MRef, Reply} ->
    │ │ │ -        erlang:demonitor(MRef, [flush]),
    │ │ │ -        handle_reply(Reply);
    │ │ │ -    {'DOWN', MRef, _, _, Reason} ->
    │ │ │ -        handle_error(Reason)
    │ │ │ +    {MRef, Reply} ->
    │ │ │ +        erlang:demonitor(MRef, [flush]),
    │ │ │ +        handle_reply(Reply);
    │ │ │ +    {'DOWN', MRef, _, _, Reason} ->
    │ │ │ +        handle_error(Reason)
    │ │ │  end.

    Since the compiler knows that the reference created by │ │ │ monitor/2 cannot exist before the call (since it is a globally │ │ │ unique identifier), and that the receive only matches messages that contain │ │ │ said reference, it will tell the emulator to search only the messages that │ │ │ arrived after the call to monitor/2.

    The above is a simple example where one is but guaranteed that the optimization │ │ │ will take, but what about more complicated code?

    │ │ │ │ │ │ @@ -228,101 +228,101 @@ │ │ │ efficiency_guide.erl:200: Warning: NOT OPTIMIZED: all clauses do not match a suitable reference │ │ │ efficiency_guide.erl:206: Warning: OPTIMIZED: reference used to mark a message queue position │ │ │ efficiency_guide.erl:208: Warning: OPTIMIZED: all clauses match reference created by monitor/2 at efficiency_guide.erl:206 │ │ │ efficiency_guide.erl:219: Warning: INFO: passing reference created by make_ref/0 at efficiency_guide.erl:218 │ │ │ efficiency_guide.erl:222: Warning: OPTIMIZED: all clauses match reference in function parameter 1

    To make it clearer exactly what code the warnings refer to, the warnings in the │ │ │ following examples are inserted as comments after the clause they refer to, for │ │ │ example:

    %% DO
    │ │ │ -simple_receive() ->
    │ │ │ +simple_receive() ->
    │ │ │  %% efficiency_guide.erl:194: Warning: INFO: not a selective receive, this is always fast
    │ │ │  receive
    │ │ │ -    Message -> handle_msg(Message)
    │ │ │ +    Message -> handle_msg(Message)
    │ │ │  end.
    │ │ │  
    │ │ │  %% DO NOT, unless Tag is known to be a suitable reference: see
    │ │ │  %% cross_function_receive/0 further down.
    │ │ │ -selective_receive(Tag, Message) ->
    │ │ │ +selective_receive(Tag, Message) ->
    │ │ │  %% efficiency_guide.erl:200: Warning: NOT OPTIMIZED: all clauses do not match a suitable reference
    │ │ │  receive
    │ │ │ -    {Tag, Message} -> handle_msg(Message)
    │ │ │ +    {Tag, Message} -> handle_msg(Message)
    │ │ │  end.
    │ │ │  
    │ │ │  %% DO
    │ │ │ -optimized_receive(Process, Request) ->
    │ │ │ +optimized_receive(Process, Request) ->
    │ │ │  %% efficiency_guide.erl:206: Warning: OPTIMIZED: reference used to mark a message queue position
    │ │ │ -    MRef = monitor(process, Process),
    │ │ │ -    Process ! {self(), MRef, Request},
    │ │ │ +    MRef = monitor(process, Process),
    │ │ │ +    Process ! {self(), MRef, Request},
    │ │ │      %% efficiency_guide.erl:208: Warning: OPTIMIZED: matches reference created by monitor/2 at efficiency_guide.erl:206
    │ │ │      receive
    │ │ │ -        {MRef, Reply} ->
    │ │ │ -        erlang:demonitor(MRef, [flush]),
    │ │ │ -        handle_reply(Reply);
    │ │ │ -    {'DOWN', MRef, _, _, Reason} ->
    │ │ │ -    handle_error(Reason)
    │ │ │ +        {MRef, Reply} ->
    │ │ │ +        erlang:demonitor(MRef, [flush]),
    │ │ │ +        handle_reply(Reply);
    │ │ │ +    {'DOWN', MRef, _, _, Reason} ->
    │ │ │ +    handle_error(Reason)
    │ │ │      end.
    │ │ │  
    │ │ │  %% DO
    │ │ │ -cross_function_receive() ->
    │ │ │ +cross_function_receive() ->
    │ │ │      %% efficiency_guide.erl:218: Warning: OPTIMIZED: reference used to mark a message queue position
    │ │ │ -    Ref = make_ref(),
    │ │ │ +    Ref = make_ref(),
    │ │ │      %% efficiency_guide.erl:219: Warning: INFO: passing reference created by make_ref/0 at efficiency_guide.erl:218
    │ │ │ -    cross_function_receive(Ref).
    │ │ │ +    cross_function_receive(Ref).
    │ │ │  
    │ │ │ -cross_function_receive(Ref) ->
    │ │ │ +cross_function_receive(Ref) ->
    │ │ │      %% efficiency_guide.erl:222: Warning: OPTIMIZED: all clauses match reference in function parameter 1
    │ │ │      receive
    │ │ │ -        {Ref, Message} -> handle_msg(Message)
    │ │ │ +        {Ref, Message} -> handle_msg(Message)
    │ │ │      end.

    │ │ │ │ │ │ │ │ │ │ │ │ Literal Pool │ │ │

    │ │ │

    Constant Erlang terms (hereafter called literals) are kept in literal pools; │ │ │ each loaded module has its own pool. The following function does not build the │ │ │ tuple every time it is called (only to have it discarded the next time the │ │ │ garbage collector was run), but the tuple is located in the module's literal │ │ │ -pool:

    DO

    days_in_month(M) ->
    │ │ │ -    element(M, {31,28,31,30,31,30,31,31,30,31,30,31}).

    If a literal, or a term that contains a literal, is inserted into an Ets table, │ │ │ +pool:

    DO

    days_in_month(M) ->
    │ │ │ +    element(M, {31,28,31,30,31,30,31,31,30,31,30,31}).

    If a literal, or a term that contains a literal, is inserted into an Ets table, │ │ │ it is copied. The reason is that the module containing the literal can be │ │ │ unloaded in the future.

    When a literal is sent to another process, it is not copied. When a module │ │ │ holding a literal is unloaded, the literal will be copied to the heap of all │ │ │ processes that hold references to that literal.

    There also exists a global literal pool that is managed by the │ │ │ persistent_term module.

    By default, 1 GB of virtual address space is reserved for all literal pools (in │ │ │ BEAM code and persistent terms). The amount of virtual address space reserved │ │ │ for literals can be changed by using the │ │ │ +MIscs option when starting the emulator.

    Here is an example how the reserved virtual address space for literals can be │ │ │ raised to 2 GB (2048 MB):

    erl +MIscs 2048

    │ │ │ │ │ │ │ │ │ │ │ │ Loss of Sharing │ │ │

    │ │ │ -

    An Erlang term can have shared subterms. Here is a simple example:

    {SubTerm, SubTerm}

    Shared subterms are not preserved in the following cases:

    • When a term is sent to another process
    • When a term is passed as the initial process arguments in the spawn call
    • When a term is stored in an Ets table

    That is an optimization. Most applications do not send messages with shared │ │ │ -subterms.

    The following example shows how a shared subterm can be created:

    kilo_byte() ->
    │ │ │ -    kilo_byte(10, [42]).
    │ │ │ +

    An Erlang term can have shared subterms. Here is a simple example:

    {SubTerm, SubTerm}

    Shared subterms are not preserved in the following cases:

    • When a term is sent to another process
    • When a term is passed as the initial process arguments in the spawn call
    • When a term is stored in an Ets table

    That is an optimization. Most applications do not send messages with shared │ │ │ +subterms.

    The following example shows how a shared subterm can be created:

    kilo_byte() ->
    │ │ │ +    kilo_byte(10, [42]).
    │ │ │  
    │ │ │ -kilo_byte(0, Acc) ->
    │ │ │ +kilo_byte(0, Acc) ->
    │ │ │      Acc;
    │ │ │ -kilo_byte(N, Acc) ->
    │ │ │ -    kilo_byte(N-1, [Acc|Acc]).

    kilo_byte/1 creates a deep list. If list_to_binary/1 │ │ │ +kilo_byte(N, Acc) -> │ │ │ + kilo_byte(N-1, [Acc|Acc]).

    kilo_byte/1 creates a deep list. If list_to_binary/1 │ │ │ is called, the deep list can be converted to a binary of 1024 bytes:

    1> byte_size(list_to_binary(efficiency_guide:kilo_byte())).
    │ │ │  1024

    Using the erts_debug:size/1 BIF, it can be seen that the deep list only │ │ │ -requires 22 words of heap space:

    2> erts_debug:size(efficiency_guide:kilo_byte()).
    │ │ │ +requires 22 words of heap space:

    2> erts_debug:size(efficiency_guide:kilo_byte()).
    │ │ │  22

    Using the erts_debug:flat_size/1 BIF, the size of the deep list can be │ │ │ calculated if sharing is ignored. It becomes the size of the list when it has │ │ │ -been sent to another process or stored in an Ets table:

    3> erts_debug:flat_size(efficiency_guide:kilo_byte()).
    │ │ │ +been sent to another process or stored in an Ets table:

    3> erts_debug:flat_size(efficiency_guide:kilo_byte()).
    │ │ │  4094

    It can be verified that sharing will be lost if the data is inserted into an Ets │ │ │ -table:

    4> T = ets:new(tab, []).
    │ │ │ +table:

    4> T = ets:new(tab, []).
    │ │ │  #Ref<0.1662103692.2407923716.214181>
    │ │ │ -5> ets:insert(T, {key,efficiency_guide:kilo_byte()}).
    │ │ │ +5> ets:insert(T, {key,efficiency_guide:kilo_byte()}).
    │ │ │  true
    │ │ │ -6> erts_debug:size(element(2, hd(ets:lookup(T, key)))).
    │ │ │ +6> erts_debug:size(element(2, hd(ets:lookup(T, key)))).
    │ │ │  4094
    │ │ │ -7> erts_debug:flat_size(element(2, hd(ets:lookup(T, key)))).
    │ │ │ +7> erts_debug:flat_size(element(2, hd(ets:lookup(T, key)))).
    │ │ │  4094

    When the data has passed through an Ets table, erts_debug:size/1 and │ │ │ erts_debug:flat_size/1 return the same value. Sharing has been lost.

    It is possible to build an experimental variant of the runtime system that │ │ │ will preserve sharing when copying terms by giving the │ │ │ --enable-sharing-preserving option to the configure script.

    │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/erl_interface.html │ │ │ @@ -120,119 +120,119 @@ │ │ │ to read the port example in Ports before reading this section.

    │ │ │ │ │ │ │ │ │ │ │ │ Erlang Program │ │ │

    │ │ │

    The following example shows an Erlang program communicating with a C program │ │ │ -over a plain port with home made encoding:

    -module(complex1).
    │ │ │ --export([start/1, stop/0, init/1]).
    │ │ │ --export([foo/1, bar/1]).
    │ │ │ -
    │ │ │ -start(ExtPrg) ->
    │ │ │ -    spawn(?MODULE, init, [ExtPrg]).
    │ │ │ -stop() ->
    │ │ │ +over a plain port with home made encoding:

    -module(complex1).
    │ │ │ +-export([start/1, stop/0, init/1]).
    │ │ │ +-export([foo/1, bar/1]).
    │ │ │ +
    │ │ │ +start(ExtPrg) ->
    │ │ │ +    spawn(?MODULE, init, [ExtPrg]).
    │ │ │ +stop() ->
    │ │ │      complex ! stop.
    │ │ │  
    │ │ │ -foo(X) ->
    │ │ │ -    call_port({foo, X}).
    │ │ │ -bar(Y) ->
    │ │ │ -    call_port({bar, Y}).
    │ │ │ +foo(X) ->
    │ │ │ +    call_port({foo, X}).
    │ │ │ +bar(Y) ->
    │ │ │ +    call_port({bar, Y}).
    │ │ │  
    │ │ │ -call_port(Msg) ->
    │ │ │ -    complex ! {call, self(), Msg},
    │ │ │ +call_port(Msg) ->
    │ │ │ +    complex ! {call, self(), Msg},
    │ │ │      receive
    │ │ │ -	{complex, Result} ->
    │ │ │ +	{complex, Result} ->
    │ │ │  	    Result
    │ │ │      end.
    │ │ │  
    │ │ │ -init(ExtPrg) ->
    │ │ │ -    register(complex, self()),
    │ │ │ -    process_flag(trap_exit, true),
    │ │ │ -    Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
    │ │ │ -    loop(Port).
    │ │ │ +init(ExtPrg) ->
    │ │ │ +    register(complex, self()),
    │ │ │ +    process_flag(trap_exit, true),
    │ │ │ +    Port = open_port({spawn, ExtPrg}, [{packet, 2}]),
    │ │ │ +    loop(Port).
    │ │ │  
    │ │ │ -loop(Port) ->
    │ │ │ +loop(Port) ->
    │ │ │      receive
    │ │ │ -	{call, Caller, Msg} ->
    │ │ │ -	    Port ! {self(), {command, encode(Msg)}},
    │ │ │ +	{call, Caller, Msg} ->
    │ │ │ +	    Port ! {self(), {command, encode(Msg)}},
    │ │ │  	    receive
    │ │ │ -		{Port, {data, Data}} ->
    │ │ │ -		    Caller ! {complex, decode(Data)}
    │ │ │ +		{Port, {data, Data}} ->
    │ │ │ +		    Caller ! {complex, decode(Data)}
    │ │ │  	    end,
    │ │ │ -	    loop(Port);
    │ │ │ +	    loop(Port);
    │ │ │  	stop ->
    │ │ │ -	    Port ! {self(), close},
    │ │ │ +	    Port ! {self(), close},
    │ │ │  	    receive
    │ │ │ -		{Port, closed} ->
    │ │ │ -		    exit(normal)
    │ │ │ +		{Port, closed} ->
    │ │ │ +		    exit(normal)
    │ │ │  	    end;
    │ │ │ -	{'EXIT', Port, Reason} ->
    │ │ │ -	    exit(port_terminated)
    │ │ │ +	{'EXIT', Port, Reason} ->
    │ │ │ +	    exit(port_terminated)
    │ │ │      end.
    │ │ │  
    │ │ │ -encode({foo, X}) -> [1, X];
    │ │ │ -encode({bar, Y}) -> [2, Y].
    │ │ │ +encode({foo, X}) -> [1, X];
    │ │ │ +encode({bar, Y}) -> [2, Y].
    │ │ │  
    │ │ │ -decode([Int]) -> Int.

    There are two differences when using Erl_Interface on the C side compared to the │ │ │ +decode([Int]) -> Int.

    There are two differences when using Erl_Interface on the C side compared to the │ │ │ example in Ports, using only the plain port:

    • As Erl_Interface operates on the Erlang external term format, the port must be │ │ │ set to use binaries.
    • Instead of inventing an encoding/decoding scheme, the │ │ │ term_to_binary/1 and │ │ │ -binary_to_term/1 BIFs are to be used.

    That is:

    open_port({spawn, ExtPrg}, [{packet, 2}])

    is replaced with:

    open_port({spawn, ExtPrg}, [{packet, 2}, binary])

    And:

    Port ! {self(), {command, encode(Msg)}},
    │ │ │ +binary_to_term/1 BIFs are to be used.

    That is:

    open_port({spawn, ExtPrg}, [{packet, 2}])

    is replaced with:

    open_port({spawn, ExtPrg}, [{packet, 2}, binary])

    And:

    Port ! {self(), {command, encode(Msg)}},
    │ │ │  receive
    │ │ │ -  {Port, {data, Data}} ->
    │ │ │ -    Caller ! {complex, decode(Data)}
    │ │ │ -end

    is replaced with:

    Port ! {self(), {command, term_to_binary(Msg)}},
    │ │ │ +  {Port, {data, Data}} ->
    │ │ │ +    Caller ! {complex, decode(Data)}
    │ │ │ +end

    is replaced with:

    Port ! {self(), {command, term_to_binary(Msg)}},
    │ │ │  receive
    │ │ │ -  {Port, {data, Data}} ->
    │ │ │ -    Caller ! {complex, binary_to_term(Data)}
    │ │ │ -end

    The resulting Erlang program is as follows:

    -module(complex2).
    │ │ │ --export([start/1, stop/0, init/1]).
    │ │ │ --export([foo/1, bar/1]).
    │ │ │ -
    │ │ │ -start(ExtPrg) ->
    │ │ │ -    spawn(?MODULE, init, [ExtPrg]).
    │ │ │ -stop() ->
    │ │ │ +  {Port, {data, Data}} ->
    │ │ │ +    Caller ! {complex, binary_to_term(Data)}
    │ │ │ +end

    The resulting Erlang program is as follows:

    -module(complex2).
    │ │ │ +-export([start/1, stop/0, init/1]).
    │ │ │ +-export([foo/1, bar/1]).
    │ │ │ +
    │ │ │ +start(ExtPrg) ->
    │ │ │ +    spawn(?MODULE, init, [ExtPrg]).
    │ │ │ +stop() ->
    │ │ │      complex ! stop.
    │ │ │  
    │ │ │ -foo(X) ->
    │ │ │ -    call_port({foo, X}).
    │ │ │ -bar(Y) ->
    │ │ │ -    call_port({bar, Y}).
    │ │ │ +foo(X) ->
    │ │ │ +    call_port({foo, X}).
    │ │ │ +bar(Y) ->
    │ │ │ +    call_port({bar, Y}).
    │ │ │  
    │ │ │ -call_port(Msg) ->
    │ │ │ -    complex ! {call, self(), Msg},
    │ │ │ +call_port(Msg) ->
    │ │ │ +    complex ! {call, self(), Msg},
    │ │ │      receive
    │ │ │ -	{complex, Result} ->
    │ │ │ +	{complex, Result} ->
    │ │ │  	    Result
    │ │ │      end.
    │ │ │  
    │ │ │ -init(ExtPrg) ->
    │ │ │ -    register(complex, self()),
    │ │ │ -    process_flag(trap_exit, true),
    │ │ │ -    Port = open_port({spawn, ExtPrg}, [{packet, 2}, binary]),
    │ │ │ -    loop(Port).
    │ │ │ +init(ExtPrg) ->
    │ │ │ +    register(complex, self()),
    │ │ │ +    process_flag(trap_exit, true),
    │ │ │ +    Port = open_port({spawn, ExtPrg}, [{packet, 2}, binary]),
    │ │ │ +    loop(Port).
    │ │ │  
    │ │ │ -loop(Port) ->
    │ │ │ +loop(Port) ->
    │ │ │      receive
    │ │ │ -	{call, Caller, Msg} ->
    │ │ │ -	    Port ! {self(), {command, term_to_binary(Msg)}},
    │ │ │ +	{call, Caller, Msg} ->
    │ │ │ +	    Port ! {self(), {command, term_to_binary(Msg)}},
    │ │ │  	    receive
    │ │ │ -		{Port, {data, Data}} ->
    │ │ │ -		    Caller ! {complex, binary_to_term(Data)}
    │ │ │ +		{Port, {data, Data}} ->
    │ │ │ +		    Caller ! {complex, binary_to_term(Data)}
    │ │ │  	    end,
    │ │ │ -	    loop(Port);
    │ │ │ +	    loop(Port);
    │ │ │  	stop ->
    │ │ │ -	    Port ! {self(), close},
    │ │ │ +	    Port ! {self(), close},
    │ │ │  	    receive
    │ │ │ -		{Port, closed} ->
    │ │ │ -		    exit(normal)
    │ │ │ +		{Port, closed} ->
    │ │ │ +		    exit(normal)
    │ │ │  	    end;
    │ │ │ -	{'EXIT', Port, Reason} ->
    │ │ │ -	    exit(port_terminated)
    │ │ │ +	{'EXIT', Port, Reason} ->
    │ │ │ +	    exit(port_terminated)
    │ │ │      end.

    Notice that calling complex2:foo/1 and complex2:bar/1 results in the tuple │ │ │ {foo,X} or {bar,Y} being sent to the complex process, which codes them as │ │ │ binaries and sends them to the port. This means that the C program must be able │ │ │ to handle these two tuples.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -362,27 +362,27 @@ │ │ │ -L/usr/local/otp/lib/erl_interface-3.9.2/lib \ │ │ │ complex.c erl_comm.c ei.c -lei -lpthread

    In Erlang/OTP R5B and later versions of OTP, the include and lib directories │ │ │ are situated under $OTPROOT/lib/erl_interface-VSN, where $OTPROOT is the │ │ │ root directory of the OTP installation (/usr/local/otp in the recent example) │ │ │ and VSN is the version of the Erl_interface application (3.2.1 in the recent │ │ │ example).

    In R4B and earlier versions of OTP, include and lib are situated under │ │ │ $OTPROOT/usr.

    Step 2. Start Erlang and compile the Erlang code:

    $ erl
    │ │ │ -Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
    │ │ │ +Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
    │ │ │  
    │ │ │ -Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
    │ │ │ -1> c(complex2).
    │ │ │ -{ok,complex2}

    Step 3. Run the example:

    2> complex2:start("./extprg").
    │ │ │ +Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
    │ │ │ +1> c(complex2).
    │ │ │ +{ok,complex2}

    Step 3. Run the example:

    2> complex2:start("./extprg").
    │ │ │  <0.34.0>
    │ │ │ -3> complex2:foo(3).
    │ │ │ +3> complex2:foo(3).
    │ │ │  4
    │ │ │ -4> complex2:bar(5).
    │ │ │ +4> complex2:bar(5).
    │ │ │  10
    │ │ │ -5> complex2:bar(352).
    │ │ │ +5> complex2:bar(352).
    │ │ │  704
    │ │ │ -6> complex2:stop().
    │ │ │ +6> complex2:stop().
    │ │ │  stop
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │

    logger_sasl_compatible to │ │ │ true. For more information, see │ │ │ SASL Error Logging in the SASL User's Guide.

    % erl -kernel logger_level info
    │ │ │ -Erlang/OTP 21 [erts-10.0] [source-13c50db] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
    │ │ │ +Erlang/OTP 21 [erts-10.0] [source-13c50db] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
    │ │ │  
    │ │ │  =PROGRESS REPORT==== 8-Jun-2018::16:54:19.916404 ===
    │ │ │      application: kernel
    │ │ │      started_at: nonode@nohost
    │ │ │  =PROGRESS REPORT==== 8-Jun-2018::16:54:19.922908 ===
    │ │ │      application: stdlib
    │ │ │      started_at: nonode@nohost
    │ │ │  =PROGRESS REPORT==== 8-Jun-2018::16:54:19.925755 ===
    │ │ │ -    supervisor: {local,kernel_safe_sup}
    │ │ │ -    started: [{pid,<0.74.0>},
    │ │ │ -              {id,disk_log_sup},
    │ │ │ -              {mfargs,{disk_log_sup,start_link,[]}},
    │ │ │ -              {restart_type,permanent},
    │ │ │ -              {shutdown,1000},
    │ │ │ -              {child_type,supervisor}]
    │ │ │ +    supervisor: {local,kernel_safe_sup}
    │ │ │ +    started: [{pid,<0.74.0>},
    │ │ │ +              {id,disk_log_sup},
    │ │ │ +              {mfargs,{disk_log_sup,start_link,[]}},
    │ │ │ +              {restart_type,permanent},
    │ │ │ +              {shutdown,1000},
    │ │ │ +              {child_type,supervisor}]
    │ │ │  =PROGRESS REPORT==== 8-Jun-2018::16:54:19.926056 ===
    │ │ │ -    supervisor: {local,kernel_safe_sup}
    │ │ │ -    started: [{pid,<0.75.0>},
    │ │ │ -              {id,disk_log_server},
    │ │ │ -              {mfargs,{disk_log_server,start_link,[]}},
    │ │ │ -              {restart_type,permanent},
    │ │ │ -              {shutdown,2000},
    │ │ │ -              {child_type,worker}]
    │ │ │ -Eshell V10.0  (abort with ^G)
    │ │ │ +    supervisor: {local,kernel_safe_sup}
    │ │ │ +    started: [{pid,<0.75.0>},
    │ │ │ +              {id,disk_log_server},
    │ │ │ +              {mfargs,{disk_log_server,start_link,[]}},
    │ │ │ +              {restart_type,permanent},
    │ │ │ +              {shutdown,2000},
    │ │ │ +              {child_type,worker}]
    │ │ │ +Eshell V10.0  (abort with ^G)
    │ │ │  1>
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │ try expression can │ │ │ distinguish between the different classes, whereas the │ │ │ catch expression cannot. try and catch are described │ │ │ in Expressions.

    ClassOrigin
    errorRun-time error, for example, 1+a, or the process called error/1
    exitThe process called exit/1
    throwThe process called throw/1

    Table: Exception Classes.

    All of the above exceptions can also be generated by calling erlang:raise/3.

    An exception consists of its class, an exit reason (see │ │ │ Exit Reason), and a stack trace (which aids in finding │ │ │ the code location of the exception).

    The stack trace can be bound to a variable from within a try expression for │ │ │ any exception class, or as part of the exit reason when a run-time error is │ │ │ -caught by a catch. Example:

    > {'EXIT',{test,Stacktrace}} = (catch error(test)), Stacktrace.
    │ │ │ -[{shell,apply_fun,3,[]},
    │ │ │ - {erl_eval,do_apply,6,[]},
    │ │ │ - ...]
    │ │ │ -> try throw(test) catch Class:Reason:Stacktrace -> Stacktrace end.
    │ │ │ -[{shell,apply_fun,3,[]},
    │ │ │ - {erl_eval,do_apply,6,[]},
    │ │ │ - ...]

    │ │ │ +caught by a catch. Example:

    > {'EXIT',{test,Stacktrace}} = (catch error(test)), Stacktrace.
    │ │ │ +[{shell,apply_fun,3,[]},
    │ │ │ + {erl_eval,do_apply,6,[]},
    │ │ │ + ...]
    │ │ │ +> try throw(test) catch Class:Reason:Stacktrace -> Stacktrace end.
    │ │ │ +[{shell,apply_fun,3,[]},
    │ │ │ + {erl_eval,do_apply,6,[]},
    │ │ │ + ...]

    │ │ │ │ │ │ │ │ │ │ │ │ The call-stack back trace (stacktrace) │ │ │

    │ │ │

    The stack back-trace (stacktrace) is a list that │ │ │ contains {Module, Function, Arity, ExtraInfo} and/or {Fun, Arity, ExtraInfo} │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/events.html │ │ │ @@ -135,43 +135,43 @@ │ │ │ event handler.

    │ │ │ │ │ │ │ │ │ │ │ │ Example │ │ │

    │ │ │

    The callback module for the event handler writing error messages to the terminal │ │ │ -can look as follows:

    -module(terminal_logger).
    │ │ │ --behaviour(gen_event).
    │ │ │ +can look as follows:

    -module(terminal_logger).
    │ │ │ +-behaviour(gen_event).
    │ │ │  
    │ │ │ --export([init/1, handle_event/2, terminate/2]).
    │ │ │ +-export([init/1, handle_event/2, terminate/2]).
    │ │ │  
    │ │ │ -init(_Args) ->
    │ │ │ -    {ok, []}.
    │ │ │ +init(_Args) ->
    │ │ │ +    {ok, []}.
    │ │ │  
    │ │ │ -handle_event(ErrorMsg, State) ->
    │ │ │ -    io:format("***Error*** ~p~n", [ErrorMsg]),
    │ │ │ -    {ok, State}.
    │ │ │ +handle_event(ErrorMsg, State) ->
    │ │ │ +    io:format("***Error*** ~p~n", [ErrorMsg]),
    │ │ │ +    {ok, State}.
    │ │ │  
    │ │ │ -terminate(_Args, _State) ->
    │ │ │ +terminate(_Args, _State) ->
    │ │ │      ok.

    The callback module for the event handler writing error messages to a file can │ │ │ -look as follows:

    -module(file_logger).
    │ │ │ --behaviour(gen_event).
    │ │ │ +look as follows:

    -module(file_logger).
    │ │ │ +-behaviour(gen_event).
    │ │ │  
    │ │ │ --export([init/1, handle_event/2, terminate/2]).
    │ │ │ +-export([init/1, handle_event/2, terminate/2]).
    │ │ │  
    │ │ │ -init(File) ->
    │ │ │ -    {ok, Fd} = file:open(File, read),
    │ │ │ -    {ok, Fd}.
    │ │ │ -
    │ │ │ -handle_event(ErrorMsg, Fd) ->
    │ │ │ -    io:format(Fd, "***Error*** ~p~n", [ErrorMsg]),
    │ │ │ -    {ok, Fd}.
    │ │ │ +init(File) ->
    │ │ │ +    {ok, Fd} = file:open(File, read),
    │ │ │ +    {ok, Fd}.
    │ │ │ +
    │ │ │ +handle_event(ErrorMsg, Fd) ->
    │ │ │ +    io:format(Fd, "***Error*** ~p~n", [ErrorMsg]),
    │ │ │ +    {ok, Fd}.
    │ │ │  
    │ │ │ -terminate(_Args, Fd) ->
    │ │ │ -    file:close(Fd).

    The code is explained in the next sections.

    │ │ │ +terminate(_Args, Fd) -> │ │ │ + file:close(Fd).

    The code is explained in the next sections.

    │ │ │ │ │ │ │ │ │ │ │ │ Starting an Event Manager │ │ │

    │ │ │

    To start an event manager for handling errors, as described in the previous │ │ │ example, call the following function:

    gen_event:start_link({local, error_man})

    gen_event:start_link/1 spawns and links to a new event manager process.

    The argument, {local, error_man}, specifies the name under which the │ │ │ @@ -184,57 +184,57 @@ │ │ │ manager that is not part of a supervision tree.

    │ │ │ │ │ │ │ │ │ │ │ │ Adding an Event Handler │ │ │

    │ │ │

    The following example shows how to start an event manager and add an event │ │ │ -handler to it by using the shell:

    1> gen_event:start({local, error_man}).
    │ │ │ -{ok,<0.31.0>}
    │ │ │ -2> gen_event:add_handler(error_man, terminal_logger, []).
    │ │ │ +handler to it by using the shell:

    1> gen_event:start({local, error_man}).
    │ │ │ +{ok,<0.31.0>}
    │ │ │ +2> gen_event:add_handler(error_man, terminal_logger, []).
    │ │ │  ok

    This function sends a message to the event manager registered as error_man, │ │ │ telling it to add the event handler terminal_logger. The event manager calls │ │ │ the callback function terminal_logger:init([]), where the argument [] is the │ │ │ third argument to add_handler. init/1 is expected to return {ok, State}, │ │ │ -where State is the internal state of the event handler.

    init(_Args) ->
    │ │ │ -    {ok, []}.

    Here, init/1 does not need any input data and ignores its argument. For │ │ │ +where State is the internal state of the event handler.

    init(_Args) ->
    │ │ │ +    {ok, []}.

    Here, init/1 does not need any input data and ignores its argument. For │ │ │ terminal_logger, the internal state is not used. For file_logger, the │ │ │ -internal state is used to save the open file descriptor.

    init(File) ->
    │ │ │ -    {ok, Fd} = file:open(File, read),
    │ │ │ -    {ok, Fd}.

    │ │ │ +internal state is used to save the open file descriptor.

    init(File) ->
    │ │ │ +    {ok, Fd} = file:open(File, read),
    │ │ │ +    {ok, Fd}.

    │ │ │ │ │ │ │ │ │ │ │ │ Notifying about Events │ │ │

    │ │ │
    3> gen_event:notify(error_man, no_reply).
    │ │ │  ***Error*** no_reply
    │ │ │  ok

    error_man is the name of the event manager and no_reply is the event.

    The event is made into a message and sent to the event manager. When the event │ │ │ is received, the event manager calls handle_event(Event, State) for each │ │ │ installed event handler, in the same order as they were added. The function is │ │ │ expected to return a tuple {ok,State1}, where State1 is a new value for the │ │ │ -state of the event handler.

    In terminal_logger:

    handle_event(ErrorMsg, State) ->
    │ │ │ -    io:format("***Error*** ~p~n", [ErrorMsg]),
    │ │ │ -    {ok, State}.

    In file_logger:

    handle_event(ErrorMsg, Fd) ->
    │ │ │ -    io:format(Fd, "***Error*** ~p~n", [ErrorMsg]),
    │ │ │ -    {ok, Fd}.

    │ │ │ +state of the event handler.

    In terminal_logger:

    handle_event(ErrorMsg, State) ->
    │ │ │ +    io:format("***Error*** ~p~n", [ErrorMsg]),
    │ │ │ +    {ok, State}.

    In file_logger:

    handle_event(ErrorMsg, Fd) ->
    │ │ │ +    io:format(Fd, "***Error*** ~p~n", [ErrorMsg]),
    │ │ │ +    {ok, Fd}.

    │ │ │ │ │ │ │ │ │ │ │ │ Deleting an Event Handler │ │ │

    │ │ │ -
    4> gen_event:delete_handler(error_man, terminal_logger, []).
    │ │ │ +
    4> gen_event:delete_handler(error_man, terminal_logger, []).
    │ │ │  ok

    This function sends a message to the event manager registered as error_man, │ │ │ telling it to delete the event handler terminal_logger. The event manager │ │ │ calls the callback function terminal_logger:terminate([], State), where the │ │ │ argument [] is the third argument to delete_handler. terminate/2 is to be │ │ │ the opposite of init/1 and do any necessary cleaning up. Its return value is │ │ │ -ignored.

    For terminal_logger, no cleaning up is necessary:

    terminate(_Args, _State) ->
    │ │ │ -    ok.

    For file_logger, the file descriptor opened in init must be closed:

    terminate(_Args, Fd) ->
    │ │ │ -    file:close(Fd).

    │ │ │ +ignored.

    For terminal_logger, no cleaning up is necessary:

    terminate(_Args, _State) ->
    │ │ │ +    ok.

    For file_logger, the file descriptor opened in init must be closed:

    terminate(_Args, Fd) ->
    │ │ │ +    file:close(Fd).

    │ │ │ │ │ │ │ │ │ │ │ │ Stopping │ │ │

    │ │ │

    When an event manager is stopped, it gives each of the installed event handlers │ │ │ the chance to clean up by calling terminate/2, the same way as when deleting a │ │ │ @@ -249,33 +249,33 @@ │ │ │ this is done is defined by a shutdown strategy set in │ │ │ the supervisor.

    │ │ │ │ │ │ │ │ │ │ │ │ Standalone Event Managers │ │ │

    │ │ │ -

    An event manager can also be stopped by calling:

    1> gen_event:stop(error_man).
    │ │ │ +

    An event manager can also be stopped by calling:

    1> gen_event:stop(error_man).
    │ │ │  ok

    │ │ │ │ │ │ │ │ │ │ │ │ Handling Other Messages │ │ │

    │ │ │

    If the gen_event process is to be able to receive other messages │ │ │ than events, the callback function handle_info(Info, State) must be │ │ │ implemented to handle them. Examples of other messages are exit │ │ │ messages if the event manager is linked to other processes than the │ │ │ supervisor (for example via gen_event:add_sup_handler/3) and is │ │ │ -trapping exit signals.

    handle_info({'EXIT', Pid, Reason}, State) ->
    │ │ │ +trapping exit signals.

    handle_info({'EXIT', Pid, Reason}, State) ->
    │ │ │      %% Code to handle exits here.
    │ │ │      ...
    │ │ │ -    {noreply, State1}.

    The final function to implement is code_change/3:

    code_change(OldVsn, State, Extra) ->
    │ │ │ +    {noreply, State1}.

    The final function to implement is code_change/3:

    code_change(OldVsn, State, Extra) ->
    │ │ │      %% Code to convert state (and more) during code change.
    │ │ │      ...
    │ │ │ -    {ok, NewState}.
    │ │ │ +
    {ok, NewState}.
    │ │ │
    │ │ │ │ │ │

    pattern matching. Erlang uses │ │ │ single assignment, that is, a variable can only be bound once.

    The anonymous variable is denoted by underscore (_) and can be used when a │ │ │ variable is required but its value can be ignored.

    Example:

    [H|_] = [1,2,3]

    Variables starting with underscore (_), for example, _Height, are normal │ │ │ variables, not anonymous. However, they are ignored by the compiler in the sense │ │ │ -that they do not generate warnings.

    Example:

    The following code:

    member(_, []) ->
    │ │ │ -    [].

    can be rewritten to be more readable:

    member(Elem, []) ->
    │ │ │ -    [].

    This causes a warning for an unused variable, Elem. To avoid the warning, │ │ │ -the code can be rewritten to:

    member(_Elem, []) ->
    │ │ │ -    [].

    Notice that since variables starting with an underscore are not anonymous, the │ │ │ -following example matches:

    {_,_} = {1,2}

    But this example fails:

    {_N,_N} = {1,2}

    The scope for a variable is its function clause. Variables bound in a branch of │ │ │ +that they do not generate warnings.

    Example:

    The following code:

    member(_, []) ->
    │ │ │ +    [].

    can be rewritten to be more readable:

    member(Elem, []) ->
    │ │ │ +    [].

    This causes a warning for an unused variable, Elem. To avoid the warning, │ │ │ +the code can be rewritten to:

    member(_Elem, []) ->
    │ │ │ +    [].

    Notice that since variables starting with an underscore are not anonymous, the │ │ │ +following example matches:

    {_,_} = {1,2}

    But this example fails:

    {_N,_N} = {1,2}

    The scope for a variable is its function clause. Variables bound in a branch of │ │ │ an if, case, or receive expression must be bound in all branches to have a │ │ │ value outside the expression. Otherwise they are regarded as unsafe outside │ │ │ the expression.

    For the try expression variable scoping is limited so that variables bound in │ │ │ the expression are always unsafe outside the expression.

    │ │ │ │ │ │ │ │ │ │ │ │ Patterns │ │ │

    │ │ │

    A pattern has the same structure as a term but can contain unbound variables.

    Example:

    Name1
    │ │ │ -[H|T]
    │ │ │ -{error,Reason}

    Patterns are allowed in clause heads, case expressions, │ │ │ +[H|T] │ │ │ +{error,Reason}

    Patterns are allowed in clause heads, case expressions, │ │ │ receive expressions, and │ │ │ match expressions.

    │ │ │ │ │ │ │ │ │ │ │ │ The Compound Pattern Operator │ │ │

    │ │ │

    If Pattern1 and Pattern2 are valid patterns, the following is also a valid │ │ │ pattern:

    Pattern1 = Pattern2

    When matched against a term, both Pattern1 and Pattern2 are matched against │ │ │ -the term. The idea behind this feature is to avoid reconstruction of terms.

    Example:

    f({connect,From,To,Number,Options}, To) ->
    │ │ │ -    Signal = {connect,From,To,Number,Options},
    │ │ │ +the term. The idea behind this feature is to avoid reconstruction of terms.

    Example:

    f({connect,From,To,Number,Options}, To) ->
    │ │ │ +    Signal = {connect,From,To,Number,Options},
    │ │ │      ...;
    │ │ │ -f(Signal, To) ->
    │ │ │ -    ignore.

    can instead be written as

    f({connect,_,To,_,_} = Signal, To) ->
    │ │ │ +f(Signal, To) ->
    │ │ │ +    ignore.

    can instead be written as

    f({connect,_,To,_,_} = Signal, To) ->
    │ │ │      ...;
    │ │ │ -f(Signal, To) ->
    │ │ │ +f(Signal, To) ->
    │ │ │      ignore.

    The compound pattern operator does not imply that its operands are matched in │ │ │ any particular order. That means that it is not legal to bind a variable in │ │ │ Pattern1 and use it in Pattern2, or vice versa.

    │ │ │ │ │ │ │ │ │ │ │ │ String Prefix in Patterns │ │ │

    │ │ │ -

    When matching strings, the following is a valid pattern:

    f("prefix" ++ Str) -> ...

    This is syntactic sugar for the equivalent, but harder to read:

    f([$p,$r,$e,$f,$i,$x | Str]) -> ...

    │ │ │ +

    When matching strings, the following is a valid pattern:

    f("prefix" ++ Str) -> ...

    This is syntactic sugar for the equivalent, but harder to read:

    f([$p,$r,$e,$f,$i,$x | Str]) -> ...

    │ │ │ │ │ │ │ │ │ │ │ │ Expressions in Patterns │ │ │

    │ │ │

    An arithmetic expression can be used within a pattern if it meets both of the │ │ │ -following two conditions:

    • It uses only numeric or bitwise operators.
    • Its value can be evaluated to a constant when complied.

    Example:

    case {Value, Result} of
    │ │ │ -    {?THRESHOLD+1, ok} -> ...

    │ │ │ +following two conditions:

    • It uses only numeric or bitwise operators.
    • Its value can be evaluated to a constant when complied.

    Example:

    case {Value, Result} of
    │ │ │ +    {?THRESHOLD+1, ok} -> ...

    │ │ │ │ │ │ │ │ │ │ │ │ The Match Operator │ │ │

    │ │ │

    The following matches Pattern against Expr:

    Pattern = Expr

    If the matching succeeds, any unbound variable in the pattern becomes bound and │ │ │ the value of Expr is returned.

    If multiple match operators are applied in sequence, they will be evaluated from │ │ │ -right to left.

    If the matching fails, a badmatch run-time error occurs.

    Examples:

    1> {A, B} = T = {answer, 42}.
    │ │ │ -{answer,42}
    │ │ │ +right to left.

    If the matching fails, a badmatch run-time error occurs.

    Examples:

    1> {A, B} = T = {answer, 42}.
    │ │ │ +{answer,42}
    │ │ │  2> A.
    │ │ │  answer
    │ │ │  3> B.
    │ │ │  42
    │ │ │  4> T.
    │ │ │ -{answer,42}
    │ │ │ -5> {C, D} = [1, 2].
    │ │ │ +{answer,42}
    │ │ │ +5> {C, D} = [1, 2].
    │ │ │  ** exception error: no match of right-hand side value [1,2]

    Because multiple match operators are evaluated from right to left, it means │ │ │ that:

    Pattern1 = Pattern2 = . . . = PatternN = Expression

    is equivalent to:

    Temporary = Expression,
    │ │ │  PatternN = Temporary,
    │ │ │     .
    │ │ │     .
    │ │ │     .,
    │ │ │  Pattern2 = Temporary,
    │ │ │ @@ -239,30 +239,30 @@
    │ │ │  can safely be skipped on a first reading.

    The = character is used to denote two similar but distinct operators: the │ │ │ match operator and the compound pattern operator. Which one is meant is │ │ │ determined by context.

    The compound pattern operator is used to construct a compound pattern from two │ │ │ patterns. Compound patterns are accepted everywhere a pattern is accepted. A │ │ │ compound pattern matches if all of its constituent patterns match. It is not │ │ │ legal for a pattern that is part of a compound pattern to use variables (as keys │ │ │ in map patterns or sizes in binary patterns) bound in other sub patterns of the │ │ │ -same compound pattern.

    Examples:

    1> fun(#{Key := Value} = #{key := Key}) -> Value end.
    │ │ │ +same compound pattern.

    Examples:

    1> fun(#{Key := Value} = #{key := Key}) -> Value end.
    │ │ │  * 1:7: variable 'Key' is unbound
    │ │ │ -2> F = fun({A, B} = E) -> {E, A + B} end, F({1,2}).
    │ │ │ -{{1,2},3}
    │ │ │ -3> G = fun(<<A:8,B:8>> = <<C:16>>) -> {A, B, C} end, G(<<42,43>>).
    │ │ │ -{42,43,10795}

    The match operator is allowed everywhere an expression is allowed. It is used │ │ │ +2> F = fun({A, B} = E) -> {E, A + B} end, F({1,2}). │ │ │ +{{1,2},3} │ │ │ +3> G = fun(<<A:8,B:8>> = <<C:16>>) -> {A, B, C} end, G(<<42,43>>). │ │ │ +{42,43,10795}

    The match operator is allowed everywhere an expression is allowed. It is used │ │ │ to match the value of an expression to a pattern. If multiple match operators │ │ │ -are applied in sequence, they will be evaluated from right to left.

    Examples:

    1> M = #{key => key2, key2 => value}.
    │ │ │ -#{key => key2,key2 => value}
    │ │ │ -2> f(Key), #{Key := Value} = #{key := Key} = M, Value.
    │ │ │ +are applied in sequence, they will be evaluated from right to left.

    Examples:

    1> M = #{key => key2, key2 => value}.
    │ │ │ +#{key => key2,key2 => value}
    │ │ │ +2> f(Key), #{Key := Value} = #{key := Key} = M, Value.
    │ │ │  value
    │ │ │ -3> f(Key), #{Key := Value} = (#{key := Key} = M), Value.
    │ │ │ +3> f(Key), #{Key := Value} = (#{key := Key} = M), Value.
    │ │ │  value
    │ │ │ -4> f(Key), (#{Key := Value} = #{key := Key}) = M, Value.
    │ │ │ +4> f(Key), (#{Key := Value} = #{key := Key}) = M, Value.
    │ │ │  * 1:12: variable 'Key' is unbound
    │ │ │ -5> <<X:Y>> = begin Y = 8, <<42:8>> end, X.
    │ │ │ +5> <<X:Y>> = begin Y = 8, <<42:8>> end, X.
    │ │ │  42

    The expression at prompt 2> first matches the value of variable M against │ │ │ pattern #{key := Key}, binding variable Key. It then matches the value of │ │ │ M against pattern #{Key := Value} using variable Key as the key, binding │ │ │ variable Value.

    The expression at prompt 3> matches expression (#{key := Key} = M) against │ │ │ pattern #{Key := Value}. The expression inside the parentheses is evaluated │ │ │ first. That is, M is matched against #{key := Key}, and then the value of │ │ │ M is matched against pattern #{Key := Value}. That is the same evaluation │ │ │ @@ -276,30 +276,30 @@ │ │ │ binding variable Y and creating a binary. The binary is then matched against │ │ │ pattern <<X:Y>> using the value of Y as the size of the segment.

    │ │ │ │ │ │ │ │ │ │ │ │ Function Calls │ │ │

    │ │ │ -
    ExprF(Expr1,...,ExprN)
    │ │ │ -ExprM:ExprF(Expr1,...,ExprN)

    In the first form of function calls, ExprM:ExprF(Expr1,...,ExprN), each of │ │ │ +

    ExprF(Expr1,...,ExprN)
    │ │ │ +ExprM:ExprF(Expr1,...,ExprN)

    In the first form of function calls, ExprM:ExprF(Expr1,...,ExprN), each of │ │ │ ExprM and ExprF must be an atom or an expression that evaluates to an atom. │ │ │ The function is said to be called by using the fully qualified function name. │ │ │ -This is often referred to as a remote or external function call.

    Example:

    lists:keyfind(Name, 1, List)

    In the second form of function calls, ExprF(Expr1,...,ExprN), ExprF must be │ │ │ +This is often referred to as a remote or external function call.

    Example:

    lists:keyfind(Name, 1, List)

    In the second form of function calls, ExprF(Expr1,...,ExprN), ExprF must be │ │ │ an atom or evaluate to a fun.

    If ExprF is an atom, the function is said to be called by using the │ │ │ implicitly qualified function name. If the function ExprF is locally │ │ │ defined, it is called. Alternatively, if ExprF is explicitly imported from the │ │ │ M module, M:ExprF(Expr1,...,ExprN) is called. If ExprF is neither declared │ │ │ locally nor explicitly imported, ExprF must be the name of an automatically │ │ │ -imported BIF.

    Examples:

    handle(Msg, State)
    │ │ │ -spawn(m, init, [])

    Examples where ExprF is a fun:

    1> Fun1 = fun(X) -> X+1 end,
    │ │ │ -Fun1(3).
    │ │ │ +imported BIF.

    Examples:

    handle(Msg, State)
    │ │ │ +spawn(m, init, [])

    Examples where ExprF is a fun:

    1> Fun1 = fun(X) -> X+1 end,
    │ │ │ +Fun1(3).
    │ │ │  4
    │ │ │ -2> fun lists:append/2([1,2], [3,4]).
    │ │ │ -[1,2,3,4]
    │ │ │ +2> fun lists:append/2([1,2], [3,4]).
    │ │ │ +[1,2,3,4]
    │ │ │  3>

    Notice that when calling a local function, there is a difference between using │ │ │ the implicitly or fully qualified function name. The latter always refers to the │ │ │ latest version of the module. See │ │ │ Compilation and Code Loading and │ │ │ Function Evaluation.

    │ │ │ │ │ │ │ │ │ @@ -316,40 +316,40 @@ │ │ │ called instead. This is to avoid that future additions to the set of │ │ │ auto-imported BIFs do not silently change the behavior of old code.

    However, to avoid that old (pre R14) code changed its behavior when compiled │ │ │ with Erlang/OTP version R14A or later, the following restriction applies: If you │ │ │ override the name of a BIF that was auto-imported in OTP versions prior to R14A │ │ │ (ERTS version 5.8) and have an implicitly qualified call to that function in │ │ │ your code, you either need to explicitly remove the auto-import using a compiler │ │ │ directive, or replace the call with a fully qualified function call. Otherwise │ │ │ -you get a compilation error. See the following example:

    -export([length/1,f/1]).
    │ │ │ +you get a compilation error. See the following example:

    -export([length/1,f/1]).
    │ │ │  
    │ │ │ --compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported
    │ │ │ +-compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported
    │ │ │  
    │ │ │ -length([]) ->
    │ │ │ +length([]) ->
    │ │ │      0;
    │ │ │ -length([H|T]) ->
    │ │ │ -    1 + length(T). %% Calls the local function length/1
    │ │ │ +length([H|T]) ->
    │ │ │ +    1 + length(T). %% Calls the local function length/1
    │ │ │  
    │ │ │ -f(X) when erlang:length(X) > 3 -> %% Calls erlang:length/1,
    │ │ │ +f(X) when erlang:length(X) > 3 -> %% Calls erlang:length/1,
    │ │ │                                    %% which is allowed in guards
    │ │ │      long.

    The same logic applies to explicitly imported functions from other modules, as │ │ │ to locally defined functions. It is not allowed to both import a function from │ │ │ -another module and have the function declared in the module at the same time:

    -export([f/1]).
    │ │ │ +another module and have the function declared in the module at the same time:

    -export([f/1]).
    │ │ │  
    │ │ │ --compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported
    │ │ │ +-compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported
    │ │ │  
    │ │ │ --import(mod,[length/1]).
    │ │ │ +-import(mod,[length/1]).
    │ │ │  
    │ │ │ -f(X) when erlang:length(X) > 33 -> %% Calls erlang:length/1,
    │ │ │ +f(X) when erlang:length(X) > 33 -> %% Calls erlang:length/1,
    │ │ │                                     %% which is allowed in guards
    │ │ │  
    │ │ │ -    erlang:length(X);              %% Explicit call to erlang:length in body
    │ │ │ +    erlang:length(X);              %% Explicit call to erlang:length in body
    │ │ │  
    │ │ │ -f(X) ->
    │ │ │ -    length(X).                     %% mod:length/1 is called

    For auto-imported BIFs added in Erlang/OTP R14A and thereafter, overriding the │ │ │ +f(X) -> │ │ │ + length(X). %% mod:length/1 is called

    For auto-imported BIFs added in Erlang/OTP R14A and thereafter, overriding the │ │ │ name with a local function or explicit import is always allowed. However, if the │ │ │ -compile({no_auto_import,[F/A]) directive is not used, the compiler issues a │ │ │ warning whenever the function is called in the module using the implicitly │ │ │ qualified function name.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -361,40 +361,40 @@ │ │ │ ...; │ │ │ GuardSeqN -> │ │ │ BodyN │ │ │ end

    The branches of an if-expression are scanned sequentially until a guard │ │ │ sequence GuardSeq that evaluates to true is found. Then the corresponding │ │ │ Body (a sequence of expressions separated by ,) is evaluated.

    The return value of Body is the return value of the if expression.

    If no guard sequence is evaluated as true, an if_clause run-time error occurs. │ │ │ If necessary, the guard expression true can be used in the last branch, as │ │ │ -that guard sequence is always true.

    Example:

    is_greater_than(X, Y) ->
    │ │ │ +that guard sequence is always true.

    Example:

    is_greater_than(X, Y) ->
    │ │ │      if
    │ │ │          X > Y ->
    │ │ │              true;
    │ │ │          true -> % works as an 'else' branch
    │ │ │              false
    │ │ │      end

    │ │ │ │ │ │ │ │ │ │ │ │ Case │ │ │

    │ │ │
    case Expr of
    │ │ │ -    Pattern1 [when GuardSeq1] ->
    │ │ │ +    Pattern1 [when GuardSeq1] ->
    │ │ │          Body1;
    │ │ │      ...;
    │ │ │ -    PatternN [when GuardSeqN] ->
    │ │ │ +    PatternN [when GuardSeqN] ->
    │ │ │          BodyN
    │ │ │  end

    The expression Expr is evaluated and the patterns Pattern are sequentially │ │ │ matched against the result. If a match succeeds and the optional guard sequence │ │ │ GuardSeq is true, the corresponding Body is evaluated.

    The return value of Body is the return value of the case expression.

    If there is no matching pattern with a true guard sequence, a case_clause │ │ │ -run-time error occurs.

    Example:

    is_valid_signal(Signal) ->
    │ │ │ +run-time error occurs.

    Example:

    is_valid_signal(Signal) ->
    │ │ │      case Signal of
    │ │ │ -        {signal, _What, _From, _To} ->
    │ │ │ +        {signal, _What, _From, _To} ->
    │ │ │              true;
    │ │ │ -        {signal, _What, _To} ->
    │ │ │ +        {signal, _What, _To} ->
    │ │ │              true;
    │ │ │          _Else ->
    │ │ │              false
    │ │ │      end.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -412,57 +412,57 @@ │ │ │ the top-level of a maybe block. It matches the pattern Expr1 against │ │ │ Expr2. If the matching succeeds, any unbound variable in the pattern becomes │ │ │ bound. If the expression is the last expression in the maybe block, it also │ │ │ returns the value of Expr2. If the matching is unsuccessful, the rest of the │ │ │ expressions in the maybe block are skipped and the return value of the maybe │ │ │ block is Expr2.

    None of the variables bound in a maybe block must be used in the code that │ │ │ follows the block.

    Here is an example:

    maybe
    │ │ │ -    {ok, A} ?= a(),
    │ │ │ +    {ok, A} ?= a(),
    │ │ │      true = A >= 0,
    │ │ │ -    {ok, B} ?= b(),
    │ │ │ +    {ok, B} ?= b(),
    │ │ │      A + B
    │ │ │  end

    Let us first assume that a() returns {ok,42} and b() returns {ok,58}. │ │ │ With those return values, all of the match operators will succeed, and the │ │ │ return value of the maybe block is A + B, which is equal to 42 + 58 = 100.

    Now let us assume that a() returns error. The conditional match operator in │ │ │ {ok, A} ?= a() fails to match, and the return value of the maybe block is │ │ │ the value of the expression that failed to match, namely error. Similarly, if │ │ │ b() returns wrong, the return value of the maybe block is wrong.

    Finally, let us assume that a() returns {ok,-1}. Because true = A >= 0 uses │ │ │ the match operator =, a {badmatch,false} run-time error occurs when the │ │ │ -expression fails to match the pattern.

    The example can be written in a less succient way using nested case expressions:

    case a() of
    │ │ │ -    {ok, A} ->
    │ │ │ +expression fails to match the pattern.

    The example can be written in a less succient way using nested case expressions:

    case a() of
    │ │ │ +    {ok, A} ->
    │ │ │          true = A >= 0,
    │ │ │ -        case b() of
    │ │ │ -            {ok, B} ->
    │ │ │ +        case b() of
    │ │ │ +            {ok, B} ->
    │ │ │                  A + B;
    │ │ │              Other1 ->
    │ │ │                  Other1
    │ │ │          end;
    │ │ │      Other2 ->
    │ │ │          Other2
    │ │ │  end

    The maybe block can be augmented with else clauses:

    maybe
    │ │ │      Expr1,
    │ │ │      ...,
    │ │ │      ExprN
    │ │ │  else
    │ │ │ -    Pattern1 [when GuardSeq1] ->
    │ │ │ +    Pattern1 [when GuardSeq1] ->
    │ │ │          Body1;
    │ │ │      ...;
    │ │ │ -    PatternN [when GuardSeqN] ->
    │ │ │ +    PatternN [when GuardSeqN] ->
    │ │ │          BodyN
    │ │ │  end

    If a conditional match operator fails, the failed expression is matched against │ │ │ the patterns in all clauses between the else and end keywords. If a match │ │ │ succeeds and the optional guard sequence GuardSeq is true, the corresponding │ │ │ Body is evaluated. The value returned from the body is the return value of the │ │ │ maybe block.

    If there is no matching pattern with a true guard sequence, an else_clause │ │ │ run-time error occurs.

    None of the variables bound in a maybe block must be used in the else │ │ │ clauses. None of the variables bound in the else clauses must be used in the │ │ │ code that follows the maybe block.

    Here is the previous example augmented with else clauses:

    maybe
    │ │ │ -    {ok, A} ?= a(),
    │ │ │ +    {ok, A} ?= a(),
    │ │ │      true = A >= 0,
    │ │ │ -    {ok, B} ?= b(),
    │ │ │ +    {ok, B} ?= b(),
    │ │ │      A + B
    │ │ │  else
    │ │ │      error -> error;
    │ │ │      wrong -> error
    │ │ │  end

    The else clauses translate the failing value from the conditional match │ │ │ operators to the value error. If the failing value is not one of the │ │ │ recognized values, a else_clause run-time error occurs.

    │ │ │ @@ -481,75 +481,75 @@ │ │ │ {Name,Node} (or a pid located at another node), also never fails.

    │ │ │ │ │ │ │ │ │ │ │ │ Receive │ │ │

    │ │ │
    receive
    │ │ │ -    Pattern1 [when GuardSeq1] ->
    │ │ │ +    Pattern1 [when GuardSeq1] ->
    │ │ │          Body1;
    │ │ │      ...;
    │ │ │ -    PatternN [when GuardSeqN] ->
    │ │ │ +    PatternN [when GuardSeqN] ->
    │ │ │          BodyN
    │ │ │  end

    Fetches a received message present in the message queue of the process. The │ │ │ first message in the message queue is matched sequentially against the patterns │ │ │ from top to bottom. If no match was found, the matching sequence is repeated for │ │ │ the second message in the queue, and so on. Messages are queued in the │ │ │ order they were received. If a match │ │ │ succeeds, that is, if the Pattern matches and the optional guard sequence │ │ │ GuardSeq is true, then the message is removed from the message queue and the │ │ │ corresponding Body is evaluated. All other messages in the message queue │ │ │ remain unchanged.

    The return value of Body is the return value of the receive expression.

    receive never fails. The execution is suspended, possibly indefinitely, until │ │ │ a message arrives that matches one of the patterns and with a true guard │ │ │ -sequence.

    Example:

    wait_for_onhook() ->
    │ │ │ +sequence.

    Example:

    wait_for_onhook() ->
    │ │ │      receive
    │ │ │          onhook ->
    │ │ │ -            disconnect(),
    │ │ │ -            idle();
    │ │ │ -        {connect, B} ->
    │ │ │ -            B ! {busy, self()},
    │ │ │ -            wait_for_onhook()
    │ │ │ +            disconnect(),
    │ │ │ +            idle();
    │ │ │ +        {connect, B} ->
    │ │ │ +            B ! {busy, self()},
    │ │ │ +            wait_for_onhook()
    │ │ │      end.

    The receive expression can be augmented with a timeout:

    receive
    │ │ │ -    Pattern1 [when GuardSeq1] ->
    │ │ │ +    Pattern1 [when GuardSeq1] ->
    │ │ │          Body1;
    │ │ │      ...;
    │ │ │ -    PatternN [when GuardSeqN] ->
    │ │ │ +    PatternN [when GuardSeqN] ->
    │ │ │          BodyN
    │ │ │  after
    │ │ │      ExprT ->
    │ │ │          BodyT
    │ │ │  end

    receive...after works exactly as receive, except that if no matching message │ │ │ has arrived within ExprT milliseconds, then BodyT is evaluated instead. The │ │ │ return value of BodyT then becomes the return value of the receive...after │ │ │ expression. ExprT is to evaluate to an integer, or the atom infinity. The │ │ │ allowed integer range is from 0 to 4294967295, that is, the longest possible │ │ │ timeout is almost 50 days. With a zero value the timeout occurs immediately if │ │ │ there is no matching message in the message queue.

    The atom infinity will make the process wait indefinitely for a matching │ │ │ message. This is the same as not using a timeout. It can be useful for timeout │ │ │ -values that are calculated at runtime.

    Example:

    wait_for_onhook() ->
    │ │ │ +values that are calculated at runtime.

    Example:

    wait_for_onhook() ->
    │ │ │      receive
    │ │ │          onhook ->
    │ │ │ -            disconnect(),
    │ │ │ -            idle();
    │ │ │ -        {connect, B} ->
    │ │ │ -            B ! {busy, self()},
    │ │ │ -            wait_for_onhook()
    │ │ │ +            disconnect(),
    │ │ │ +            idle();
    │ │ │ +        {connect, B} ->
    │ │ │ +            B ! {busy, self()},
    │ │ │ +            wait_for_onhook()
    │ │ │      after
    │ │ │          60000 ->
    │ │ │ -            disconnect(),
    │ │ │ -            error()
    │ │ │ +            disconnect(),
    │ │ │ +            error()
    │ │ │      end.

    It is legal to use a receive...after expression with no branches:

    receive
    │ │ │  after
    │ │ │      ExprT ->
    │ │ │          BodyT
    │ │ │  end

    This construction does not consume any messages, only suspends execution in the │ │ │ -process for ExprT milliseconds. This can be used to implement simple timers.

    Example:

    timer() ->
    │ │ │ -    spawn(m, timer, [self()]).
    │ │ │ +process for ExprT milliseconds. This can be used to implement simple timers.

    Example:

    timer() ->
    │ │ │ +    spawn(m, timer, [self()]).
    │ │ │  
    │ │ │ -timer(Pid) ->
    │ │ │ +timer(Pid) ->
    │ │ │      receive
    │ │ │      after
    │ │ │          5000 ->
    │ │ │              Pid ! timeout
    │ │ │      end.

    For more information on timers in Erlang in general, see the │ │ │ Timers section of the │ │ │ Time and Time Correction in Erlang │ │ │ @@ -591,21 +591,21 @@ │ │ │ false │ │ │ 4> 0.0 =:= -0.0. │ │ │ false │ │ │ 5> 0.0 =:= +0.0. │ │ │ true │ │ │ 6> 1 > a. │ │ │ false │ │ │ -7> #{c => 3} > #{a => 1, b => 2}. │ │ │ +7> #{c => 3} > #{a => 1, b => 2}. │ │ │ false │ │ │ -8> #{a => 1, b => 2} == #{a => 1.0, b => 2.0}. │ │ │ +8> #{a => 1, b => 2} == #{a => 1.0, b => 2.0}. │ │ │ true │ │ │ -9> <<2:2>> < <<128>>. │ │ │ +9> <<2:2>> < <<128>>. │ │ │ true │ │ │ -10> <<3:2>> < <<128>>. │ │ │ +10> <<3:2>> < <<128>>. │ │ │ false

    Note

    Prior to OTP 27, the term equivalence operators considered 0.0 │ │ │ and -0.0 to be the same term.

    This was changed in OTP 27 but legacy code may have expected them to be │ │ │ considered the same. To help users catch errors that may arise from an │ │ │ upgrade, the compiler raises a warning when 0.0 is pattern-matched or used │ │ │ in a term equivalence test.

    If you need to match 0.0 specifically, the warning can be silenced by │ │ │ writing +0.0 instead, which produces the same term but makes the compiler │ │ │ interpret the match as being done on purpose.

    │ │ │ @@ -631,15 +631,15 @@ │ │ │ 0 │ │ │ 8> 2#10 bor 2#01. │ │ │ 3 │ │ │ 9> a + 10. │ │ │ ** exception error: an error occurred when evaluating an arithmetic expression │ │ │ in operator +/2 │ │ │ called as a + 10 │ │ │ -10> 1 bsl (1 bsl 64). │ │ │ +10> 1 bsl (1 bsl 64). │ │ │ ** exception error: a system limit has been reached │ │ │ in operator bsl/2 │ │ │ called as 1 bsl 18446744073709551616

    │ │ │ │ │ │ │ │ │ │ │ │ Boolean Expressions │ │ │ @@ -658,136 +658,136 @@ │ │ │ │ │ │ │ │ │ │ │ │ Short-Circuit Expressions │ │ │

    │ │ │
    Expr1 orelse Expr2
    │ │ │  Expr1 andalso Expr2

    Expr2 is evaluated only if necessary. That is, Expr2 is evaluated only if:

    • Expr1 evaluates to false in an orelse expression.

    or

    • Expr1 evaluates to true in an andalso expression.

    Returns either the value of Expr1 (that is, true or false) or the value of │ │ │ -Expr2 (if Expr2 is evaluated).

    Example 1:

    case A >= -1.0 andalso math:sqrt(A+1) > B of

    This works even if A is less than -1.0, since in that case, math:sqrt/1 is │ │ │ -never evaluated.

    Example 2:

    OnlyOne = is_atom(L) orelse
    │ │ │ -         (is_list(L) andalso length(L) == 1),

    Expr2 is not required to evaluate to a Boolean value. Because of that, │ │ │ -andalso and orelse are tail-recursive.

    Example 3 (tail-recursive function):

    all(Pred, [Hd|Tail]) ->
    │ │ │ -    Pred(Hd) andalso all(Pred, Tail);
    │ │ │ -all(_, []) ->
    │ │ │ +Expr2 (if Expr2 is evaluated).

    Example 1:

    case A >= -1.0 andalso math:sqrt(A+1) > B of

    This works even if A is less than -1.0, since in that case, math:sqrt/1 is │ │ │ +never evaluated.

    Example 2:

    OnlyOne = is_atom(L) orelse
    │ │ │ +         (is_list(L) andalso length(L) == 1),

    Expr2 is not required to evaluate to a Boolean value. Because of that, │ │ │ +andalso and orelse are tail-recursive.

    Example 3 (tail-recursive function):

    all(Pred, [Hd|Tail]) ->
    │ │ │ +    Pred(Hd) andalso all(Pred, Tail);
    │ │ │ +all(_, []) ->
    │ │ │      true.

    Change

    Before Erlang/OTP R13A, Expr2 was required to evaluate to a Boolean value, │ │ │ and as consequence, andalso and orelse were not tail-recursive.

    │ │ │ │ │ │ │ │ │ │ │ │ List Operations │ │ │

    │ │ │
    Expr1 ++ Expr2
    │ │ │  Expr1 -- Expr2

    The list concatenation operator ++ appends its second argument to its first │ │ │ and returns the resulting list.

    The list subtraction operator -- produces a list that is a copy of the first │ │ │ argument. The procedure is as follows: for each element in the second argument, │ │ │ -the first occurrence of this element (if any) is removed.

    Example:

    1> [1,2,3] ++ [4,5].
    │ │ │ -[1,2,3,4,5]
    │ │ │ -2> [1,2,3,2,1,2] -- [2,1,2].
    │ │ │ -[3,1,2]

    │ │ │ +the first occurrence of this element (if any) is removed.

    Example:

    1> [1,2,3] ++ [4,5].
    │ │ │ +[1,2,3,4,5]
    │ │ │ +2> [1,2,3,2,1,2] -- [2,1,2].
    │ │ │ +[3,1,2]

    │ │ │ │ │ │ │ │ │ │ │ │ Map Expressions │ │ │

    │ │ │

    │ │ │ │ │ │ │ │ │ │ │ │ Creating Maps │ │ │

    │ │ │

    Constructing a new map is done by letting an expression K be associated with │ │ │ -another expression V:

    #{K => V}

    New maps can include multiple associations at construction by listing every │ │ │ -association:

    #{K1 => V1, ..., Kn => Vn}

    An empty map is constructed by not associating any terms with each other:

    #{}

    All keys and values in the map are terms. Any expression is first evaluated and │ │ │ +another expression V:

    #{K => V}

    New maps can include multiple associations at construction by listing every │ │ │ +association:

    #{K1 => V1, ..., Kn => Vn}

    An empty map is constructed by not associating any terms with each other:

    #{}

    All keys and values in the map are terms. Any expression is first evaluated and │ │ │ then the resulting terms are used as key and value respectively.

    Keys and values are separated by the => arrow and associations are separated │ │ │ -by a comma (,).

    Examples:

    M0 = #{},                 % empty map
    │ │ │ -M1 = #{a => <<"hello">>}, % single association with literals
    │ │ │ -M2 = #{1 => 2, b => b},   % multiple associations with literals
    │ │ │ -M3 = #{k => {A,B}},       % single association with variables
    │ │ │ -M4 = #{{"w", 1} => f()}.  % compound key associated with an evaluated expression

    Here, A and B are any expressions and M0 through M4 are the resulting │ │ │ -map terms.

    If two matching keys are declared, the latter key takes precedence.

    Example:

    1> #{1 => a, 1 => b}.
    │ │ │ -#{1 => b }
    │ │ │ -2> #{1.0 => a, 1 => b}.
    │ │ │ -#{1 => b, 1.0 => a}

    The order in which the expressions constructing the keys (and their associated │ │ │ +by a comma (,).

    Examples:

    M0 = #{},                 % empty map
    │ │ │ +M1 = #{a => <<"hello">>}, % single association with literals
    │ │ │ +M2 = #{1 => 2, b => b},   % multiple associations with literals
    │ │ │ +M3 = #{k => {A,B}},       % single association with variables
    │ │ │ +M4 = #{{"w", 1} => f()}.  % compound key associated with an evaluated expression

    Here, A and B are any expressions and M0 through M4 are the resulting │ │ │ +map terms.

    If two matching keys are declared, the latter key takes precedence.

    Example:

    1> #{1 => a, 1 => b}.
    │ │ │ +#{1 => b }
    │ │ │ +2> #{1.0 => a, 1 => b}.
    │ │ │ +#{1 => b, 1.0 => a}

    The order in which the expressions constructing the keys (and their associated │ │ │ values) are evaluated is not defined. The syntactic order of the key-value pairs │ │ │ in the construction is of no relevance, except in the recently mentioned case of │ │ │ two matching keys.

    │ │ │ │ │ │ │ │ │ │ │ │ Updating Maps │ │ │

    │ │ │

    Updating a map has a similar syntax as constructing it.

    An expression defining the map to be updated is put in front of the expression │ │ │ -defining the keys to be updated and their respective values:

    M#{K => V}

    Here M is a term of type map and K and V are any expression.

    If key K does not match any existing key in the map, a new association is │ │ │ +defining the keys to be updated and their respective values:

    M#{K => V}

    Here M is a term of type map and K and V are any expression.

    If key K does not match any existing key in the map, a new association is │ │ │ created from key K to value V.

    If key K matches an existing key in map M, its associated value is replaced │ │ │ by the new value V. In both cases, the evaluated map expression returns a new │ │ │ -map.

    If M is not of type map, an exception of type badmap is raised.

    To only update an existing value, the following syntax is used:

    M#{K := V}

    Here M is a term of type map, V is an expression and K is an expression │ │ │ +map.

    If M is not of type map, an exception of type badmap is raised.

    To only update an existing value, the following syntax is used:

    M#{K := V}

    Here M is a term of type map, V is an expression and K is an expression │ │ │ that evaluates to an existing key in M.

    If key K does not match any existing keys in map M, an exception of type │ │ │ badkey is raised at runtime. If a matching key K is present in map M, │ │ │ its associated value is replaced by the new value V, and the evaluated map │ │ │ -expression returns a new map.

    If M is not of type map, an exception of type badmap is raised.

    Examples:

    M0 = #{},
    │ │ │ -M1 = M0#{a => 0},
    │ │ │ -M2 = M1#{a => 1, b => 2},
    │ │ │ -M3 = M2#{"function" => fun() -> f() end},
    │ │ │ -M4 = M3#{a := 2, b := 3}.  % 'a' and 'b' was added in `M1` and `M2`.

    Here M0 is any map. It follows that M1 through M4 are maps as well.

    More examples:

    1> M = #{1 => a}.
    │ │ │ -#{1 => a }
    │ │ │ -2> M#{1.0 => b}.
    │ │ │ -#{1 => a, 1.0 => b}.
    │ │ │ -3> M#{1 := b}.
    │ │ │ -#{1 => b}
    │ │ │ -4> M#{1.0 := b}.
    │ │ │ +expression returns a new map.

    If M is not of type map, an exception of type badmap is raised.

    Examples:

    M0 = #{},
    │ │ │ +M1 = M0#{a => 0},
    │ │ │ +M2 = M1#{a => 1, b => 2},
    │ │ │ +M3 = M2#{"function" => fun() -> f() end},
    │ │ │ +M4 = M3#{a := 2, b := 3}.  % 'a' and 'b' was added in `M1` and `M2`.

    Here M0 is any map. It follows that M1 through M4 are maps as well.

    More examples:

    1> M = #{1 => a}.
    │ │ │ +#{1 => a }
    │ │ │ +2> M#{1.0 => b}.
    │ │ │ +#{1 => a, 1.0 => b}.
    │ │ │ +3> M#{1 := b}.
    │ │ │ +#{1 => b}
    │ │ │ +4> M#{1.0 := b}.
    │ │ │  ** exception error: bad argument

    As in construction, the order in which the key and value expressions are │ │ │ evaluated is not defined. The syntactic order of the key-value pairs in the │ │ │ update is of no relevance, except in the case where two keys match. In that │ │ │ case, the latter value is used.

    │ │ │ │ │ │ │ │ │ │ │ │ Maps in Patterns │ │ │

    │ │ │ -

    Matching of key-value associations from maps is done as follows:

    #{K := V} = M

    Here M is any map. The key K must be a │ │ │ +

    Matching of key-value associations from maps is done as follows:

    #{K := V} = M

    Here M is any map. The key K must be a │ │ │ guard expression, with all variables already │ │ │ bound. V can be any pattern with either bound or unbound variables.

    If the variable V is unbound, it becomes bound to the value associated with │ │ │ the key K, which must exist in the map M. If the variable V is bound, it │ │ │ must match the value associated with K in M.

    Change

    Before Erlang/OTP 23, the expression defining the key K was restricted to be │ │ │ -either a single variable or a literal.

    Example:

    1> M = #{"tuple" => {1,2}}.
    │ │ │ -#{"tuple" => {1,2}}
    │ │ │ -2> #{"tuple" := {1,B}} = M.
    │ │ │ -#{"tuple" => {1,2}}
    │ │ │ +either a single variable or a literal.

    Example:

    1> M = #{"tuple" => {1,2}}.
    │ │ │ +#{"tuple" => {1,2}}
    │ │ │ +2> #{"tuple" := {1,B}} = M.
    │ │ │ +#{"tuple" => {1,2}}
    │ │ │  3> B.
    │ │ │ -2.

    This binds variable B to integer 2.

    Similarly, multiple values from the map can be matched:

    #{K1 := V1, ..., Kn := Vn} = M

    Here keys K1 through Kn are any expressions with literals or bound │ │ │ +2.

    This binds variable B to integer 2.

    Similarly, multiple values from the map can be matched:

    #{K1 := V1, ..., Kn := Vn} = M

    Here keys K1 through Kn are any expressions with literals or bound │ │ │ variables. If all key expressions evaluate successfully and all keys │ │ │ exist in map M, all variables in V1 .. Vn is matched to the │ │ │ associated values of their respective keys.

    If the matching conditions are not met the match fails.

    Note that when matching a map, only the := operator (not the =>) is allowed │ │ │ as a delimiter for the associations.

    The order in which keys are declared in matching has no relevance.

    Duplicate keys are allowed in matching and match each pattern associated to the │ │ │ -keys:

    #{K := V1, K := V2} = M

    The empty map literal (#{}) matches any map when used as a pattern:

    #{} = Expr

    This expression matches if the expression Expr is of type map, otherwise it │ │ │ -fails with an exception badmatch.

    Here the key to be retrieved is constructed from an expression:

    #{{tag,length(List)} := V} = Map

    List must be an already bound variable.

    Matching Syntax

    Matching of literals as keys are allowed in function heads:

    %% only start if not_started
    │ │ │ -handle_call(start, From, #{state := not_started} = S) ->
    │ │ │ +keys:

    #{K := V1, K := V2} = M

    The empty map literal (#{}) matches any map when used as a pattern:

    #{} = Expr

    This expression matches if the expression Expr is of type map, otherwise it │ │ │ +fails with an exception badmatch.

    Here the key to be retrieved is constructed from an expression:

    #{{tag,length(List)} := V} = Map

    List must be an already bound variable.

    Matching Syntax

    Matching of literals as keys are allowed in function heads:

    %% only start if not_started
    │ │ │ +handle_call(start, From, #{state := not_started} = S) ->
    │ │ │  ...
    │ │ │ -    {reply, ok, S#{state := start}};
    │ │ │ +    {reply, ok, S#{state := start}};
    │ │ │  
    │ │ │  %% only change if started
    │ │ │ -handle_call(change, From, #{state := start} = S) ->
    │ │ │ +handle_call(change, From, #{state := start} = S) ->
    │ │ │  ...
    │ │ │ -    {reply, ok, S#{state := changed}};

    │ │ │ + {reply, ok, S#{state := changed}};

    │ │ │ │ │ │ │ │ │ │ │ │ Maps in Guards │ │ │

    │ │ │

    Maps are allowed in guards as long as all subexpressions are valid guard │ │ │ expressions.

    The following guard BIFs handle maps:

    │ │ │ │ │ │ │ │ │ │ │ │ Bit Syntax Expressions │ │ │

    │ │ │

    The bit syntax operates on bit strings. A bit string is a sequence of bits │ │ │ -ordered from the most significant bit to the least significant bit.

    <<>>  % The empty bit string, zero length
    │ │ │ -<<E1>>
    │ │ │ -<<E1,...,En>>

    Each element Ei specifies a segment of the bit string. The segments are │ │ │ +ordered from the most significant bit to the least significant bit.

    <<>>  % The empty bit string, zero length
    │ │ │ +<<E1>>
    │ │ │ +<<E1,...,En>>

    Each element Ei specifies a segment of the bit string. The segments are │ │ │ ordered left to right from the most significant bit to the least significant bit │ │ │ of the bit string.

    Each segment specification Ei is a value, whose default type is integer, │ │ │ followed by an optional size expression and an optional type specifier list.

    Ei = Value |
    │ │ │       Value:Size |
    │ │ │       Value/TypeSpecifierList |
    │ │ │       Value:Size/TypeSpecifierList

    When used in a bit string construction, Value is an expression that is to │ │ │ evaluate to an integer, float, or bit string. If the expression is not a single │ │ │ @@ -798,34 +798,34 @@ │ │ │ guard expression that evaluates to an │ │ │ integer. All variables in the guard expression must be already bound.

    Change

    Before Erlang/OTP 23, Size was restricted to be an integer or a variable │ │ │ bound to an integer.

    The value of Size specifies the size of the segment in units (see below). The │ │ │ default value depends on the type (see below):

    • For integer it is 8.
    • For float it is 64.
    • For binary and bitstring it is the whole binary or bit string.

    In matching, the default value for a binary or bit string segment is only valid │ │ │ for the last element. All other bit string or binary elements in the matching │ │ │ must have a size specification.

    Binaries

    A bit string with a length that is a multiple of 8 bits is known as a binary, │ │ │ which is the most common and useful type of bit string.

    A binary has a canonical representation in memory. Here follows a sequence of │ │ │ -bytes where each byte's value is its sequence number:

    <<1, 2, 3, 4, 5, 6, 7, 8, 9, 10>>

    Bit strings are a later generalization of binaries, so many texts and much │ │ │ -information about binaries apply just as well for bit strings.

    Example:

    1> <<A/binary, B/binary>> = <<"abcde">>.
    │ │ │ +bytes where each byte's value is its sequence number:

    <<1, 2, 3, 4, 5, 6, 7, 8, 9, 10>>

    Bit strings are a later generalization of binaries, so many texts and much │ │ │ +information about binaries apply just as well for bit strings.

    Example:

    1> <<A/binary, B/binary>> = <<"abcde">>.
    │ │ │  * 1:3: a binary field without size is only allowed at the end of a binary pattern
    │ │ │ -2> <<A:3/binary, B/binary>> = <<"abcde">>.
    │ │ │ -<<"abcde">>
    │ │ │ +2> <<A:3/binary, B/binary>> = <<"abcde">>.
    │ │ │ +<<"abcde">>
    │ │ │  3> A.
    │ │ │ -<<"abc">>
    │ │ │ +<<"abc">>
    │ │ │  4> B.
    │ │ │ -<<"de">>

    For the utf8, utf16, and utf32 types, Size must not be given. The size │ │ │ +<<"de">>

    For the utf8, utf16, and utf32 types, Size must not be given. The size │ │ │ of the segment is implicitly determined by the type and value itself.

    TypeSpecifierList is a list of type specifiers, in any order, separated by │ │ │ hyphens (-). Default values are used for any omitted type specifiers.

    • Type= integer | float | binary | bytes | bitstring | bits | │ │ │ utf8 | utf16 | utf32 - The default is integer. bytes is a │ │ │ shorthand for binary and bits is a shorthand for bitstring. See below │ │ │ for more information about the utf types.

    • Signedness= signed | unsigned - Only matters for matching and when │ │ │ the type is integer. The default is unsigned.

    • Endianness= big | little | native - Specifies byte level (octet │ │ │ level) endianness (byte order). Native-endian means that the endianness is │ │ │ resolved at load time to be either big-endian or little-endian, depending on │ │ │ what is native for the CPU that the Erlang machine is run on. Endianness only │ │ │ matters when the Type is either integer, utf16, utf32, or float. The │ │ │ -default is big.

      <<16#1234:16/little>> = <<16#3412:16>> = <<16#34:8, 16#12:8>>
    • Unit= unit:IntegerLiteral - The allowed range is 1 through 256. │ │ │ +default is big.

      <<16#1234:16/little>> = <<16#3412:16>> = <<16#34:8, 16#12:8>>
    • Unit= unit:IntegerLiteral - The allowed range is 1 through 256. │ │ │ Defaults to 1 for integer, float, and bitstring, and to 8 for binary. │ │ │ For types bitstring, bits, and bytes, it is not allowed to specify a │ │ │ unit value different from the default value. No unit specifier must be given │ │ │ for the types utf8, utf16, and utf32.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -850,41 +850,41 @@ │ │ │ │ │ │ Binary segments │ │ │

    │ │ │

    In this section, the phrase "binary segment" refers to any one of the segment │ │ │ types binary, bitstring, bytes, and bits.

    See also the paragraphs about Binaries.

    When constructing binaries and no size is specified for a binary segment, the │ │ │ entire binary value is interpolated into the binary being constructed. However, │ │ │ the size in bits of the binary being interpolated must be evenly divisible by │ │ │ -the unit value for the segment; otherwise an exception is raised.

    For example, the following examples all succeed:

    1> <<(<<"abc">>)/bitstring>>.
    │ │ │ -<<"abc">>
    │ │ │ -2> <<(<<"abc">>)/binary-unit:1>>.
    │ │ │ -<<"abc">>
    │ │ │ -3> <<(<<"abc">>)/binary>>.
    │ │ │ -<<"abc">>

    The first two examples have a unit value of 1 for the segment, while the third │ │ │ +the unit value for the segment; otherwise an exception is raised.

    For example, the following examples all succeed:

    1> <<(<<"abc">>)/bitstring>>.
    │ │ │ +<<"abc">>
    │ │ │ +2> <<(<<"abc">>)/binary-unit:1>>.
    │ │ │ +<<"abc">>
    │ │ │ +3> <<(<<"abc">>)/binary>>.
    │ │ │ +<<"abc">>

    The first two examples have a unit value of 1 for the segment, while the third │ │ │ segment has a unit value of 8.

    Attempting to interpolate a bit string of size 1 into a binary segment with unit │ │ │ -8 (the default unit for binary) fails as shown in this example:

    1> <<(<<1:1>>)/binary>>.
    │ │ │ -** exception error: bad argument

    For the construction to succeed, the unit value of the segment must be 1:

    2> <<(<<1:1>>)/bitstring>>.
    │ │ │ -<<1:1>>
    │ │ │ -3> <<(<<1:1>>)/binary-unit:1>>.
    │ │ │ -<<1:1>>

    Similarly, when matching a binary segment with no size specified, the match │ │ │ +8 (the default unit for binary) fails as shown in this example:

    1> <<(<<1:1>>)/binary>>.
    │ │ │ +** exception error: bad argument

    For the construction to succeed, the unit value of the segment must be 1:

    2> <<(<<1:1>>)/bitstring>>.
    │ │ │ +<<1:1>>
    │ │ │ +3> <<(<<1:1>>)/binary-unit:1>>.
    │ │ │ +<<1:1>>

    Similarly, when matching a binary segment with no size specified, the match │ │ │ succeeds if and only if the size in bits of the rest of the binary is evenly │ │ │ -divisible by the unit value:

    1> <<_/binary-unit:16>> = <<"">>.
    │ │ │ -<<>>
    │ │ │ -2> <<_/binary-unit:16>> = <<"a">>.
    │ │ │ +divisible by the unit value:

    1> <<_/binary-unit:16>> = <<"">>.
    │ │ │ +<<>>
    │ │ │ +2> <<_/binary-unit:16>> = <<"a">>.
    │ │ │  ** exception error: no match of right hand side value <<"a">>
    │ │ │ -3> <<_/binary-unit:16>> = <<"ab">>.
    │ │ │ -<<"ab">>
    │ │ │ -4> <<_/binary-unit:16>> = <<"abc">>.
    │ │ │ +3> <<_/binary-unit:16>> = <<"ab">>.
    │ │ │ +<<"ab">>
    │ │ │ +4> <<_/binary-unit:16>> = <<"abc">>.
    │ │ │  ** exception error: no match of right hand side value <<"abc">>
    │ │ │ -5> <<_/binary-unit:16>> = <<"abcd">>.
    │ │ │ -<<"abcd">>

    When a size is explicitly specified for a binary segment, the segment size in │ │ │ +5> <<_/binary-unit:16>> = <<"abcd">>. │ │ │ +<<"abcd">>

    When a size is explicitly specified for a binary segment, the segment size in │ │ │ bits is the value of Size multiplied by the default or explicit unit value.

    When constructing binaries, the size of the binary being interpolated into the │ │ │ -constructed binary must be at least as large as the size of the binary segment.

    Examples:

    1> <<(<<"abc">>):2/binary>>.
    │ │ │ -<<"ab">>
    │ │ │ -2> <<(<<"a">>):2/binary>>.
    │ │ │ +constructed binary must be at least as large as the size of the binary segment.

    Examples:

    1> <<(<<"abc">>):2/binary>>.
    │ │ │ +<<"ab">>
    │ │ │ +2> <<(<<"a">>):2/binary>>.
    │ │ │  ** exception error: construction of binary failed
    │ │ │          *** segment 1 of type 'binary': the value <<"a">> is shorter than the size of the segment

    │ │ │ │ │ │ │ │ │ │ │ │ Unicode segments │ │ │

    │ │ │ @@ -900,78 +900,78 @@ │ │ │ range 0 through 16#D7FF or 16#E000 through 16#10FFFF. The match fails if the │ │ │ returned value falls outside those ranges.

    A segment of type utf8 matches 1-4 bytes in the bit string, if the bit string │ │ │ at the match position contains a valid UTF-8 sequence. (See RFC-3629 or the │ │ │ Unicode standard.)

    A segment of type utf16 can match 2 or 4 bytes in the bit string. The match │ │ │ fails if the bit string at the match position does not contain a legal UTF-16 │ │ │ encoding of a Unicode code point. (See RFC-2781 or the Unicode standard.)

    A segment of type utf32 can match 4 bytes in the bit string in the same way as │ │ │ an integer segment matches 32 bits. The match fails if the resulting integer │ │ │ -is outside the legal ranges previously mentioned.

    Examples:

    1> Bin1 = <<1,17,42>>.
    │ │ │ -<<1,17,42>>
    │ │ │ -2> Bin2 = <<"abc">>.
    │ │ │ -<<97,98,99>>
    │ │ │ +is outside the legal ranges previously mentioned.

    Examples:

    1> Bin1 = <<1,17,42>>.
    │ │ │ +<<1,17,42>>
    │ │ │ +2> Bin2 = <<"abc">>.
    │ │ │ +<<97,98,99>>
    │ │ │  
    │ │ │ -3> Bin3 = <<1,17,42:16>>.
    │ │ │ -<<1,17,0,42>>
    │ │ │ -4> <<A,B,C:16>> = <<1,17,42:16>>.
    │ │ │ -<<1,17,0,42>>
    │ │ │ +3> Bin3 = <<1,17,42:16>>.
    │ │ │ +<<1,17,0,42>>
    │ │ │ +4> <<A,B,C:16>> = <<1,17,42:16>>.
    │ │ │ +<<1,17,0,42>>
    │ │ │  5> C.
    │ │ │  42
    │ │ │ -6> <<D:16,E,F>> = <<1,17,42:16>>.
    │ │ │ -<<1,17,0,42>>
    │ │ │ +6> <<D:16,E,F>> = <<1,17,42:16>>.
    │ │ │ +<<1,17,0,42>>
    │ │ │  7> D.
    │ │ │  273
    │ │ │  8> F.
    │ │ │  42
    │ │ │ -9> <<G,H/binary>> = <<1,17,42:16>>.
    │ │ │ -<<1,17,0,42>>
    │ │ │ +9> <<G,H/binary>> = <<1,17,42:16>>.
    │ │ │ +<<1,17,0,42>>
    │ │ │  10> H.
    │ │ │ -<<17,0,42>>
    │ │ │ -11> <<G,J/bitstring>> = <<1,17,42:12>>.
    │ │ │ -<<1,17,2,10:4>>
    │ │ │ +<<17,0,42>>
    │ │ │ +11> <<G,J/bitstring>> = <<1,17,42:12>>.
    │ │ │ +<<1,17,2,10:4>>
    │ │ │  12> J.
    │ │ │ -<<17,2,10:4>>
    │ │ │ +<<17,2,10:4>>
    │ │ │  
    │ │ │ -13> <<1024/utf8>>.
    │ │ │ -<<208,128>>
    │ │ │ +13> <<1024/utf8>>.
    │ │ │ +<<208,128>>
    │ │ │  
    │ │ │ -14> <<1:1,0:7>>.
    │ │ │ -<<128>>
    │ │ │ -15> <<16#123:12/little>> = <<16#231:12>> = <<2:4, 3:4, 1:4>>.
    │ │ │ -<<35,1:4>>

    Notice that bit string patterns cannot be nested.

    Notice also that "B=<<1>>" is interpreted as "B =< <1>>" which is a syntax │ │ │ +14> <<1:1,0:7>>. │ │ │ +<<128>> │ │ │ +15> <<16#123:12/little>> = <<16#231:12>> = <<2:4, 3:4, 1:4>>. │ │ │ +<<35,1:4>>

    Notice that bit string patterns cannot be nested.

    Notice also that "B=<<1>>" is interpreted as "B =< <1>>" which is a syntax │ │ │ error. The correct way is to write a space after =: "B = <<1>>.

    More examples are provided in Programming Examples.

    │ │ │ │ │ │ │ │ │ │ │ │ Fun Expressions │ │ │

    │ │ │
    fun
    │ │ │ -    [Name](Pattern11,...,Pattern1N) [when GuardSeq1] ->
    │ │ │ +    [Name](Pattern11,...,Pattern1N) [when GuardSeq1] ->
    │ │ │                Body1;
    │ │ │      ...;
    │ │ │ -    [Name](PatternK1,...,PatternKN) [when GuardSeqK] ->
    │ │ │ +    [Name](PatternK1,...,PatternKN) [when GuardSeqK] ->
    │ │ │                BodyK
    │ │ │  end

    A fun expression begins with the keyword fun and ends with the keyword end. │ │ │ Between them is to be a function declaration, similar to a │ │ │ regular function declaration, │ │ │ except that the function name is optional and is to be a variable, if any.

    Variables in a fun head shadow the function name and both shadow variables in │ │ │ the function clause surrounding the fun expression. Variables bound in a fun │ │ │ -body are local to the fun body.

    The return value of the expression is the resulting fun.

    Examples:

    1> Fun1 = fun (X) -> X+1 end.
    │ │ │ +body are local to the fun body.

    The return value of the expression is the resulting fun.

    Examples:

    1> Fun1 = fun (X) -> X+1 end.
    │ │ │  #Fun<erl_eval.6.39074546>
    │ │ │ -2> Fun1(2).
    │ │ │ +2> Fun1(2).
    │ │ │  3
    │ │ │ -3> Fun2 = fun (X) when X>=5 -> gt; (X) -> lt end.
    │ │ │ +3> Fun2 = fun (X) when X>=5 -> gt; (X) -> lt end.
    │ │ │  #Fun<erl_eval.6.39074546>
    │ │ │ -4> Fun2(7).
    │ │ │ +4> Fun2(7).
    │ │ │  gt
    │ │ │ -5> Fun3 = fun Fact(1) -> 1; Fact(X) when X > 1 -> X * Fact(X - 1) end.
    │ │ │ +5> Fun3 = fun Fact(1) -> 1; Fact(X) when X > 1 -> X * Fact(X - 1) end.
    │ │ │  #Fun<erl_eval.6.39074546>
    │ │ │ -6> Fun3(4).
    │ │ │ +6> Fun3(4).
    │ │ │  24

    The following fun expressions are also allowed:

    fun Name/Arity
    │ │ │  fun Module:Name/Arity

    In Name/Arity, Name is an atom and Arity is an integer. Name/Arity must │ │ │ -specify an existing local function. The expression is syntactic sugar for:

    fun (Arg1,...,ArgN) -> Name(Arg1,...,ArgN) end

    In Module:Name/Arity, Module, and Name are atoms and Arity is an │ │ │ +specify an existing local function. The expression is syntactic sugar for:

    fun (Arg1,...,ArgN) -> Name(Arg1,...,ArgN) end

    In Module:Name/Arity, Module, and Name are atoms and Arity is an │ │ │ integer. Module, Name, and Arity can also be variables. A fun defined in │ │ │ this way refers to the function Name with arity Arity in the latest │ │ │ version of module Module. A fun defined in this way is not dependent on the │ │ │ code for the module in which it is defined.

    Change

    Before Erlang/OTP R15, Module, Name, and Arity were not allowed to be │ │ │ variables.

    More examples are provided in Programming Examples.

    │ │ │ │ │ │ │ │ │ @@ -981,35 +981,35 @@ │ │ │
    catch Expr

    Returns the value of Expr unless an exception is raised during the evaluation. In │ │ │ that case, the exception is caught. The return value depends on the class of the │ │ │ exception:

    Reason depends on the type of error that occurred, and Stack is the stack of │ │ │ recent function calls, see Exit Reasons.

    Examples:

    1> catch 1+2.
    │ │ │  3
    │ │ │  2> catch 1+a.
    │ │ │ -{'EXIT',{badarith,[...]}}

    The BIF throw(Any) can be used for non-local return from a │ │ │ -function. It must be evaluated within a catch, which returns the value Any.

    Example:

    3> catch throw(hello).
    │ │ │ +{'EXIT',{badarith,[...]}}

    The BIF throw(Any) can be used for non-local return from a │ │ │ +function. It must be evaluated within a catch, which returns the value Any.

    Example:

    3> catch throw(hello).
    │ │ │  hello

    If throw/1 is not evaluated within a catch, a nocatch run-time │ │ │ error occurs.

    Change

    Before Erlang/OTP 24, the catch operator had the lowest precedence, making │ │ │ -it necessary to add parentheses when combining it with the match operator:

    1> A = (catch 42).
    │ │ │ +it necessary to add parentheses when combining it with the match operator:

    1> A = (catch 42).
    │ │ │  42
    │ │ │  2> A.
    │ │ │  42

    Starting from Erlang/OTP 24, the parentheses can be omitted:

    1> A = catch 42.
    │ │ │  42
    │ │ │  2> A.
    │ │ │  42

    │ │ │ │ │ │ │ │ │ │ │ │ Try │ │ │

    │ │ │
    try Exprs
    │ │ │  catch
    │ │ │ -    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
    │ │ │ +    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
    │ │ │          ExceptionBody1;
    │ │ │ -    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
    │ │ │ +    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
    │ │ │          ExceptionBodyN
    │ │ │  end

    This is an enhancement of catch. It gives the │ │ │ possibility to:

    • Distinguish between different exception classes.
    • Choose to handle only the desired ones.
    • Passing the others on to an enclosing try or catch, or to default error │ │ │ handling.

    Notice that although the keyword catch is used in the try expression, there │ │ │ is not a catch expression within the try expression.

    It returns the value of Exprs (a sequence of expressions Expr1, ..., ExprN) │ │ │ unless an exception occurs during the evaluation. In that case the exception is │ │ │ caught and the patterns ExceptionPattern with the right exception class │ │ │ @@ -1019,47 +1019,47 @@ │ │ │ stack trace is bound to the variable when the corresponding ExceptionPattern │ │ │ matches.

    If an exception occurs during evaluation of Exprs but there is no matching │ │ │ ExceptionPattern of the right Class with a true guard sequence, the │ │ │ exception is passed on as if Exprs had not been enclosed in a try │ │ │ expression.

    If an exception occurs during evaluation of ExceptionBody, it is not caught.

    It is allowed to omit Class and Stacktrace. An omitted Class is shorthand │ │ │ for throw:

    try Exprs
    │ │ │  catch
    │ │ │ -    ExceptionPattern1 [when ExceptionGuardSeq1] ->
    │ │ │ +    ExceptionPattern1 [when ExceptionGuardSeq1] ->
    │ │ │          ExceptionBody1;
    │ │ │ -    ExceptionPatternN [when ExceptionGuardSeqN] ->
    │ │ │ +    ExceptionPatternN [when ExceptionGuardSeqN] ->
    │ │ │          ExceptionBodyN
    │ │ │  end

    The try expression can have an of section:

    try Exprs of
    │ │ │ -    Pattern1 [when GuardSeq1] ->
    │ │ │ +    Pattern1 [when GuardSeq1] ->
    │ │ │          Body1;
    │ │ │      ...;
    │ │ │ -    PatternN [when GuardSeqN] ->
    │ │ │ +    PatternN [when GuardSeqN] ->
    │ │ │          BodyN
    │ │ │  catch
    │ │ │ -    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
    │ │ │ +    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
    │ │ │          ExceptionBody1;
    │ │ │      ...;
    │ │ │ -    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
    │ │ │ +    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
    │ │ │          ExceptionBodyN
    │ │ │  end

    If the evaluation of Exprs succeeds without an exception, the patterns │ │ │ Pattern are sequentially matched against the result in the same way as for a │ │ │ case expression, except that if the matching fails, a │ │ │ try_clause run-time error occurs instead of a case_clause.

    Only exceptions occurring during the evaluation of Exprs can be caught by the │ │ │ catch section. Exceptions occurring in a Body or due to a failed match are │ │ │ not caught.

    The try expression can also be augmented with an after section, intended to │ │ │ be used for cleanup with side effects:

    try Exprs of
    │ │ │ -    Pattern1 [when GuardSeq1] ->
    │ │ │ +    Pattern1 [when GuardSeq1] ->
    │ │ │          Body1;
    │ │ │      ...;
    │ │ │ -    PatternN [when GuardSeqN] ->
    │ │ │ +    PatternN [when GuardSeqN] ->
    │ │ │          BodyN
    │ │ │  catch
    │ │ │ -    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
    │ │ │ +    Class1:ExceptionPattern1[:Stacktrace] [when ExceptionGuardSeq1] ->
    │ │ │          ExceptionBody1;
    │ │ │      ...;
    │ │ │ -    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
    │ │ │ +    ClassN:ExceptionPatternN[:Stacktrace] [when ExceptionGuardSeqN] ->
    │ │ │          ExceptionBodyN
    │ │ │  after
    │ │ │      AfterBody
    │ │ │  end

    AfterBody is evaluated after either Body or ExceptionBody, no matter which │ │ │ one. The evaluated value of AfterBody is lost; the return value of the try │ │ │ expression is the same with an after section as without.

    Even if an exception occurs during evaluation of Body or ExceptionBody, │ │ │ AfterBody is evaluated. In this case the exception is passed on after │ │ │ @@ -1082,40 +1082,40 @@ │ │ │ ExpressionBody │ │ │ after │ │ │ AfterBody │ │ │ end │ │ │ │ │ │ try Exprs after AfterBody end

    Next is an example of using after. This closes the file, even in the event of │ │ │ exceptions in file:read/2 or in binary_to_term/1. The │ │ │ -exceptions are the same as without the try...after...end expression:

    termize_file(Name) ->
    │ │ │ -    {ok,F} = file:open(Name, [read,binary]),
    │ │ │ +exceptions are the same as without the try...after...end expression:

    termize_file(Name) ->
    │ │ │ +    {ok,F} = file:open(Name, [read,binary]),
    │ │ │      try
    │ │ │ -        {ok,Bin} = file:read(F, 1024*1024),
    │ │ │ -        binary_to_term(Bin)
    │ │ │ +        {ok,Bin} = file:read(F, 1024*1024),
    │ │ │ +        binary_to_term(Bin)
    │ │ │      after
    │ │ │ -        file:close(F)
    │ │ │ +        file:close(F)
    │ │ │      end.

    Next is an example of using try to emulate catch Expr:

    try Expr
    │ │ │  catch
    │ │ │      throw:Term -> Term;
    │ │ │ -    exit:Reason -> {'EXIT',Reason};
    │ │ │ -    error:Reason:Stk -> {'EXIT',{Reason,Stk}}
    │ │ │ +    exit:Reason -> {'EXIT',Reason};
    │ │ │ +    error:Reason:Stk -> {'EXIT',{Reason,Stk}}
    │ │ │  end

    Variables bound in the various parts of these expressions have different scopes. │ │ │ Variables bound just after the try keyword are:

    • bound in the of section
    • unsafe in both the catch and after sections, as well as after the whole │ │ │ construct

    Variables bound in of section are:

    • unbound in the catch section
    • unsafe in both the after section, as well as after the whole construct

    Variables bound in the catch section are unsafe in the after section, as │ │ │ well as after the whole construct.

    Variables bound in the after section are unsafe after the whole construct.

    │ │ │ │ │ │ │ │ │ │ │ │ Parenthesized Expressions │ │ │

    │ │ │ -
    (Expr)

    Parenthesized expressions are useful to override │ │ │ +

    (Expr)

    Parenthesized expressions are useful to override │ │ │ operator precedences, for example, in arithmetic │ │ │ expressions:

    1> 1 + 2 * 3.
    │ │ │  7
    │ │ │ -2> (1 + 2) * 3.
    │ │ │ +2> (1 + 2) * 3.
    │ │ │  9

    │ │ │ │ │ │ │ │ │ │ │ │ Block Expressions │ │ │

    │ │ │
    begin
    │ │ │ @@ -1127,71 +1127,71 @@
    │ │ │    
    │ │ │      
    │ │ │    
    │ │ │    Comprehensions
    │ │ │  

    │ │ │

    Comprehensions provide a succinct notation for iterating over one or more terms │ │ │ and constructing a new term. Comprehensions come in three different flavors, │ │ │ -depending on the type of term they build.

    List comprehensions construct lists. They have the following syntax:

    [Expr || Qualifier1, . . ., QualifierN]

    Here, Expr is an arbitrary expression, and each Qualifier is either a │ │ │ +depending on the type of term they build.

    List comprehensions construct lists. They have the following syntax:

    [Expr || Qualifier1, . . ., QualifierN]

    Here, Expr is an arbitrary expression, and each Qualifier is either a │ │ │ generator or a filter.

    Bit string comprehensions construct bit strings or binaries. They have the │ │ │ -following syntax:

    << BitStringExpr || Qualifier1, . . ., QualifierN >>

    BitStringExpr is an expression that evaluates to a bit string. If │ │ │ +following syntax:

    << BitStringExpr || Qualifier1, . . ., QualifierN >>

    BitStringExpr is an expression that evaluates to a bit string. If │ │ │ BitStringExpr is a function call, it must be enclosed in parentheses. Each │ │ │ -Qualifier is either a generator or a filter.

    Map comprehensions construct maps. They have the following syntax:

    #{KeyExpr => ValueExpr || Qualifier1, . . ., QualifierN}

    Here, KeyExpr and ValueExpr are arbitrary expressions, and each Qualifier │ │ │ +Qualifier is either a generator or a filter.

    Map comprehensions construct maps. They have the following syntax:

    #{KeyExpr => ValueExpr || Qualifier1, . . ., QualifierN}

    Here, KeyExpr and ValueExpr are arbitrary expressions, and each Qualifier │ │ │ is either a generator or a filter.

    Change

    Map comprehensions and map generators were introduced in Erlang/OTP 26.

    There are three kinds of generators.

    A list generator has the following syntax:

    Pattern <- ListExpr

    where ListExpr is an expression that evaluates to a list of terms.

    A bit string generator has the following syntax:

    BitstringPattern <= BitStringExpr

    where BitStringExpr is an expression that evaluates to a bit string.

    A map generator has the following syntax:

    KeyPattern := ValuePattern <- MapExpression

    where MapExpr is an expression that evaluates to a map, or a map iterator │ │ │ obtained by calling maps:iterator/1 or maps:iterator/2.

    A filter is an expression that evaluates to true or false.

    The variables in the generator patterns shadow previously bound variables, │ │ │ including variables bound in a previous generator pattern.

    Variables bound in a generator expression are not visible outside the │ │ │ -expression:

    1> [{E,L} || E <- L=[1,2,3]].
    │ │ │ +expression:

    1> [{E,L} || E <- L=[1,2,3]].
    │ │ │  * 1:5: variable 'L' is unbound

    A list comprehension returns a list, where the list elements are the result │ │ │ of evaluating Expr for each combination of generator elements for which all │ │ │ filters are true.

    A bit string comprehension returns a bit string, which is created by │ │ │ concatenating the results of evaluating BitStringExpr for each combination of │ │ │ bit string generator elements for which all filters are true.

    A map comprehension returns a map, where the map elements are the result of │ │ │ evaluating KeyExpr and ValueExpr for each combination of generator elements │ │ │ for which all filters are true. If the key expressions are not unique, the last │ │ │ -occurrence is stored in the map.

    Examples:

    Multiplying each element in a list by two:

    1> [X*2 || X <- [1,2,3]].
    │ │ │ -[2,4,6]

    Multiplying each byte in a binary by two, returning a list:

    1> [X*2 || <<X>> <= <<1,2,3>>].
    │ │ │ -[2,4,6]

    Multiplying each byte in a binary by two:

    1> << <<(X*2)>> || <<X>> <= <<1,2,3>> >>.
    │ │ │ -<<2,4,6>>

    Multiplying each element in a list by two, returning a binary:

    1> << <<(X*2)>> || X <- [1,2,3] >>.
    │ │ │ -<<2,4,6>>

    Creating a mapping from an integer to its square:

    1> #{X => X*X || X <- [1,2,3]}.
    │ │ │ -#{1 => 1,2 => 4,3 => 9}

    Multiplying the value of each element in a map by two:

    1> #{K => 2*V || K := V <- #{a => 1,b => 2,c => 3}}.
    │ │ │ -#{a => 2,b => 4,c => 6}

    Filtering a list, keeping odd numbers:

    1> [X || X <- [1,2,3,4,5], X rem 2 =:= 1].
    │ │ │ -[1,3,5]

    Filtering a list, keeping only elements that match:

    1> [X || {_,_}=X <- [{a,b}, [a], {x,y,z}, {1,2}]].
    │ │ │ -[{a,b},{1,2}]

    Combining elements from two list generators:

    1> [{P,Q} || P <- [a,b,c], Q <- [1,2]].
    │ │ │ -[{a,1},{a,2},{b,1},{b,2},{c,1},{c,2}]

    More examples are provided in │ │ │ +occurrence is stored in the map.

    Examples:

    Multiplying each element in a list by two:

    1> [X*2 || X <- [1,2,3]].
    │ │ │ +[2,4,6]

    Multiplying each byte in a binary by two, returning a list:

    1> [X*2 || <<X>> <= <<1,2,3>>].
    │ │ │ +[2,4,6]

    Multiplying each byte in a binary by two:

    1> << <<(X*2)>> || <<X>> <= <<1,2,3>> >>.
    │ │ │ +<<2,4,6>>

    Multiplying each element in a list by two, returning a binary:

    1> << <<(X*2)>> || X <- [1,2,3] >>.
    │ │ │ +<<2,4,6>>

    Creating a mapping from an integer to its square:

    1> #{X => X*X || X <- [1,2,3]}.
    │ │ │ +#{1 => 1,2 => 4,3 => 9}

    Multiplying the value of each element in a map by two:

    1> #{K => 2*V || K := V <- #{a => 1,b => 2,c => 3}}.
    │ │ │ +#{a => 2,b => 4,c => 6}

    Filtering a list, keeping odd numbers:

    1> [X || X <- [1,2,3,4,5], X rem 2 =:= 1].
    │ │ │ +[1,3,5]

    Filtering a list, keeping only elements that match:

    1> [X || {_,_}=X <- [{a,b}, [a], {x,y,z}, {1,2}]].
    │ │ │ +[{a,b},{1,2}]

    Combining elements from two list generators:

    1> [{P,Q} || P <- [a,b,c], Q <- [1,2]].
    │ │ │ +[{a,1},{a,2},{b,1},{b,2},{c,1},{c,2}]

    More examples are provided in │ │ │ Programming Examples.

    When there are no generators, a comprehension returns either a term constructed │ │ │ from a single element (the result of evaluating Expr) if all filters are true, │ │ │ or a term constructed from no elements (that is, [] for list comprehension, │ │ │ -<<>> for a bit string comprehension, and #{} for a map comprehension).

    Example:

    1> [2 || is_integer(2)].
    │ │ │ -[2]
    │ │ │ -2> [x || is_integer(x)].
    │ │ │ -[]

    What happens when the filter expression does not evaluate to a boolean value │ │ │ +<<>> for a bit string comprehension, and #{} for a map comprehension).

    Example:

    1> [2 || is_integer(2)].
    │ │ │ +[2]
    │ │ │ +2> [x || is_integer(x)].
    │ │ │ +[]

    What happens when the filter expression does not evaluate to a boolean value │ │ │ depends on the expression:

    • If the expression is a guard expression, │ │ │ failure to evaluate or evaluating to a non-boolean value is equivalent to │ │ │ evaluating to false.
    • If the expression is not a guard expression and evaluates to a non-Boolean │ │ │ value Val, an exception {bad_filter, Val} is triggered at runtime. If the │ │ │ evaluation of the expression raises an exception, it is not caught by the │ │ │ -comprehension.

    Examples (using a guard expression as filter):

    1> List = [1,2,a,b,c,3,4].
    │ │ │ -[1,2,a,b,c,3,4]
    │ │ │ -2> [E || E <- List, E rem 2].
    │ │ │ -[]
    │ │ │ -3> [E || E <- List, E rem 2 =:= 0].
    │ │ │ -[2,4]

    Examples (using a non-guard expression as filter):

    1> List = [1,2,a,b,c,3,4].
    │ │ │ -[1,2,a,b,c,3,4]
    │ │ │ -2> FaultyIsEven = fun(E) -> E rem 2 end.
    │ │ │ +comprehension.

    Examples (using a guard expression as filter):

    1> List = [1,2,a,b,c,3,4].
    │ │ │ +[1,2,a,b,c,3,4]
    │ │ │ +2> [E || E <- List, E rem 2].
    │ │ │ +[]
    │ │ │ +3> [E || E <- List, E rem 2 =:= 0].
    │ │ │ +[2,4]

    Examples (using a non-guard expression as filter):

    1> List = [1,2,a,b,c,3,4].
    │ │ │ +[1,2,a,b,c,3,4]
    │ │ │ +2> FaultyIsEven = fun(E) -> E rem 2 end.
    │ │ │  #Fun<erl_eval.42.17316486>
    │ │ │ -3> [E || E <- List, FaultyIsEven(E)].
    │ │ │ +3> [E || E <- List, FaultyIsEven(E)].
    │ │ │  ** exception error: bad filter 1
    │ │ │ -4> IsEven = fun(E) -> E rem 2 =:= 0 end.
    │ │ │ +4> IsEven = fun(E) -> E rem 2 =:= 0 end.
    │ │ │  #Fun<erl_eval.42.17316486>
    │ │ │ -5> [E || E <- List, IsEven(E)].
    │ │ │ +5> [E || E <- List, IsEven(E)].
    │ │ │  ** exception error: an error occurred when evaluating an arithmetic expression
    │ │ │       in operator  rem/2
    │ │ │          called as a rem 2
    │ │ │ -6> [E || E <- List, is_integer(E), IsEven(E)].
    │ │ │ -[2,4]

    │ │ │ +6> [E || E <- List, is_integer(E), IsEven(E)]. │ │ │ +[2,4]

    │ │ │ │ │ │ │ │ │ │ │ │ Guard Sequences │ │ │

    │ │ │

    A guard sequence is a sequence of guards, separated by semicolon (;). The │ │ │ guard sequence is true if at least one of the guards is true. (The remaining │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/funs.html │ │ │ @@ -117,402 +117,402 @@ │ │ │ │ │ │

    │ │ │ │ │ │ │ │ │ │ │ │ map │ │ │

    │ │ │ -

    The following function, double, doubles every element in a list:

    double([H|T]) -> [2*H|double(T)];
    │ │ │ -double([])    -> [].

    Hence, the argument entered as input is doubled as follows:

    > double([1,2,3,4]).
    │ │ │ -[2,4,6,8]

    The following function, add_one, adds one to every element in a list:

    add_one([H|T]) -> [H+1|add_one(T)];
    │ │ │ -add_one([])    -> [].

    The functions double and add_one have a similar structure. This can be used │ │ │ -by writing a function map that expresses this similarity:

    map(F, [H|T]) -> [F(H)|map(F, T)];
    │ │ │ -map(F, [])    -> [].

    The functions double and add_one can now be expressed in terms of map as │ │ │ -follows:

    double(L)  -> map(fun(X) -> 2*X end, L).
    │ │ │ -add_one(L) -> map(fun(X) -> 1 + X end, L).

    map(F, List) is a function that takes a function F and a list L as │ │ │ +

    The following function, double, doubles every element in a list:

    double([H|T]) -> [2*H|double(T)];
    │ │ │ +double([])    -> [].

    Hence, the argument entered as input is doubled as follows:

    > double([1,2,3,4]).
    │ │ │ +[2,4,6,8]

    The following function, add_one, adds one to every element in a list:

    add_one([H|T]) -> [H+1|add_one(T)];
    │ │ │ +add_one([])    -> [].

    The functions double and add_one have a similar structure. This can be used │ │ │ +by writing a function map that expresses this similarity:

    map(F, [H|T]) -> [F(H)|map(F, T)];
    │ │ │ +map(F, [])    -> [].

    The functions double and add_one can now be expressed in terms of map as │ │ │ +follows:

    double(L)  -> map(fun(X) -> 2*X end, L).
    │ │ │ +add_one(L) -> map(fun(X) -> 1 + X end, L).

    map(F, List) is a function that takes a function F and a list L as │ │ │ arguments and returns a new list, obtained by applying F to each of the │ │ │ elements in L.

    The process of abstracting out the common features of a number of different │ │ │ programs is called procedural abstraction. Procedural abstraction can be used │ │ │ to write several different functions that have a similar structure, but differ │ │ │ in some minor detail. This is done as follows:

    1. Step 1. Write one function that represents the common features of these │ │ │ functions.
    2. Step 2. Parameterize the difference in terms of functions that are passed │ │ │ as arguments to the common function.

    │ │ │ │ │ │ │ │ │ │ │ │ foreach │ │ │

    │ │ │

    This section illustrates procedural abstraction. Initially, the following two │ │ │ -examples are written as conventional functions.

    This function prints all elements of a list onto a stream:

    print_list(Stream, [H|T]) ->
    │ │ │ -    io:format(Stream, "~p~n", [H]),
    │ │ │ -    print_list(Stream, T);
    │ │ │ -print_list(Stream, []) ->
    │ │ │ -    true.

    This function broadcasts a message to a list of processes:

    broadcast(Msg, [Pid|Pids]) ->
    │ │ │ +examples are written as conventional functions.

    This function prints all elements of a list onto a stream:

    print_list(Stream, [H|T]) ->
    │ │ │ +    io:format(Stream, "~p~n", [H]),
    │ │ │ +    print_list(Stream, T);
    │ │ │ +print_list(Stream, []) ->
    │ │ │ +    true.

    This function broadcasts a message to a list of processes:

    broadcast(Msg, [Pid|Pids]) ->
    │ │ │      Pid ! Msg,
    │ │ │ -    broadcast(Msg, Pids);
    │ │ │ -broadcast(_, []) ->
    │ │ │ +    broadcast(Msg, Pids);
    │ │ │ +broadcast(_, []) ->
    │ │ │      true.

    These two functions have a similar structure. They both iterate over a list and │ │ │ do something to each element in the list. The "something" is passed on as an │ │ │ -extra argument to the function that does this.

    The function foreach expresses this similarity:

    foreach(F, [H|T]) ->
    │ │ │ -    F(H),
    │ │ │ -    foreach(F, T);
    │ │ │ -foreach(F, []) ->
    │ │ │ -    ok.

    Using the function foreach, the function print_list becomes:

    foreach(fun(H) -> io:format(S, "~p~n",[H]) end, L)

    Using the function foreach, the function broadcast becomes:

    foreach(fun(Pid) -> Pid ! M end, L)

    foreach is evaluated for its side-effect and not its value. foreach(Fun ,L) │ │ │ +extra argument to the function that does this.

    The function foreach expresses this similarity:

    foreach(F, [H|T]) ->
    │ │ │ +    F(H),
    │ │ │ +    foreach(F, T);
    │ │ │ +foreach(F, []) ->
    │ │ │ +    ok.

    Using the function foreach, the function print_list becomes:

    foreach(fun(H) -> io:format(S, "~p~n",[H]) end, L)

    Using the function foreach, the function broadcast becomes:

    foreach(fun(Pid) -> Pid ! M end, L)

    foreach is evaluated for its side-effect and not its value. foreach(Fun ,L) │ │ │ calls Fun(X) for each element X in L and the processing occurs in the │ │ │ order that the elements were defined in L. map does not define the order in │ │ │ which its elements are processed.

    │ │ │ │ │ │ │ │ │ │ │ │ Syntax of Funs │ │ │

    │ │ │

    Funs are written with the following syntax (see │ │ │ -Fun Expressions for full description):

    F = fun (Arg1, Arg2, ... ArgN) ->
    │ │ │ +Fun Expressions for full description):

    F = fun (Arg1, Arg2, ... ArgN) ->
    │ │ │          ...
    │ │ │      end

    This creates an anonymous function of N arguments and binds it to the variable │ │ │ F.

    Another function, FunctionName, written in the same module, can be passed as │ │ │ an argument, using the following syntax:

    F = fun FunctionName/Arity

    With this form of function reference, the function that is referred to does not │ │ │ need to be exported from the module.

    It is also possible to refer to a function defined in a different module, with │ │ │ -the following syntax:

    F = fun Module:FunctionName/Arity

    In this case, the function must be exported from the module in question.

    The following program illustrates the different ways of creating funs:

    -module(fun_test).
    │ │ │ --export([t1/0, t2/0]).
    │ │ │ --import(lists, [map/2]).
    │ │ │ +the following syntax:

    F = fun Module:FunctionName/Arity

    In this case, the function must be exported from the module in question.

    The following program illustrates the different ways of creating funs:

    -module(fun_test).
    │ │ │ +-export([t1/0, t2/0]).
    │ │ │ +-import(lists, [map/2]).
    │ │ │  
    │ │ │ -t1() -> map(fun(X) -> 2 * X end, [1,2,3,4,5]).
    │ │ │ +t1() -> map(fun(X) -> 2 * X end, [1,2,3,4,5]).
    │ │ │  
    │ │ │ -t2() -> map(fun double/1, [1,2,3,4,5]).
    │ │ │ +t2() -> map(fun double/1, [1,2,3,4,5]).
    │ │ │  
    │ │ │ -double(X) -> X * 2.

    The fun F can be evaluated with the following syntax:

    F(Arg1, Arg2, ..., Argn)

    To check whether a term is a fun, use the test │ │ │ -is_function/1 in a guard.

    Example:

    f(F, Args) when is_function(F) ->
    │ │ │ -   apply(F, Args);
    │ │ │ -f(N, _) when is_integer(N) ->
    │ │ │ +double(X) -> X * 2.

    The fun F can be evaluated with the following syntax:

    F(Arg1, Arg2, ..., Argn)

    To check whether a term is a fun, use the test │ │ │ +is_function/1 in a guard.

    Example:

    f(F, Args) when is_function(F) ->
    │ │ │ +   apply(F, Args);
    │ │ │ +f(N, _) when is_integer(N) ->
    │ │ │     N.

    Funs are a distinct type. The BIFs erlang:fun_info/1,2 can be used to retrieve │ │ │ information about a fun, and the BIF erlang:fun_to_list/1 returns a textual │ │ │ representation of a fun. The check_process_code/2 │ │ │ BIF returns true if the process contains funs that depend on the old version │ │ │ of a module.

    │ │ │ │ │ │ │ │ │ │ │ │ Variable Bindings Within a Fun │ │ │

    │ │ │

    The scope rules for variables that occur in funs are as follows:

    • All variables that occur in the head of a fun are assumed to be "fresh" │ │ │ variables.
    • Variables that are defined before the fun, and that occur in function calls or │ │ │ -guard tests within the fun, have the values they had outside the fun.
    • Variables cannot be exported from a fun.

    The following examples illustrate these rules:

    print_list(File, List) ->
    │ │ │ -    {ok, Stream} = file:open(File, write),
    │ │ │ -    foreach(fun(X) -> io:format(Stream,"~p~n",[X]) end, List),
    │ │ │ -    file:close(Stream).

    Here, the variable X, defined in the head of the fun, is a new variable. The │ │ │ +guard tests within the fun, have the values they had outside the fun.

  • Variables cannot be exported from a fun.
  • The following examples illustrate these rules:

    print_list(File, List) ->
    │ │ │ +    {ok, Stream} = file:open(File, write),
    │ │ │ +    foreach(fun(X) -> io:format(Stream,"~p~n",[X]) end, List),
    │ │ │ +    file:close(Stream).

    Here, the variable X, defined in the head of the fun, is a new variable. The │ │ │ variable Stream, which is used within the fun, gets its value from the │ │ │ file:open line.

    As any variable that occurs in the head of a fun is considered a new variable, │ │ │ -it is equally valid to write as follows:

    print_list(File, List) ->
    │ │ │ -    {ok, Stream} = file:open(File, write),
    │ │ │ -    foreach(fun(File) ->
    │ │ │ -                io:format(Stream,"~p~n",[File])
    │ │ │ -            end, List),
    │ │ │ -    file:close(Stream).

    Here, File is used as the new variable instead of X. This is not so wise │ │ │ +it is equally valid to write as follows:

    print_list(File, List) ->
    │ │ │ +    {ok, Stream} = file:open(File, write),
    │ │ │ +    foreach(fun(File) ->
    │ │ │ +                io:format(Stream,"~p~n",[File])
    │ │ │ +            end, List),
    │ │ │ +    file:close(Stream).

    Here, File is used as the new variable instead of X. This is not so wise │ │ │ because code in the fun body cannot refer to the variable File, which is │ │ │ defined outside of the fun. Compiling this example gives the following │ │ │ diagnostic:

    ./FileName.erl:Line: Warning: variable 'File'
    │ │ │        shadowed in 'fun'

    This indicates that the variable File, which is defined inside the fun, │ │ │ collides with the variable File, which is defined outside the fun.

    The rules for importing variables into a fun has the consequence that certain │ │ │ pattern matching operations must be moved into guard expressions and cannot be │ │ │ written in the head of the fun. For example, you might write the following code │ │ │ if you intend the first clause of F to be evaluated when the value of its │ │ │ -argument is Y:

    f(...) ->
    │ │ │ +argument is Y:

    f(...) ->
    │ │ │      Y = ...
    │ │ │ -    map(fun(X) when X == Y ->
    │ │ │ +    map(fun(X) when X == Y ->
    │ │ │               ;
    │ │ │ -           (_) ->
    │ │ │ +           (_) ->
    │ │ │               ...
    │ │ │ -        end, ...)
    │ │ │ -    ...

    instead of writing the following code:

    f(...) ->
    │ │ │ +        end, ...)
    │ │ │ +    ...

    instead of writing the following code:

    f(...) ->
    │ │ │      Y = ...
    │ │ │ -    map(fun(Y) ->
    │ │ │ +    map(fun(Y) ->
    │ │ │               ;
    │ │ │ -           (_) ->
    │ │ │ +           (_) ->
    │ │ │               ...
    │ │ │ -        end, ...)
    │ │ │ +        end, ...)
    │ │ │      ...

    │ │ │ │ │ │ │ │ │ │ │ │ Funs and Module Lists │ │ │

    │ │ │

    The following examples show a dialogue with the Erlang shell. All the higher │ │ │ order functions discussed are exported from the module lists.

    │ │ │ │ │ │ │ │ │ │ │ │ map │ │ │

    │ │ │ -

    lists:map/2 takes a function of one argument and a list of terms:

    map(F, [H|T]) -> [F(H)|map(F, T)];
    │ │ │ -map(F, [])    -> [].

    It returns the list obtained by applying the function to every argument in the │ │ │ +

    lists:map/2 takes a function of one argument and a list of terms:

    map(F, [H|T]) -> [F(H)|map(F, T)];
    │ │ │ +map(F, [])    -> [].

    It returns the list obtained by applying the function to every argument in the │ │ │ list.

    When a new fun is defined in the shell, the value of the fun is printed as │ │ │ -Fun#<erl_eval>:

    > Double = fun(X) -> 2 * X end.
    │ │ │ +Fun#<erl_eval>:

    > Double = fun(X) -> 2 * X end.
    │ │ │  #Fun<erl_eval.6.72228031>
    │ │ │ -> lists:map(Double, [1,2,3,4,5]).
    │ │ │ -[2,4,6,8,10]

    │ │ │ +> lists:map(Double, [1,2,3,4,5]). │ │ │ +[2,4,6,8,10]

    │ │ │ │ │ │ │ │ │ │ │ │ any │ │ │

    │ │ │ -

    lists:any/2 takes a predicate P of one argument and a list of terms:

    any(Pred, [H|T]) ->
    │ │ │ -    case Pred(H) of
    │ │ │ +

    lists:any/2 takes a predicate P of one argument and a list of terms:

    any(Pred, [H|T]) ->
    │ │ │ +    case Pred(H) of
    │ │ │          true  ->  true;
    │ │ │ -        false ->  any(Pred, T)
    │ │ │ +        false ->  any(Pred, T)
    │ │ │      end;
    │ │ │ -any(Pred, []) ->
    │ │ │ +any(Pred, []) ->
    │ │ │      false.

    A predicate is a function that returns true or false. any is true if │ │ │ there is a term X in the list such that P(X) is true.

    A predicate Big(X) is defined, which is true if its argument is greater that │ │ │ -10:

    > Big =  fun(X) -> if X > 10 -> true; true -> false end end.
    │ │ │ +10:

    > Big =  fun(X) -> if X > 10 -> true; true -> false end end.
    │ │ │  #Fun<erl_eval.6.72228031>
    │ │ │ -> lists:any(Big, [1,2,3,4]).
    │ │ │ +> lists:any(Big, [1,2,3,4]).
    │ │ │  false
    │ │ │ -> lists:any(Big, [1,2,3,12,5]).
    │ │ │ +> lists:any(Big, [1,2,3,12,5]).
    │ │ │  true

    │ │ │ │ │ │ │ │ │ │ │ │ all │ │ │

    │ │ │ -

    lists:all/2 has the same arguments as any:

    all(Pred, [H|T]) ->
    │ │ │ -    case Pred(H) of
    │ │ │ -        true  ->  all(Pred, T);
    │ │ │ +

    lists:all/2 has the same arguments as any:

    all(Pred, [H|T]) ->
    │ │ │ +    case Pred(H) of
    │ │ │ +        true  ->  all(Pred, T);
    │ │ │          false ->  false
    │ │ │      end;
    │ │ │ -all(Pred, []) ->
    │ │ │ -    true.

    It is true if the predicate applied to all elements in the list is true.

    > lists:all(Big, [1,2,3,4,12,6]).
    │ │ │ +all(Pred, []) ->
    │ │ │ +    true.

    It is true if the predicate applied to all elements in the list is true.

    > lists:all(Big, [1,2,3,4,12,6]).
    │ │ │  false
    │ │ │ -> lists:all(Big, [12,13,14,15]).
    │ │ │ +> lists:all(Big, [12,13,14,15]).
    │ │ │  true

    │ │ │ │ │ │ │ │ │ │ │ │ foreach │ │ │

    │ │ │ -

    lists:foreach/2 takes a function of one argument and a list of terms:

    foreach(F, [H|T]) ->
    │ │ │ -    F(H),
    │ │ │ -    foreach(F, T);
    │ │ │ -foreach(F, []) ->
    │ │ │ +

    lists:foreach/2 takes a function of one argument and a list of terms:

    foreach(F, [H|T]) ->
    │ │ │ +    F(H),
    │ │ │ +    foreach(F, T);
    │ │ │ +foreach(F, []) ->
    │ │ │      ok.

    The function is applied to each argument in the list. foreach returns ok. It │ │ │ -is only used for its side-effect:

    > lists:foreach(fun(X) -> io:format("~w~n",[X]) end, [1,2,3,4]).
    │ │ │ +is only used for its side-effect:

    > lists:foreach(fun(X) -> io:format("~w~n",[X]) end, [1,2,3,4]).
    │ │ │  1
    │ │ │  2
    │ │ │  3
    │ │ │  4
    │ │ │  ok

    │ │ │ │ │ │ │ │ │ │ │ │ foldl │ │ │

    │ │ │ -

    lists:foldl/3 takes a function of two arguments, an accumulator and a list:

    foldl(F, Accu, [Hd|Tail]) ->
    │ │ │ -    foldl(F, F(Hd, Accu), Tail);
    │ │ │ -foldl(F, Accu, []) -> Accu.

    The function is called with two arguments. The first argument is the successive │ │ │ +

    lists:foldl/3 takes a function of two arguments, an accumulator and a list:

    foldl(F, Accu, [Hd|Tail]) ->
    │ │ │ +    foldl(F, F(Hd, Accu), Tail);
    │ │ │ +foldl(F, Accu, []) -> Accu.

    The function is called with two arguments. The first argument is the successive │ │ │ elements in the list. The second argument is the accumulator. The function must │ │ │ return a new accumulator, which is used the next time the function is called.

    If you have a list of lists L = ["I","like","Erlang"], then you can sum the │ │ │ -lengths of all the strings in L as follows:

    > L = ["I","like","Erlang"].
    │ │ │ -["I","like","Erlang"]
    │ │ │ -10> lists:foldl(fun(X, Sum) -> length(X) + Sum end, 0, L).
    │ │ │ -11

    lists:foldl/3 works like a while loop in an imperative language:

    L =  ["I","like","Erlang"],
    │ │ │ +lengths of all the strings in L as follows:

    > L = ["I","like","Erlang"].
    │ │ │ +["I","like","Erlang"]
    │ │ │ +10> lists:foldl(fun(X, Sum) -> length(X) + Sum end, 0, L).
    │ │ │ +11

    lists:foldl/3 works like a while loop in an imperative language:

    L =  ["I","like","Erlang"],
    │ │ │  Sum = 0,
    │ │ │ -while( L != []){
    │ │ │ -    Sum += length(head(L)),
    │ │ │ -    L = tail(L)
    │ │ │ +while( L != []){
    │ │ │ +    Sum += length(head(L)),
    │ │ │ +    L = tail(L)
    │ │ │  end

    │ │ │ │ │ │ │ │ │ │ │ │ mapfoldl │ │ │

    │ │ │ -

    lists:mapfoldl/3 simultaneously maps and folds over a list:

    mapfoldl(F, Accu0, [Hd|Tail]) ->
    │ │ │ -    {R,Accu1} = F(Hd, Accu0),
    │ │ │ -    {Rs,Accu2} = mapfoldl(F, Accu1, Tail),
    │ │ │ -    {[R|Rs], Accu2};
    │ │ │ -mapfoldl(F, Accu, []) -> {[], Accu}.

    The following example shows how to change all letters in L to upper case and │ │ │ -then count them.

    First the change to upper case:

    > Upcase =  fun(X) when $a =< X,  X =< $z -> X + $A - $a;
    │ │ │ -(X) -> X
    │ │ │ +

    lists:mapfoldl/3 simultaneously maps and folds over a list:

    mapfoldl(F, Accu0, [Hd|Tail]) ->
    │ │ │ +    {R,Accu1} = F(Hd, Accu0),
    │ │ │ +    {Rs,Accu2} = mapfoldl(F, Accu1, Tail),
    │ │ │ +    {[R|Rs], Accu2};
    │ │ │ +mapfoldl(F, Accu, []) -> {[], Accu}.

    The following example shows how to change all letters in L to upper case and │ │ │ +then count them.

    First the change to upper case:

    > Upcase =  fun(X) when $a =< X,  X =< $z -> X + $A - $a;
    │ │ │ +(X) -> X
    │ │ │  end.
    │ │ │  #Fun<erl_eval.6.72228031>
    │ │ │  > Upcase_word =
    │ │ │ -fun(X) ->
    │ │ │ -lists:map(Upcase, X)
    │ │ │ +fun(X) ->
    │ │ │ +lists:map(Upcase, X)
    │ │ │  end.
    │ │ │  #Fun<erl_eval.6.72228031>
    │ │ │ -> Upcase_word("Erlang").
    │ │ │ +> Upcase_word("Erlang").
    │ │ │  "ERLANG"
    │ │ │ -> lists:map(Upcase_word, L).
    │ │ │ -["I","LIKE","ERLANG"]

    Now, the fold and the map can be done at the same time:

    > lists:mapfoldl(fun(Word, Sum) ->
    │ │ │ -{Upcase_word(Word), Sum + length(Word)}
    │ │ │ -end, 0, L).
    │ │ │ -{["I","LIKE","ERLANG"],11}

    │ │ │ +> lists:map(Upcase_word, L). │ │ │ +["I","LIKE","ERLANG"]

    Now, the fold and the map can be done at the same time:

    > lists:mapfoldl(fun(Word, Sum) ->
    │ │ │ +{Upcase_word(Word), Sum + length(Word)}
    │ │ │ +end, 0, L).
    │ │ │ +{["I","LIKE","ERLANG"],11}

    │ │ │ │ │ │ │ │ │ │ │ │ filter │ │ │

    │ │ │

    lists:filter/2 takes a predicate of one argument and a list and returns all elements │ │ │ -in the list that satisfy the predicate:

    filter(F, [H|T]) ->
    │ │ │ -    case F(H) of
    │ │ │ -        true  -> [H|filter(F, T)];
    │ │ │ -        false -> filter(F, T)
    │ │ │ +in the list that satisfy the predicate:

    filter(F, [H|T]) ->
    │ │ │ +    case F(H) of
    │ │ │ +        true  -> [H|filter(F, T)];
    │ │ │ +        false -> filter(F, T)
    │ │ │      end;
    │ │ │ -filter(F, []) -> [].
    > lists:filter(Big, [500,12,2,45,6,7]).
    │ │ │ -[500,12,45]

    Combining maps and filters enables writing of very succinct code. For example, │ │ │ +filter(F, []) -> [].

    > lists:filter(Big, [500,12,2,45,6,7]).
    │ │ │ +[500,12,45]

    Combining maps and filters enables writing of very succinct code. For example, │ │ │ to define a set difference function diff(L1, L2) to be the difference between │ │ │ -the lists L1 and L2, the code can be written as follows:

    diff(L1, L2) ->
    │ │ │ -    filter(fun(X) -> not member(X, L2) end, L1).

    This gives the list of all elements in L1 that are not contained in L2.

    The AND intersection of the list L1 and L2 is also easily defined:

    intersection(L1,L2) -> filter(fun(X) -> member(X,L1) end, L2).

    │ │ │ +the lists L1 and L2, the code can be written as follows:

    diff(L1, L2) ->
    │ │ │ +    filter(fun(X) -> not member(X, L2) end, L1).

    This gives the list of all elements in L1 that are not contained in L2.

    The AND intersection of the list L1 and L2 is also easily defined:

    intersection(L1,L2) -> filter(fun(X) -> member(X,L1) end, L2).

    │ │ │ │ │ │ │ │ │ │ │ │ takewhile │ │ │

    │ │ │

    lists:takewhile/2 takes elements X from a list L as long as the predicate │ │ │ -P(X) is true:

    takewhile(Pred, [H|T]) ->
    │ │ │ -    case Pred(H) of
    │ │ │ -        true  -> [H|takewhile(Pred, T)];
    │ │ │ -        false -> []
    │ │ │ +P(X) is true:

    takewhile(Pred, [H|T]) ->
    │ │ │ +    case Pred(H) of
    │ │ │ +        true  -> [H|takewhile(Pred, T)];
    │ │ │ +        false -> []
    │ │ │      end;
    │ │ │ -takewhile(Pred, []) ->
    │ │ │ -    [].
    > lists:takewhile(Big, [200,500,45,5,3,45,6]).
    │ │ │ -[200,500,45]

    │ │ │ +takewhile(Pred, []) -> │ │ │ + [].

    > lists:takewhile(Big, [200,500,45,5,3,45,6]).
    │ │ │ +[200,500,45]

    │ │ │ │ │ │ │ │ │ │ │ │ dropwhile │ │ │

    │ │ │ -

    lists:dropwhile/2 is the complement of takewhile:

    dropwhile(Pred, [H|T]) ->
    │ │ │ -    case Pred(H) of
    │ │ │ -        true  -> dropwhile(Pred, T);
    │ │ │ -        false -> [H|T]
    │ │ │ +

    lists:dropwhile/2 is the complement of takewhile:

    dropwhile(Pred, [H|T]) ->
    │ │ │ +    case Pred(H) of
    │ │ │ +        true  -> dropwhile(Pred, T);
    │ │ │ +        false -> [H|T]
    │ │ │      end;
    │ │ │ -dropwhile(Pred, []) ->
    │ │ │ -    [].
    > lists:dropwhile(Big, [200,500,45,5,3,45,6]).
    │ │ │ -[5,3,45,6]

    │ │ │ +dropwhile(Pred, []) -> │ │ │ + [].

    > lists:dropwhile(Big, [200,500,45,5,3,45,6]).
    │ │ │ +[5,3,45,6]

    │ │ │ │ │ │ │ │ │ │ │ │ splitwith │ │ │

    │ │ │

    lists:splitwith/2 splits the list L into the two sublists {L1, L2}, where │ │ │ -L = takewhile(P, L) and L2 = dropwhile(P, L):

    splitwith(Pred, L) ->
    │ │ │ -    splitwith(Pred, L, []).
    │ │ │ +L = takewhile(P, L) and L2 = dropwhile(P, L):

    splitwith(Pred, L) ->
    │ │ │ +    splitwith(Pred, L, []).
    │ │ │  
    │ │ │ -splitwith(Pred, [H|T], L) ->
    │ │ │ -    case Pred(H) of
    │ │ │ -        true  -> splitwith(Pred, T, [H|L]);
    │ │ │ -        false -> {reverse(L), [H|T]}
    │ │ │ +splitwith(Pred, [H|T], L) ->
    │ │ │ +    case Pred(H) of
    │ │ │ +        true  -> splitwith(Pred, T, [H|L]);
    │ │ │ +        false -> {reverse(L), [H|T]}
    │ │ │      end;
    │ │ │ -splitwith(Pred, [], L) ->
    │ │ │ -    {reverse(L), []}.
    > lists:splitwith(Big, [200,500,45,5,3,45,6]).
    │ │ │ -{[200,500,45],[5,3,45,6]}

    │ │ │ +splitwith(Pred, [], L) -> │ │ │ + {reverse(L), []}.

    > lists:splitwith(Big, [200,500,45,5,3,45,6]).
    │ │ │ +{[200,500,45],[5,3,45,6]}

    │ │ │ │ │ │ │ │ │ │ │ │ Funs Returning Funs │ │ │

    │ │ │

    So far, only functions that take funs as arguments have been described. More │ │ │ powerful functions, that themselves return funs, can also be written. The │ │ │ following examples illustrate these type of functions.

    │ │ │ │ │ │ │ │ │ │ │ │ Simple Higher Order Functions │ │ │

    │ │ │

    Adder(X) is a function that given X, returns a new function G such that │ │ │ -G(K) returns K + X:

    > Adder = fun(X) -> fun(Y) -> X + Y end end.
    │ │ │ +G(K) returns K + X:

    > Adder = fun(X) -> fun(Y) -> X + Y end end.
    │ │ │  #Fun<erl_eval.6.72228031>
    │ │ │ -> Add6 = Adder(6).
    │ │ │ +> Add6 = Adder(6).
    │ │ │  #Fun<erl_eval.6.72228031>
    │ │ │ -> Add6(10).
    │ │ │ +> Add6(10).
    │ │ │  16

    │ │ │ │ │ │ │ │ │ │ │ │ Infinite Lists │ │ │

    │ │ │ -

    The idea is to write something like:

    -module(lazy).
    │ │ │ --export([ints_from/1]).
    │ │ │ -ints_from(N) ->
    │ │ │ -    fun() ->
    │ │ │ -            [N|ints_from(N+1)]
    │ │ │ -    end.

    Then proceed as follows:

    > XX = lazy:ints_from(1).
    │ │ │ +

    The idea is to write something like:

    -module(lazy).
    │ │ │ +-export([ints_from/1]).
    │ │ │ +ints_from(N) ->
    │ │ │ +    fun() ->
    │ │ │ +            [N|ints_from(N+1)]
    │ │ │ +    end.

    Then proceed as follows:

    > XX = lazy:ints_from(1).
    │ │ │  #Fun<lazy.0.29874839>
    │ │ │ -> XX().
    │ │ │ -[1|#Fun<lazy.0.29874839>]
    │ │ │ -> hd(XX()).
    │ │ │ +> XX().
    │ │ │ +[1|#Fun<lazy.0.29874839>]
    │ │ │ +> hd(XX()).
    │ │ │  1
    │ │ │ -> Y = tl(XX()).
    │ │ │ +> Y = tl(XX()).
    │ │ │  #Fun<lazy.0.29874839>
    │ │ │ -> hd(Y()).
    │ │ │ +> hd(Y()).
    │ │ │  2

    And so on. This is an example of "lazy embedding".

    │ │ │ │ │ │ │ │ │ │ │ │ Parsing │ │ │

    │ │ │ -

    The following examples show parsers of the following type:

    Parser(Toks) -> {ok, Tree, Toks1} | fail

    Toks is the list of tokens to be parsed. A successful parse returns │ │ │ +

    The following examples show parsers of the following type:

    Parser(Toks) -> {ok, Tree, Toks1} | fail

    Toks is the list of tokens to be parsed. A successful parse returns │ │ │ {ok, Tree, Toks1}.

    • Tree is a parse tree.
    • Toks1 is a tail of Tree that contains symbols encountered after the │ │ │ structure that was correctly parsed.

    An unsuccessful parse returns fail.

    The following example illustrates a simple, functional parser that parses the │ │ │ grammar:

    (a | b) & (c | d)

    The following code defines a function pconst(X) in the module funparse, │ │ │ -which returns a fun that parses a list of tokens:

    pconst(X) ->
    │ │ │ -    fun (T) ->
    │ │ │ +which returns a fun that parses a list of tokens:

    pconst(X) ->
    │ │ │ +    fun (T) ->
    │ │ │         case T of
    │ │ │ -           [X|T1] -> {ok, {const, X}, T1};
    │ │ │ +           [X|T1] -> {ok, {const, X}, T1};
    │ │ │             _      -> fail
    │ │ │         end
    │ │ │ -    end.

    This function can be used as follows:

    > P1 = funparse:pconst(a).
    │ │ │ +    end.

    This function can be used as follows:

    > P1 = funparse:pconst(a).
    │ │ │  #Fun<funparse.0.22674075>
    │ │ │ -> P1([a,b,c]).
    │ │ │ -{ok,{const,a},[b,c]}
    │ │ │ -> P1([x,y,z]).
    │ │ │ +> P1([a,b,c]).
    │ │ │ +{ok,{const,a},[b,c]}
    │ │ │ +> P1([x,y,z]).
    │ │ │  fail

    Next, the two higher order functions pand and por are defined. They combine │ │ │ -primitive parsers to produce more complex parsers.

    First pand:

    pand(P1, P2) ->
    │ │ │ -    fun (T) ->
    │ │ │ -        case P1(T) of
    │ │ │ -            {ok, R1, T1} ->
    │ │ │ -                case P2(T1) of
    │ │ │ -                    {ok, R2, T2} ->
    │ │ │ -                        {ok, {'and', R1, R2}};
    │ │ │ +primitive parsers to produce more complex parsers.

    First pand:

    pand(P1, P2) ->
    │ │ │ +    fun (T) ->
    │ │ │ +        case P1(T) of
    │ │ │ +            {ok, R1, T1} ->
    │ │ │ +                case P2(T1) of
    │ │ │ +                    {ok, R2, T2} ->
    │ │ │ +                        {ok, {'and', R1, R2}};
    │ │ │                      fail ->
    │ │ │                          fail
    │ │ │                  end;
    │ │ │              fail ->
    │ │ │                  fail
    │ │ │          end
    │ │ │      end.

    Given a parser P1 for grammar G1, and a parser P2 for grammar G2, │ │ │ pand(P1, P2) returns a parser for the grammar, which consists of sequences of │ │ │ tokens that satisfy G1, followed by sequences of tokens that satisfy G2.

    por(P1, P2) returns a parser for the language described by the grammar G1 or │ │ │ -G2:

    por(P1, P2) ->
    │ │ │ -    fun (T) ->
    │ │ │ -        case P1(T) of
    │ │ │ -            {ok, R, T1} ->
    │ │ │ -                {ok, {'or',1,R}, T1};
    │ │ │ +G2:

    por(P1, P2) ->
    │ │ │ +    fun (T) ->
    │ │ │ +        case P1(T) of
    │ │ │ +            {ok, R, T1} ->
    │ │ │ +                {ok, {'or',1,R}, T1};
    │ │ │              fail ->
    │ │ │ -                case P2(T) of
    │ │ │ -                    {ok, R1, T1} ->
    │ │ │ -                        {ok, {'or',2,R1}, T1};
    │ │ │ +                case P2(T) of
    │ │ │ +                    {ok, R1, T1} ->
    │ │ │ +                        {ok, {'or',2,R1}, T1};
    │ │ │                      fail ->
    │ │ │                          fail
    │ │ │                  end
    │ │ │          end
    │ │ │      end.

    The original problem was to parse the grammar (a | b) & (c | d). The following │ │ │ -code addresses this problem:

    grammar() ->
    │ │ │ -    pand(
    │ │ │ -         por(pconst(a), pconst(b)),
    │ │ │ -         por(pconst(c), pconst(d))).

    The following code adds a parser interface to the grammar:

    parse(List) ->
    │ │ │ -    (grammar())(List).

    The parser can be tested as follows:

    > funparse:parse([a,c]).
    │ │ │ -{ok,{'and',{'or',1,{const,a}},{'or',1,{const,c}}}}
    │ │ │ -> funparse:parse([a,d]).
    │ │ │ -{ok,{'and',{'or',1,{const,a}},{'or',2,{const,d}}}}
    │ │ │ -> funparse:parse([b,c]).
    │ │ │ -{ok,{'and',{'or',2,{const,b}},{'or',1,{const,c}}}}
    │ │ │ -> funparse:parse([b,d]).
    │ │ │ -{ok,{'and',{'or',2,{const,b}},{'or',2,{const,d}}}}
    │ │ │ -> funparse:parse([a,b]).
    │ │ │ +code addresses this problem:

    grammar() ->
    │ │ │ +    pand(
    │ │ │ +         por(pconst(a), pconst(b)),
    │ │ │ +         por(pconst(c), pconst(d))).

    The following code adds a parser interface to the grammar:

    parse(List) ->
    │ │ │ +    (grammar())(List).

    The parser can be tested as follows:

    > funparse:parse([a,c]).
    │ │ │ +{ok,{'and',{'or',1,{const,a}},{'or',1,{const,c}}}}
    │ │ │ +> funparse:parse([a,d]).
    │ │ │ +{ok,{'and',{'or',1,{const,a}},{'or',2,{const,d}}}}
    │ │ │ +> funparse:parse([b,c]).
    │ │ │ +{ok,{'and',{'or',2,{const,b}},{'or',1,{const,c}}}}
    │ │ │ +> funparse:parse([b,d]).
    │ │ │ +{ok,{'and',{'or',2,{const,b}},{'or',2,{const,d}}}}
    │ │ │ +> funparse:parse([a,b]).
    │ │ │  fail
    │ │ │ │ │ │ │ │ │

    │ │ │

    An example of a simple server written in plain Erlang is provided in │ │ │ Overview. The server can be reimplemented using │ │ │ -gen_server, resulting in this callback module:

    -module(ch3).
    │ │ │ --behaviour(gen_server).
    │ │ │ +gen_server, resulting in this callback module:

    -module(ch3).
    │ │ │ +-behaviour(gen_server).
    │ │ │  
    │ │ │ --export([start_link/0]).
    │ │ │ --export([alloc/0, free/1]).
    │ │ │ --export([init/1, handle_call/3, handle_cast/2]).
    │ │ │ +-export([start_link/0]).
    │ │ │ +-export([alloc/0, free/1]).
    │ │ │ +-export([init/1, handle_call/3, handle_cast/2]).
    │ │ │  
    │ │ │ -start_link() ->
    │ │ │ -    gen_server:start_link({local, ch3}, ch3, [], []).
    │ │ │ +start_link() ->
    │ │ │ +    gen_server:start_link({local, ch3}, ch3, [], []).
    │ │ │  
    │ │ │ -alloc() ->
    │ │ │ -    gen_server:call(ch3, alloc).
    │ │ │ +alloc() ->
    │ │ │ +    gen_server:call(ch3, alloc).
    │ │ │  
    │ │ │ -free(Ch) ->
    │ │ │ -    gen_server:cast(ch3, {free, Ch}).
    │ │ │ +free(Ch) ->
    │ │ │ +    gen_server:cast(ch3, {free, Ch}).
    │ │ │  
    │ │ │ -init(_Args) ->
    │ │ │ -    {ok, channels()}.
    │ │ │ +init(_Args) ->
    │ │ │ +    {ok, channels()}.
    │ │ │  
    │ │ │ -handle_call(alloc, _From, Chs) ->
    │ │ │ -    {Ch, Chs2} = alloc(Chs),
    │ │ │ -    {reply, Ch, Chs2}.
    │ │ │ +handle_call(alloc, _From, Chs) ->
    │ │ │ +    {Ch, Chs2} = alloc(Chs),
    │ │ │ +    {reply, Ch, Chs2}.
    │ │ │  
    │ │ │ -handle_cast({free, Ch}, Chs) ->
    │ │ │ -    Chs2 = free(Ch, Chs),
    │ │ │ -    {noreply, Chs2}.

    The code is explained in the next sections.

    │ │ │ +handle_cast({free, Ch}, Chs) -> │ │ │ + Chs2 = free(Ch, Chs), │ │ │ + {noreply, Chs2}.

    The code is explained in the next sections.

    │ │ │ │ │ │ │ │ │ │ │ │ Starting a Gen_Server │ │ │

    │ │ │

    In the example in the previous section, gen_server is started by calling │ │ │ -ch3:start_link():

    start_link() ->
    │ │ │ -    gen_server:start_link({local, ch3}, ch3, [], []) => {ok, Pid}

    start_link/0 calls function gen_server:start_link/4. This function │ │ │ +ch3:start_link():

    start_link() ->
    │ │ │ +    gen_server:start_link({local, ch3}, ch3, [], []) => {ok, Pid}

    start_link/0 calls function gen_server:start_link/4. This function │ │ │ spawns and links to a new process, a gen_server.

    • The first argument, {local, ch3}, specifies the name. │ │ │ The gen_server is then locally registered as ch3.

      If the name is omitted, the gen_server is not registered. Instead its pid │ │ │ must be used. The name can also be given as {global, Name}, in which case │ │ │ the gen_server is registered using global:register_name/2.

    • The second argument, ch3, is the name of the callback module, which is │ │ │ the module where the callback functions are located.

      The interface functions (start_link/0, alloc/0, and free/1) are located │ │ │ in the same module as the callback functions (init/1, handle_call/3, and │ │ │ handle_cast/2). It is usually good programming practice to have the code │ │ │ corresponding to one process contained in a single module.

    • The third argument, [], is a term that is passed as is to the callback │ │ │ function init. Here, init does not need any indata and ignores the │ │ │ argument.

    • The fourth argument, [], is a list of options. See gen_server │ │ │ for the available options.

    If name registration succeeds, the new gen_server process calls the callback │ │ │ function ch3:init([]). init is expected to return {ok, State}, where │ │ │ State is the internal state of the gen_server. In this case, the state is │ │ │ -the available channels.

    init(_Args) ->
    │ │ │ -    {ok, channels()}.

    gen_server:start_link/4 is synchronous. It does not return until the │ │ │ +the available channels.

    init(_Args) ->
    │ │ │ +    {ok, channels()}.

    gen_server:start_link/4 is synchronous. It does not return until the │ │ │ gen_server has been initialized and is ready to receive requests.

    gen_server:start_link/4 must be used if the gen_server is part of │ │ │ a supervision tree, meaning that it was started by a supervisor. There │ │ │ is another function, gen_server:start/4, to start a standalone │ │ │ gen_server that is not part of a supervision tree.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -221,32 +221,32 @@ │ │ │

    │ │ │

    The synchronous request alloc() is implemented using gen_server:call/2:

    alloc() ->
    │ │ │      gen_server:call(ch3, alloc).

    ch3 is the name of the gen_server and must agree with the name │ │ │ used to start it. alloc is the actual request.

    The request is made into a message and sent to the gen_server. │ │ │ When the request is received, the gen_server calls │ │ │ handle_call(Request, From, State), which is expected to return │ │ │ a tuple {reply,Reply,State1}. Reply is the reply that is to be sent back │ │ │ -to the client, and State1 is a new value for the state of the gen_server.

    handle_call(alloc, _From, Chs) ->
    │ │ │ -    {Ch, Chs2} = alloc(Chs),
    │ │ │ -    {reply, Ch, Chs2}.

    In this case, the reply is the allocated channel Ch and the new state is the │ │ │ +to the client, and State1 is a new value for the state of the gen_server.

    handle_call(alloc, _From, Chs) ->
    │ │ │ +    {Ch, Chs2} = alloc(Chs),
    │ │ │ +    {reply, Ch, Chs2}.

    In this case, the reply is the allocated channel Ch and the new state is the │ │ │ set of remaining available channels Chs2.

    Thus, the call ch3:alloc() returns the allocated channel Ch and the │ │ │ gen_server then waits for new requests, now with an updated list of │ │ │ available channels.

    │ │ │ │ │ │ │ │ │ │ │ │ Asynchronous Requests - Cast │ │ │

    │ │ │ -

    The asynchronous request free(Ch) is implemented using gen_server:cast/2:

    free(Ch) ->
    │ │ │ -    gen_server:cast(ch3, {free, Ch}).

    ch3 is the name of the gen_server. {free, Ch} is the actual request.

    The request is made into a message and sent to the gen_server. │ │ │ +

    The asynchronous request free(Ch) is implemented using gen_server:cast/2:

    free(Ch) ->
    │ │ │ +    gen_server:cast(ch3, {free, Ch}).

    ch3 is the name of the gen_server. {free, Ch} is the actual request.

    The request is made into a message and sent to the gen_server. │ │ │ cast, and thus free, then returns ok.

    When the request is received, the gen_server calls │ │ │ handle_cast(Request, State), which is expected to return a tuple │ │ │ -{noreply,State1}. State1 is a new value for the state of the gen_server.

    handle_cast({free, Ch}, Chs) ->
    │ │ │ -    Chs2 = free(Ch, Chs),
    │ │ │ -    {noreply, Chs2}.

    In this case, the new state is the updated list of available channels Chs2. │ │ │ +{noreply,State1}. State1 is a new value for the state of the gen_server.

    handle_cast({free, Ch}, Chs) ->
    │ │ │ +    Chs2 = free(Ch, Chs),
    │ │ │ +    {noreply, Chs2}.

    In this case, the new state is the updated list of available channels Chs2. │ │ │ The gen_server is now ready for new requests.

    │ │ │ │ │ │ │ │ │ │ │ │ Stopping │ │ │

    │ │ │

    │ │ │ @@ -257,69 +257,69 @@ │ │ │

    │ │ │

    If the gen_server is part of a supervision tree, no stop function is needed. │ │ │ The gen_server is automatically terminated by its supervisor. Exactly how │ │ │ this is done is defined by a shutdown strategy │ │ │ set in the supervisor.

    If it is necessary to clean up before termination, the shutdown strategy │ │ │ must be a time-out value and the gen_server must be set to trap exit signals │ │ │ in function init. When ordered to shutdown, the gen_server then calls │ │ │ -the callback function terminate(shutdown, State):

    init(Args) ->
    │ │ │ +the callback function terminate(shutdown, State):

    init(Args) ->
    │ │ │      ...,
    │ │ │ -    process_flag(trap_exit, true),
    │ │ │ +    process_flag(trap_exit, true),
    │ │ │      ...,
    │ │ │ -    {ok, State}.
    │ │ │ +    {ok, State}.
    │ │ │  
    │ │ │  ...
    │ │ │  
    │ │ │ -terminate(shutdown, State) ->
    │ │ │ +terminate(shutdown, State) ->
    │ │ │      %% Code for cleaning up here
    │ │ │      ...
    │ │ │      ok.

    │ │ │ │ │ │ │ │ │ │ │ │ Standalone Gen_Servers │ │ │

    │ │ │

    If the gen_server is not part of a supervision tree, a stop function │ │ │ can be useful, for example:

    ...
    │ │ │ -export([stop/0]).
    │ │ │ +export([stop/0]).
    │ │ │  ...
    │ │ │  
    │ │ │ -stop() ->
    │ │ │ -    gen_server:cast(ch3, stop).
    │ │ │ +stop() ->
    │ │ │ +    gen_server:cast(ch3, stop).
    │ │ │  ...
    │ │ │  
    │ │ │ -handle_cast(stop, State) ->
    │ │ │ -    {stop, normal, State};
    │ │ │ -handle_cast({free, Ch}, State) ->
    │ │ │ +handle_cast(stop, State) ->
    │ │ │ +    {stop, normal, State};
    │ │ │ +handle_cast({free, Ch}, State) ->
    │ │ │      ...
    │ │ │  
    │ │ │  ...
    │ │ │  
    │ │ │ -terminate(normal, State) ->
    │ │ │ +terminate(normal, State) ->
    │ │ │      ok.

    The callback function handling the stop request returns a tuple │ │ │ {stop,normal,State1}, where normal specifies that it is │ │ │ a normal termination and State1 is a new value for the state │ │ │ of the gen_server. This causes the gen_server to call │ │ │ terminate(normal, State1) and then it terminates gracefully.

    │ │ │ │ │ │ │ │ │ │ │ │ Handling Other Messages │ │ │

    │ │ │

    If the gen_server is to be able to receive other messages than requests, │ │ │ the callback function handle_info(Info, State) must be implemented │ │ │ to handle them. Examples of other messages are exit messages, │ │ │ if the gen_server is linked to other processes than the supervisor │ │ │ -and it is trapping exit signals.

    handle_info({'EXIT', Pid, Reason}, State) ->
    │ │ │ +and it is trapping exit signals.

    handle_info({'EXIT', Pid, Reason}, State) ->
    │ │ │      %% Code to handle exits here.
    │ │ │      ...
    │ │ │ -    {noreply, State1}.

    The final function to implement is code_change/3:

    code_change(OldVsn, State, Extra) ->
    │ │ │ +    {noreply, State1}.

    The final function to implement is code_change/3:

    code_change(OldVsn, State, Extra) ->
    │ │ │      %% Code to convert state (and more) during code change.
    │ │ │      ...
    │ │ │ -    {ok, NewState}.
    │ │ │ +
    {ok, NewState}.
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │

    │ │ │ │ │ │ │ │ │ Specifying Included Applications │ │ │

    │ │ │

    Which applications to include is defined by the included_applications key in │ │ │ -the .app file:

    {application, prim_app,
    │ │ │ - [{description, "Tree application"},
    │ │ │ -  {vsn, "1"},
    │ │ │ -  {modules, [prim_app_cb, prim_app_sup, prim_app_server]},
    │ │ │ -  {registered, [prim_app_server]},
    │ │ │ -  {included_applications, [incl_app]},
    │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ -  {mod, {prim_app_cb,[]}},
    │ │ │ -  {env, [{file, "/usr/local/log"}]}
    │ │ │ - ]}.

    │ │ │ +the .app file:

    {application, prim_app,
    │ │ │ + [{description, "Tree application"},
    │ │ │ +  {vsn, "1"},
    │ │ │ +  {modules, [prim_app_cb, prim_app_sup, prim_app_server]},
    │ │ │ +  {registered, [prim_app_server]},
    │ │ │ +  {included_applications, [incl_app]},
    │ │ │ +  {applications, [kernel, stdlib, sasl]},
    │ │ │ +  {mod, {prim_app_cb,[]}},
    │ │ │ +  {env, [{file, "/usr/local/log"}]}
    │ │ │ + ]}.

    │ │ │ │ │ │ │ │ │ │ │ │ Synchronizing Processes during Startup │ │ │

    │ │ │

    The supervisor tree of an included application is started as part of the │ │ │ supervisor tree of the including application. If there is a need for │ │ │ synchronization between processes in the including and included applications, │ │ │ this can be achieved by using start phases.

    Start phases are defined by the start_phases key in the .app file as a list │ │ │ of tuples {Phase,PhaseArgs}, where Phase is an atom and PhaseArgs is a │ │ │ term.

    The value of the mod key of the including application must be set to │ │ │ {application_starter,[Module,StartArgs]}, where Module as usual is the │ │ │ application callback module. StartArgs is a term provided as argument to the │ │ │ -callback function Module:start/2:

    {application, prim_app,
    │ │ │ - [{description, "Tree application"},
    │ │ │ -  {vsn, "1"},
    │ │ │ -  {modules, [prim_app_cb, prim_app_sup, prim_app_server]},
    │ │ │ -  {registered, [prim_app_server]},
    │ │ │ -  {included_applications, [incl_app]},
    │ │ │ -  {start_phases, [{init,[]}, {go,[]}]},
    │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ -  {mod, {application_starter,[prim_app_cb,[]]}},
    │ │ │ -  {env, [{file, "/usr/local/log"}]}
    │ │ │ - ]}.
    │ │ │ +callback function Module:start/2:

    {application, prim_app,
    │ │ │ + [{description, "Tree application"},
    │ │ │ +  {vsn, "1"},
    │ │ │ +  {modules, [prim_app_cb, prim_app_sup, prim_app_server]},
    │ │ │ +  {registered, [prim_app_server]},
    │ │ │ +  {included_applications, [incl_app]},
    │ │ │ +  {start_phases, [{init,[]}, {go,[]}]},
    │ │ │ +  {applications, [kernel, stdlib, sasl]},
    │ │ │ +  {mod, {application_starter,[prim_app_cb,[]]}},
    │ │ │ +  {env, [{file, "/usr/local/log"}]}
    │ │ │ + ]}.
    │ │ │  
    │ │ │ -{application, incl_app,
    │ │ │ - [{description, "Included application"},
    │ │ │ -  {vsn, "1"},
    │ │ │ -  {modules, [incl_app_cb, incl_app_sup, incl_app_server]},
    │ │ │ -  {registered, []},
    │ │ │ -  {start_phases, [{go,[]}]},
    │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ -  {mod, {incl_app_cb,[]}}
    │ │ │ - ]}.

    When starting a primary application with included applications, the primary │ │ │ +{application, incl_app, │ │ │ + [{description, "Included application"}, │ │ │ + {vsn, "1"}, │ │ │ + {modules, [incl_app_cb, incl_app_sup, incl_app_server]}, │ │ │ + {registered, []}, │ │ │ + {start_phases, [{go,[]}]}, │ │ │ + {applications, [kernel, stdlib, sasl]}, │ │ │ + {mod, {incl_app_cb,[]}} │ │ │ + ]}.

    When starting a primary application with included applications, the primary │ │ │ application is started the normal way, that is:

    • The application controller creates an application master for the application
    • The application master calls Module:start(normal, StartArgs) to start the │ │ │ top supervisor.

    Then, for the primary application and each included application in top-down, │ │ │ left-to-right order, the application master calls │ │ │ Module:start_phase(Phase, Type, PhaseArgs) for each phase defined for the │ │ │ primary application, in that order. If a phase is not defined for an included │ │ │ application, the function is not called for this phase and application.

    The following requirements apply to the .app file for an included application:

    • The {mod, {Module,StartArgs}} option must be included. This option is used │ │ │ to find the callback module Module of the application. StartArgs is │ │ │ ignored, as Module:start/2 is called only for the primary application.
    • If the included application itself contains included applications, instead the │ │ │ {mod, {application_starter, [Module,StartArgs]}} option must be included.
    • The {start_phases, [{Phase,PhaseArgs}]} option must be included, and the set │ │ │ of specified phases must be a subset of the set of phases specified for the │ │ │ primary application.

    When starting prim_app as defined above, the application controller calls the │ │ │ following callback functions before application:start(prim_app) returns a │ │ │ -value:

    application:start(prim_app)
    │ │ │ - => prim_app_cb:start(normal, [])
    │ │ │ - => prim_app_cb:start_phase(init, normal, [])
    │ │ │ - => prim_app_cb:start_phase(go, normal, [])
    │ │ │ - => incl_app_cb:start_phase(go, normal, [])
    │ │ │ +value:

    application:start(prim_app)
    │ │ │ + => prim_app_cb:start(normal, [])
    │ │ │ + => prim_app_cb:start_phase(init, normal, [])
    │ │ │ + => prim_app_cb:start_phase(go, normal, [])
    │ │ │ + => incl_app_cb:start_phase(go, normal, [])
    │ │ │  ok
    │ │ │
    │ │ │ │ │ │

    │ │ │ │ │ │ │ │ │ Frequently Asked Questions │ │ │

    │ │ │
    • Q: So, now I can build Erlang using GCC on Windows?

      A: No, unfortunately not. You'll need Microsoft's Visual C++ │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/list_comprehensions.html │ │ │ @@ -117,33 +117,33 @@ │ │ │ │ │ │

      │ │ │ │ │ │ │ │ │ │ │ │ Simple Examples │ │ │

      │ │ │ -

      This section starts with a simple example, showing a generator and a filter:

      > [X || X <- [1,2,a,3,4,b,5,6], X > 3].
      │ │ │ -[a,4,b,5,6]

      This is read as follows: The list of X such that X is taken from the list │ │ │ +

      This section starts with a simple example, showing a generator and a filter:

      > [X || X <- [1,2,a,3,4,b,5,6], X > 3].
      │ │ │ +[a,4,b,5,6]

      This is read as follows: The list of X such that X is taken from the list │ │ │ [1,2,a,...] and X is greater than 3.

      The notation X <- [1,2,a,...] is a generator and the expression X > 3 is a │ │ │ filter.

      An additional filter, is_integer(X), can be added to │ │ │ -restrict the result to integers:

      > [X || X <- [1,2,a,3,4,b,5,6], is_integer(X), X > 3].
      │ │ │ -[4,5,6]

      Generators can be combined. For example, the Cartesian product of two lists can │ │ │ -be written as follows:

      > [{X, Y} || X <- [1,2,3], Y <- [a,b]].
      │ │ │ -[{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}]

      │ │ │ +restrict the result to integers:

      > [X || X <- [1,2,a,3,4,b,5,6], is_integer(X), X > 3].
      │ │ │ +[4,5,6]

      Generators can be combined. For example, the Cartesian product of two lists can │ │ │ +be written as follows:

      > [{X, Y} || X <- [1,2,3], Y <- [a,b]].
      │ │ │ +[{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}]

      │ │ │ │ │ │ │ │ │ │ │ │ Quick Sort │ │ │

      │ │ │ -

      The well-known quick sort routine can be written as follows:

      sort([]) -> [];
      │ │ │ -sort([_] = L) -> L;
      │ │ │ -sort([Pivot|T]) ->
      │ │ │ -    sort([ X || X <- T, X < Pivot]) ++
      │ │ │ -    [Pivot] ++
      │ │ │ -    sort([ X || X <- T, X >= Pivot]).

      The expression [X || X <- T, X < Pivot] is the list of all elements in T │ │ │ +

      The well-known quick sort routine can be written as follows:

      sort([]) -> [];
      │ │ │ +sort([_] = L) -> L;
      │ │ │ +sort([Pivot|T]) ->
      │ │ │ +    sort([ X || X <- T, X < Pivot]) ++
      │ │ │ +    [Pivot] ++
      │ │ │ +    sort([ X || X <- T, X >= Pivot]).

      The expression [X || X <- T, X < Pivot] is the list of all elements in T │ │ │ that are less than Pivot.

      [X || X <- T, X >= Pivot] is the list of all elements in T that are greater │ │ │ than or equal to Pivot.

      With the algorithm above, a list is sorted as follows:

      • A list with zero or one element is trivially sorted.
      • For lists with more than one element:
        1. The first element in the list is isolated as the pivot element.
        2. The remaining list is partitioned into two sublists, such that:
        • The first sublist contains all elements that are smaller than the pivot │ │ │ element.
        • The second sublist contains all elements that are greater than or equal to │ │ │ the pivot element.
        1. The sublists are recursively sorted by the same algorithm and the results │ │ │ are combined, resulting in a list consisting of:
        • All elements from the first sublist, that is all elements smaller than the │ │ │ pivot element, in sorted order.
        • The pivot element.
        • All elements from the second sublist, that is all elements greater than or │ │ │ equal to the pivot element, in sorted order.

      Note

      While the sorting algorithm as shown above serves as a nice example to │ │ │ @@ -151,93 +151,93 @@ │ │ │ lists module contains sorting functions that are implemented in a more │ │ │ efficient way.

      │ │ │ │ │ │ │ │ │ │ │ │ Permutations │ │ │

      │ │ │ -

      The following example generates all permutations of the elements in a list:

      perms([]) -> [[]];
      │ │ │ -perms(L)  -> [[H|T] || H <- L, T <- perms(L--[H])].

      This takes H from L in all possible ways. The result is the set of all lists │ │ │ +

      The following example generates all permutations of the elements in a list:

      perms([]) -> [[]];
      │ │ │ +perms(L)  -> [[H|T] || H <- L, T <- perms(L--[H])].

      This takes H from L in all possible ways. The result is the set of all lists │ │ │ [H|T], where T is the set of all possible permutations of L, with H │ │ │ -removed:

      > perms([b,u,g]).
      │ │ │ -[[b,u,g],[b,g,u],[u,b,g],[u,g,b],[g,b,u],[g,u,b]]

      │ │ │ +removed:

      > perms([b,u,g]).
      │ │ │ +[[b,u,g],[b,g,u],[u,b,g],[u,g,b],[g,b,u],[g,u,b]]

      │ │ │ │ │ │ │ │ │ │ │ │ Pythagorean Triplets │ │ │

      │ │ │

      Pythagorean triplets are sets of integers {A,B,C} such that │ │ │ A**2 + B**2 = C**2.

      The function pyth(N) generates a list of all integers {A,B,C} such that │ │ │ A**2 + B**2 = C**2 and where the sum of the sides is equal to, or less than, │ │ │ -N:

      pyth(N) ->
      │ │ │ -    [ {A,B,C} ||
      │ │ │ -        A <- lists:seq(1,N),
      │ │ │ -        B <- lists:seq(1,N),
      │ │ │ -        C <- lists:seq(1,N),
      │ │ │ +N:

      pyth(N) ->
      │ │ │ +    [ {A,B,C} ||
      │ │ │ +        A <- lists:seq(1,N),
      │ │ │ +        B <- lists:seq(1,N),
      │ │ │ +        C <- lists:seq(1,N),
      │ │ │          A+B+C =< N,
      │ │ │          A*A+B*B == C*C
      │ │ │ -    ].
      > pyth(3).
      │ │ │ -[].
      │ │ │ -> pyth(11).
      │ │ │ -[].
      │ │ │ -> pyth(12).
      │ │ │ -[{3,4,5},{4,3,5}]
      │ │ │ -> pyth(50).
      │ │ │ -[{3,4,5},
      │ │ │ - {4,3,5},
      │ │ │ - {5,12,13},
      │ │ │ - {6,8,10},
      │ │ │ - {8,6,10},
      │ │ │ - {8,15,17},
      │ │ │ - {9,12,15},
      │ │ │ - {12,5,13},
      │ │ │ - {12,9,15},
      │ │ │ - {12,16,20},
      │ │ │ - {15,8,17},
      │ │ │ - {16,12,20}]

      The following code reduces the search space and is more efficient:

      pyth1(N) ->
      │ │ │ -   [{A,B,C} ||
      │ │ │ -       A <- lists:seq(1,N-2),
      │ │ │ -       B <- lists:seq(A+1,N-1),
      │ │ │ -       C <- lists:seq(B+1,N),
      │ │ │ +    ].
      > pyth(3).
      │ │ │ +[].
      │ │ │ +> pyth(11).
      │ │ │ +[].
      │ │ │ +> pyth(12).
      │ │ │ +[{3,4,5},{4,3,5}]
      │ │ │ +> pyth(50).
      │ │ │ +[{3,4,5},
      │ │ │ + {4,3,5},
      │ │ │ + {5,12,13},
      │ │ │ + {6,8,10},
      │ │ │ + {8,6,10},
      │ │ │ + {8,15,17},
      │ │ │ + {9,12,15},
      │ │ │ + {12,5,13},
      │ │ │ + {12,9,15},
      │ │ │ + {12,16,20},
      │ │ │ + {15,8,17},
      │ │ │ + {16,12,20}]

      The following code reduces the search space and is more efficient:

      pyth1(N) ->
      │ │ │ +   [{A,B,C} ||
      │ │ │ +       A <- lists:seq(1,N-2),
      │ │ │ +       B <- lists:seq(A+1,N-1),
      │ │ │ +       C <- lists:seq(B+1,N),
      │ │ │         A+B+C =< N,
      │ │ │ -       A*A+B*B == C*C ].

      │ │ │ + A*A+B*B == C*C ].

      │ │ │ │ │ │ │ │ │ │ │ │ Simplifications With List Comprehensions │ │ │

      │ │ │

      As an example, list comprehensions can be used to simplify some of the functions │ │ │ -in lists.erl:

      append(L)   ->  [X || L1 <- L, X <- L1].
      │ │ │ -map(Fun, L) -> [Fun(X) || X <- L].
      │ │ │ -filter(Pred, L) -> [X || X <- L, Pred(X)].

      │ │ │ +in lists.erl:

      append(L)   ->  [X || L1 <- L, X <- L1].
      │ │ │ +map(Fun, L) -> [Fun(X) || X <- L].
      │ │ │ +filter(Pred, L) -> [X || X <- L, Pred(X)].

      │ │ │ │ │ │ │ │ │ │ │ │ Variable Bindings in List Comprehensions │ │ │

      │ │ │

      The scope rules for variables that occur in list comprehensions are as follows:

      • All variables that occur in a generator pattern are assumed to be "fresh" │ │ │ variables.
      • Any variables that are defined before the list comprehension, and that are │ │ │ used in filters, have the values they had before the list comprehension.
      • Variables cannot be exported from a list comprehension.

      As an example of these rules, suppose you want to write the function select, │ │ │ which selects certain elements from a list of tuples. Suppose you write │ │ │ select(X, L) -> [Y || {X, Y} <- L]. with the intention of extracting all │ │ │ tuples from L, where the first item is X.

      Compiling this gives the following diagnostic:

      ./FileName.erl:Line: Warning: variable 'X' shadowed in generate

      This diagnostic warns that the variable X in the pattern is not the same as │ │ │ -the variable X that occurs in the function head.

      Evaluating select gives the following result:

      > select(b,[{a,1},{b,2},{c,3},{b,7}]).
      │ │ │ -[1,2,3,7]

      This is not the wanted result. To achieve the desired effect, select must be │ │ │ -written as follows:

      select(X, L) ->  [Y || {X1, Y} <- L, X == X1].

      The generator now contains unbound variables and the test has been moved into │ │ │ -the filter.

      This now works as expected:

      > select(b,[{a,1},{b,2},{c,3},{b,7}]).
      │ │ │ -[2,7]

      Also note that a variable in a generator pattern will shadow a variable with the │ │ │ -same name bound in a previous generator pattern. For example:

      > [{X,Y} || X <- [1,2,3], X=Y <- [a,b,c]].
      │ │ │ -[{a,a},{b,b},{c,c},{a,a},{b,b},{c,c},{a,a},{b,b},{c,c}]

      A consequence of the rules for importing variables into a list comprehensions is │ │ │ +the variable X that occurs in the function head.

      Evaluating select gives the following result:

      > select(b,[{a,1},{b,2},{c,3},{b,7}]).
      │ │ │ +[1,2,3,7]

      This is not the wanted result. To achieve the desired effect, select must be │ │ │ +written as follows:

      select(X, L) ->  [Y || {X1, Y} <- L, X == X1].

      The generator now contains unbound variables and the test has been moved into │ │ │ +the filter.

      This now works as expected:

      > select(b,[{a,1},{b,2},{c,3},{b,7}]).
      │ │ │ +[2,7]

      Also note that a variable in a generator pattern will shadow a variable with the │ │ │ +same name bound in a previous generator pattern. For example:

      > [{X,Y} || X <- [1,2,3], X=Y <- [a,b,c]].
      │ │ │ +[{a,a},{b,b},{c,c},{a,a},{b,b},{c,c},{a,a},{b,b},{c,c}]

      A consequence of the rules for importing variables into a list comprehensions is │ │ │ that certain pattern matching operations must be moved into the filters and │ │ │ -cannot be written directly in the generators.

      To illustrate this, do not write as follows:

      f(...) ->
      │ │ │ +cannot be written directly in the generators.

      To illustrate this, do not write as follows:

      f(...) ->
      │ │ │      Y = ...
      │ │ │ -    [ Expression || PatternInvolving Y  <- Expr, ...]
      │ │ │ -    ...

      Instead, write as follows:

      f(...) ->
      │ │ │ +    [ Expression || PatternInvolving Y  <- Expr, ...]
      │ │ │ +    ...

      Instead, write as follows:

      f(...) ->
      │ │ │      Y = ...
      │ │ │ -    [ Expression || PatternInvolving Y1  <- Expr, Y == Y1, ...]
      │ │ │ +    [ Expression || PatternInvolving Y1  <- Expr, Y == Y1, ...]
      │ │ │      ...
      │ │ │ │ │ │ │ │ │
      │ │ │
      │ │ │ │ │ │ │ │ │ Creating a List │ │ │ │ │ │

      Lists can only be built starting from the end and attaching list elements at the │ │ │ beginning. If you use the ++ operator as follows, a new list is created that │ │ │ is a copy of the elements in List1, followed by List2:

      List1 ++ List2

      Looking at how lists:append/2 or ++ would be implemented in plain Erlang, │ │ │ -clearly the first list is copied:

      append([H|T], Tail) ->
      │ │ │ -    [H|append(T, Tail)];
      │ │ │ -append([], Tail) ->
      │ │ │ +clearly the first list is copied:

      append([H|T], Tail) ->
      │ │ │ +    [H|append(T, Tail)];
      │ │ │ +append([], Tail) ->
      │ │ │      Tail.

      When recursing and building a list, it is important to ensure that you attach │ │ │ the new elements to the beginning of the list. In this way, you will build one │ │ │ -list, not hundreds or thousands of copies of the growing result list.

      Let us first see how it is not to be done:

      DO NOT

      bad_fib(N) ->
      │ │ │ -    bad_fib(N, 0, 1, []).
      │ │ │ +list, not hundreds or thousands of copies of the growing result list.

      Let us first see how it is not to be done:

      DO NOT

      bad_fib(N) ->
      │ │ │ +    bad_fib(N, 0, 1, []).
      │ │ │  
      │ │ │ -bad_fib(0, _Current, _Next, Fibs) ->
      │ │ │ +bad_fib(0, _Current, _Next, Fibs) ->
      │ │ │      Fibs;
      │ │ │ -bad_fib(N, Current, Next, Fibs) ->
      │ │ │ -    bad_fib(N - 1, Next, Current + Next, Fibs ++ [Current]).

      Here more than one list is built. In each iteration step a new list is created │ │ │ +bad_fib(N, Current, Next, Fibs) -> │ │ │ + bad_fib(N - 1, Next, Current + Next, Fibs ++ [Current]).

      Here more than one list is built. In each iteration step a new list is created │ │ │ that is one element longer than the new previous list.

      To avoid copying the result in each iteration, build the list in reverse order │ │ │ -and reverse the list when you are done:

      DO

      tail_recursive_fib(N) ->
      │ │ │ -    tail_recursive_fib(N, 0, 1, []).
      │ │ │ +and reverse the list when you are done:

      DO

      tail_recursive_fib(N) ->
      │ │ │ +    tail_recursive_fib(N, 0, 1, []).
      │ │ │  
      │ │ │ -tail_recursive_fib(0, _Current, _Next, Fibs) ->
      │ │ │ -    lists:reverse(Fibs);
      │ │ │ -tail_recursive_fib(N, Current, Next, Fibs) ->
      │ │ │ -    tail_recursive_fib(N - 1, Next, Current + Next, [Current|Fibs]).

      │ │ │ +tail_recursive_fib(0, _Current, _Next, Fibs) -> │ │ │ + lists:reverse(Fibs); │ │ │ +tail_recursive_fib(N, Current, Next, Fibs) -> │ │ │ + tail_recursive_fib(N - 1, Next, Current + Next, [Current|Fibs]).

      │ │ │ │ │ │ │ │ │ │ │ │ List Comprehensions │ │ │

      │ │ │ -

      A list comprehension:

      [Expr(E) || E <- List]

      is basically translated to a local function:

      'lc^0'([E|Tail], Expr) ->
      │ │ │ -    [Expr(E)|'lc^0'(Tail, Expr)];
      │ │ │ -'lc^0'([], _Expr) -> [].

      If the result of the list comprehension will obviously not be used, a list │ │ │ -will not be constructed. For example, in this code:

      [io:put_chars(E) || E <- List],
      │ │ │ +

      A list comprehension:

      [Expr(E) || E <- List]

      is basically translated to a local function:

      'lc^0'([E|Tail], Expr) ->
      │ │ │ +    [Expr(E)|'lc^0'(Tail, Expr)];
      │ │ │ +'lc^0'([], _Expr) -> [].

      If the result of the list comprehension will obviously not be used, a list │ │ │ +will not be constructed. For example, in this code:

      [io:put_chars(E) || E <- List],
      │ │ │  ok.

      or in this code:

      case Var of
      │ │ │      ... ->
      │ │ │ -        [io:put_chars(E) || E <- List];
      │ │ │ +        [io:put_chars(E) || E <- List];
      │ │ │      ... ->
      │ │ │  end,
      │ │ │ -some_function(...),

      the value is not assigned to a variable, not passed to another function, and not │ │ │ +some_function(...),

      the value is not assigned to a variable, not passed to another function, and not │ │ │ returned. This means that there is no need to construct a list and the compiler │ │ │ -will simplify the code for the list comprehension to:

      'lc^0'([E|Tail], Expr) ->
      │ │ │ -    Expr(E),
      │ │ │ -    'lc^0'(Tail, Expr);
      │ │ │ -'lc^0'([], _Expr) -> [].

      The compiler also understands that assigning to _ means that the value will │ │ │ -not be used. Therefore, the code in the following example will also be optimized:

      _ = [io:put_chars(E) || E <- List],
      │ │ │ +will simplify the code for the list comprehension to:

      'lc^0'([E|Tail], Expr) ->
      │ │ │ +    Expr(E),
      │ │ │ +    'lc^0'(Tail, Expr);
      │ │ │ +'lc^0'([], _Expr) -> [].

      The compiler also understands that assigning to _ means that the value will │ │ │ +not be used. Therefore, the code in the following example will also be optimized:

      _ = [io:put_chars(E) || E <- List],
      │ │ │  ok.

      │ │ │ │ │ │ │ │ │ │ │ │ Deep and Flat Lists │ │ │

      │ │ │

      lists:flatten/1 builds an entirely new list. It is therefore expensive, and │ │ │ even more expensive than the ++ operator (which copies its left argument, │ │ │ but not its right argument).

      In the following situations it is unnecessary to call lists:flatten/1:

      • When sending data to a port. Ports understand deep lists so there is no reason │ │ │ to flatten the list before sending it to the port.
      • When calling BIFs that accept deep lists, such as │ │ │ list_to_binary/1 or │ │ │ iolist_to_binary/1.
      • When you know that your list is only one level deep. Use lists:append/1 │ │ │ -instead.

      Examples:

      DO

      port_command(Port, DeepList)

      DO NOT

      port_command(Port, lists:flatten(DeepList))

      A common way to send a zero-terminated string to a port is the following:

      DO NOT

      TerminatedStr = String ++ [0],
      │ │ │ -port_command(Port, TerminatedStr)

      Instead:

      DO

      TerminatedStr = [String, 0],
      │ │ │ -port_command(Port, TerminatedStr)

      DO

      1> lists:append([[1], [2], [3]]).
      │ │ │ -[1,2,3]

      DO NOT

      1> lists:flatten([[1], [2], [3]]).
      │ │ │ -[1,2,3]

      │ │ │ +instead.

    Examples:

    DO

    port_command(Port, DeepList)

    DO NOT

    port_command(Port, lists:flatten(DeepList))

    A common way to send a zero-terminated string to a port is the following:

    DO NOT

    TerminatedStr = String ++ [0],
    │ │ │ +port_command(Port, TerminatedStr)

    Instead:

    DO

    TerminatedStr = [String, 0],
    │ │ │ +port_command(Port, TerminatedStr)

    DO

    1> lists:append([[1], [2], [3]]).
    │ │ │ +[1,2,3]

    DO NOT

    1> lists:flatten([[1], [2], [3]]).
    │ │ │ +[1,2,3]

    │ │ │ │ │ │ │ │ │ │ │ │ Recursive List Functions │ │ │

    │ │ │

    There are two basic ways to write a function that traverses a list and │ │ │ produces a new list.

    The first way is writing a body-recursive function:

    %% Add 42 to each integer in the list.
    │ │ │ -add_42_body([H|T]) ->
    │ │ │ -    [H + 42 | add_42_body(T)];
    │ │ │ -add_42_body([]) ->
    │ │ │ -    [].

    The second way is writing a tail-recursive function:

    %% Add 42 to each integer in the list.
    │ │ │ -add_42_tail(List) ->
    │ │ │ -    add_42_tail(List, []).
    │ │ │ -
    │ │ │ -add_42_tail([H|T], Acc) ->
    │ │ │ -    add_42_tail(T, [H + 42 | Acc]);
    │ │ │ -add_42_tail([], Acc) ->
    │ │ │ -    lists:reverse(Acc).

    In early version of Erlang the tail-recursive function would typically │ │ │ +add_42_body([H|T]) -> │ │ │ + [H + 42 | add_42_body(T)]; │ │ │ +add_42_body([]) -> │ │ │ + [].

    The second way is writing a tail-recursive function:

    %% Add 42 to each integer in the list.
    │ │ │ +add_42_tail(List) ->
    │ │ │ +    add_42_tail(List, []).
    │ │ │ +
    │ │ │ +add_42_tail([H|T], Acc) ->
    │ │ │ +    add_42_tail(T, [H + 42 | Acc]);
    │ │ │ +add_42_tail([], Acc) ->
    │ │ │ +    lists:reverse(Acc).

    In early version of Erlang the tail-recursive function would typically │ │ │ be more efficient. In modern versions of Erlang, there is usually not │ │ │ much difference in performance between a body-recursive list function and │ │ │ tail-recursive function that reverses the list at the end. Therefore, │ │ │ concentrate on writing beautiful code and forget about the performance │ │ │ of your list functions. In the time-critical parts of your code, │ │ │ measure before rewriting your code.

    For a thorough discussion about tail and body recursion, see │ │ │ Erlang's Tail Recursion is Not a Silver Bullet.

    Note

    This section is about list functions that construct lists. A tail-recursive │ │ │ function that does not construct a list runs in constant space, while the │ │ │ corresponding body-recursive function uses stack space proportional to the │ │ │ length of the list.

    For example, a function that sums a list of integers, is not to be written as │ │ │ -follows:

    DO NOT

    recursive_sum([H|T]) -> H+recursive_sum(T);
    │ │ │ -recursive_sum([])    -> 0.

    Instead:

    DO

    sum(L) -> sum(L, 0).
    │ │ │ +follows:

    DO NOT

    recursive_sum([H|T]) -> H+recursive_sum(T);
    │ │ │ +recursive_sum([])    -> 0.

    Instead:

    DO

    sum(L) -> sum(L, 0).
    │ │ │  
    │ │ │ -sum([H|T], Sum) -> sum(T, Sum + H);
    │ │ │ -sum([], Sum)    -> Sum.
    │ │ │ +
    sum([H|T], Sum) -> sum(T, Sum + H); │ │ │ +sum([], Sum) -> Sum.
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │

    │ │ │ │ │ │ │ │ │ File Inclusion │ │ │

    │ │ │ -

    A file can be included as follows:

    -include(File).
    │ │ │ --include_lib(File).

    File, a string, is to point out a file. The contents of this file are included │ │ │ +

    A file can be included as follows:

    -include(File).
    │ │ │ +-include_lib(File).

    File, a string, is to point out a file. The contents of this file are included │ │ │ as is, at the position of the directive.

    Include files are typically used for record and macro definitions that are │ │ │ shared by several modules. It is recommended to use the file name extension │ │ │ .hrl for include files.

    File can start with a path component $VAR, for some string VAR. If that is │ │ │ the case, the value of the environment variable VAR as returned by │ │ │ os:getenv(VAR) is substituted for $VAR. If os:getenv(VAR) returns false, │ │ │ $VAR is left as is.

    If the filename File is absolute (possibly after variable substitution), the │ │ │ include file with that name is included. Otherwise, the specified file is │ │ │ searched for in the following directories, and in this order:

    1. The current working directory
    2. The directory where the module is being compiled
    3. The directories given by the include option

    For details, see erlc in ERTS and │ │ │ -compile in Compiler.

    Examples:

    -include("my_records.hrl").
    │ │ │ --include("incdir/my_records.hrl").
    │ │ │ --include("/home/user/proj/my_records.hrl").
    │ │ │ --include("$PROJ_ROOT/my_records.hrl").

    include_lib is similar to include, but is not to point out an absolute file. │ │ │ +compile in Compiler.

    Examples:

    -include("my_records.hrl").
    │ │ │ +-include("incdir/my_records.hrl").
    │ │ │ +-include("/home/user/proj/my_records.hrl").
    │ │ │ +-include("$PROJ_ROOT/my_records.hrl").

    include_lib is similar to include, but is not to point out an absolute file. │ │ │ Instead, the first path component (possibly after variable substitution) is │ │ │ -assumed to be the name of an application.

    Example:

    -include_lib("kernel/include/file.hrl").

    The code server uses code:lib_dir(kernel) to find the directory of the current │ │ │ +assumed to be the name of an application.

    Example:

    -include_lib("kernel/include/file.hrl").

    The code server uses code:lib_dir(kernel) to find the directory of the current │ │ │ (latest) version of Kernel, and then the subdirectory include is searched for │ │ │ the file file.hrl.

    │ │ │ │ │ │ │ │ │ │ │ │ Defining and Using Macros │ │ │

    │ │ │ -

    A macro is defined as follows:

    -define(Const, Replacement).
    │ │ │ --define(Func(Var1,...,VarN), Replacement).

    A macro definition can be placed anywhere among the attributes and function │ │ │ +

    A macro is defined as follows:

    -define(Const, Replacement).
    │ │ │ +-define(Func(Var1,...,VarN), Replacement).

    A macro definition can be placed anywhere among the attributes and function │ │ │ declarations of a module, but the definition must come before any usage of the │ │ │ macro.

    If a macro is used in several modules, it is recommended that the macro │ │ │ definition is placed in an include file.

    A macro is used as follows:

    ?Const
    │ │ │  ?Func(Arg1,...,ArgN)

    Macros are expanded during compilation. A simple macro ?Const is replaced with │ │ │ -Replacement.

    Example:

    -define(TIMEOUT, 200).
    │ │ │ +Replacement.

    Example:

    -define(TIMEOUT, 200).
    │ │ │  ...
    │ │ │ -call(Request) ->
    │ │ │ -    server:call(refserver, Request, ?TIMEOUT).

    This is expanded to:

    call(Request) ->
    │ │ │ -    server:call(refserver, Request, 200).

    A macro ?Func(Arg1,...,ArgN) is replaced with Replacement, where all │ │ │ +call(Request) -> │ │ │ + server:call(refserver, Request, ?TIMEOUT).

    This is expanded to:

    call(Request) ->
    │ │ │ +    server:call(refserver, Request, 200).

    A macro ?Func(Arg1,...,ArgN) is replaced with Replacement, where all │ │ │ occurrences of a variable Var from the macro definition are replaced with the │ │ │ -corresponding argument Arg.

    Example:

    -define(MACRO1(X, Y), {a, X, b, Y}).
    │ │ │ +corresponding argument Arg.

    Example:

    -define(MACRO1(X, Y), {a, X, b, Y}).
    │ │ │  ...
    │ │ │ -bar(X) ->
    │ │ │ -    ?MACRO1(a, b),
    │ │ │ -    ?MACRO1(X, 123)

    This is expanded to:

    bar(X) ->
    │ │ │ -    {a,a,b,b},
    │ │ │ -    {a,X,b,123}.

    It is good programming practice, but not mandatory, to ensure that a macro │ │ │ +bar(X) -> │ │ │ + ?MACRO1(a, b), │ │ │ + ?MACRO1(X, 123)

    This is expanded to:

    bar(X) ->
    │ │ │ +    {a,a,b,b},
    │ │ │ +    {a,X,b,123}.

    It is good programming practice, but not mandatory, to ensure that a macro │ │ │ definition is a valid Erlang syntactic form.

    To view the result of macro expansion, a module can be compiled with the 'P' │ │ │ option. compile:file(File, ['P']). This produces a listing of the parsed code │ │ │ after preprocessing and parse transforms, in the file File.P.

    │ │ │ │ │ │ │ │ │ │ │ │ Predefined Macros │ │ │ @@ -185,29 +185,29 @@ │ │ │ │ │ │ │ │ │ Macros Overloading │ │ │

    │ │ │

    It is possible to overload macros, except for predefined macros. An overloaded │ │ │ macro has more than one definition, each with a different number of arguments.

    Change

    Support for overloading of macros was added in Erlang 5.7.5/OTP R13B04.

    A macro ?Func(Arg1,...,ArgN) with a (possibly empty) list of arguments results │ │ │ in an error message if there is at least one definition of Func with │ │ │ -arguments, but none with N arguments.

    Assuming these definitions:

    -define(F0(), c).
    │ │ │ --define(F1(A), A).
    │ │ │ --define(C, m:f).

    the following does not work:

    f0() ->
    │ │ │ +arguments, but none with N arguments.

    Assuming these definitions:

    -define(F0(), c).
    │ │ │ +-define(F1(A), A).
    │ │ │ +-define(C, m:f).

    the following does not work:

    f0() ->
    │ │ │      ?F0. % No, an empty list of arguments expected.
    │ │ │  
    │ │ │ -f1(A) ->
    │ │ │ -    ?F1(A, A). % No, exactly one argument expected.

    On the other hand,

    f() ->
    │ │ │ -    ?C().

    is expanded to

    f() ->
    │ │ │ -    m:f().

    │ │ │ +f1(A) -> │ │ │ + ?F1(A, A). % No, exactly one argument expected.

    On the other hand,

    f() ->
    │ │ │ +    ?C().

    is expanded to

    f() ->
    │ │ │ +    m:f().

    │ │ │ │ │ │ │ │ │ │ │ │ Removing a macro definition │ │ │

    │ │ │ -

    A definition of macro can be removed as follows:

    -undef(Macro).

    │ │ │ +

    A definition of macro can be removed as follows:

    -undef(Macro).

    │ │ │ │ │ │ │ │ │ │ │ │ Conditional Compilation │ │ │

    │ │ │

    The following macro directives support conditional compilation:

    • -ifdef(Macro). - Evaluate the following lines only if Macro is │ │ │ defined.

    • -ifndef(Macro). - Evaluate the following lines only if Macro is not │ │ │ @@ -219,43 +219,43 @@ │ │ │ true, and the Condition evaluates to true, the lines following the elif │ │ │ are evaluated instead.

    • -endif. - Specifies the end of a series of control flow directives.

    Note

    Macro directives cannot be used inside functions.

    Syntactically, the Condition in if and elif must be a │ │ │ guard expression. Other constructs (such as │ │ │ a case expression) result in a compilation error.

    As opposed to the standard guard expressions, an expression in an if and │ │ │ elif also supports calling the psuedo-function defined(Name), which tests │ │ │ whether the Name argument is the name of a previously defined macro. │ │ │ defined(Name) evaluates to true if the macro is defined and false │ │ │ -otherwise. An attempt to call other functions results in a compilation error.

    Example:

    -module(m).
    │ │ │ +otherwise. An attempt to call other functions results in a compilation error.

    Example:

    -module(m).
    │ │ │  ...
    │ │ │  
    │ │ │ --ifdef(debug).
    │ │ │ --define(LOG(X), io:format("{~p,~p}: ~p~n", [?MODULE,?LINE,X])).
    │ │ │ +-ifdef(debug).
    │ │ │ +-define(LOG(X), io:format("{~p,~p}: ~p~n", [?MODULE,?LINE,X])).
    │ │ │  -else.
    │ │ │ --define(LOG(X), true).
    │ │ │ +-define(LOG(X), true).
    │ │ │  -endif.
    │ │ │  
    │ │ │  ...

    When trace output is desired, debug is to be defined when the module m is │ │ │ compiled:

    % erlc -Ddebug m.erl
    │ │ │  
    │ │ │  or
    │ │ │  
    │ │ │ -1> c(m, {d, debug}).
    │ │ │ -{ok,m}

    ?LOG(Arg) is then expanded to a call to io:format/2 and provide the user │ │ │ -with some simple trace output.

    Example:

    -module(m)
    │ │ │ +1> c(m, {d, debug}).
    │ │ │ +{ok,m}

    ?LOG(Arg) is then expanded to a call to io:format/2 and provide the user │ │ │ +with some simple trace output.

    Example:

    -module(m)
    │ │ │  ...
    │ │ │ --if(?OTP_RELEASE >= 25).
    │ │ │ +-if(?OTP_RELEASE >= 25).
    │ │ │  %% Code that will work in OTP 25 or higher
    │ │ │ --elif(?OTP_RELEASE >= 26).
    │ │ │ +-elif(?OTP_RELEASE >= 26).
    │ │ │  %% Code that will work in OTP 26 or higher
    │ │ │  -else.
    │ │ │  %% Code that will work in OTP 24 or lower.
    │ │ │  -endif.
    │ │ │  ...

    This code uses the OTP_RELEASE macro to conditionally select code depending on │ │ │ -release.

    Example:

    -module(m)
    │ │ │ +release.

    Example:

    -module(m)
    │ │ │  ...
    │ │ │ --if(?OTP_RELEASE >= 26 andalso defined(debug)).
    │ │ │ +-if(?OTP_RELEASE >= 26 andalso defined(debug)).
    │ │ │  %% Debugging code that requires OTP 26 or later.
    │ │ │  -else.
    │ │ │  %% Non-debug code that works in any release.
    │ │ │  -endif.
    │ │ │  ...

    This code uses the OTP_RELEASE macro and defined(debug) to compile debug │ │ │ code only for OTP 26 or later.

    │ │ │ │ │ │ @@ -270,44 +270,44 @@ │ │ │ used. In practice this means it should appear before any -export(..) or record │ │ │ definitions.

    │ │ │ │ │ │ │ │ │ │ │ │ -error() and -warning() directives │ │ │

    │ │ │ -

    The directive -error(Term) causes a compilation error.

    Example:

    -module(t).
    │ │ │ --export([version/0]).
    │ │ │ +

    The directive -error(Term) causes a compilation error.

    Example:

    -module(t).
    │ │ │ +-export([version/0]).
    │ │ │  
    │ │ │ --ifdef(VERSION).
    │ │ │ -version() -> ?VERSION.
    │ │ │ +-ifdef(VERSION).
    │ │ │ +version() -> ?VERSION.
    │ │ │  -else.
    │ │ │ --error("Macro VERSION must be defined.").
    │ │ │ -version() -> "".
    │ │ │ +-error("Macro VERSION must be defined.").
    │ │ │ +version() -> "".
    │ │ │  -endif.

    The error message will look like this:

    % erlc t.erl
    │ │ │ -t.erl:7: -error("Macro VERSION must be defined.").

    The directive -warning(Term) causes a compilation warning.

    Example:

    -module(t).
    │ │ │ --export([version/0]).
    │ │ │ +t.erl:7: -error("Macro VERSION must be defined.").

    The directive -warning(Term) causes a compilation warning.

    Example:

    -module(t).
    │ │ │ +-export([version/0]).
    │ │ │  
    │ │ │ --ifndef(VERSION).
    │ │ │ --warning("Macro VERSION not defined -- using default version.").
    │ │ │ --define(VERSION, "0").
    │ │ │ +-ifndef(VERSION).
    │ │ │ +-warning("Macro VERSION not defined -- using default version.").
    │ │ │ +-define(VERSION, "0").
    │ │ │  -endif.
    │ │ │ -version() -> ?VERSION.

    The warning message will look like this:

    % erlc t.erl
    │ │ │ +version() -> ?VERSION.

    The warning message will look like this:

    % erlc t.erl
    │ │ │  t.erl:5: Warning: -warning("Macro VERSION not defined -- using default version.").

    Change

    The -error() and -warning() directives were added in Erlang/OTP 19.

    │ │ │ │ │ │ │ │ │ │ │ │ Stringifying Macro Arguments │ │ │

    │ │ │

    The construction ??Arg, where Arg is a macro argument, is expanded to a │ │ │ string containing the tokens of the argument. This is similar to the #arg │ │ │ -stringifying construction in C.

    Example:

    -define(TESTCALL(Call), io:format("Call ~s: ~w~n", [??Call, Call])).
    │ │ │ +stringifying construction in C.

    Example:

    -define(TESTCALL(Call), io:format("Call ~s: ~w~n", [??Call, Call])).
    │ │ │  
    │ │ │ -?TESTCALL(myfunction(1,2)),
    │ │ │ -?TESTCALL(you:function(2,1)).

    results in

    io:format("Call ~s: ~w~n",["myfunction ( 1 , 2 )",myfunction(1,2)]),
    │ │ │ -io:format("Call ~s: ~w~n",["you : function ( 2 , 1 )",you:function(2,1)]).

    That is, a trace output, with both the function called and the resulting value.

    │ │ │ +
    ?TESTCALL(myfunction(1,2)), │ │ │ +?TESTCALL(you:function(2,1)).

    results in

    io:format("Call ~s: ~w~n",["myfunction ( 1 , 2 )",myfunction(1,2)]),
    │ │ │ +io:format("Call ~s: ~w~n",["you : function ( 2 , 1 )",you:function(2,1)]).

    That is, a trace output, with both the function called and the resulting value.

    │ │ │

    │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │
  • maps:get/3 function. If there are default │ │ │ values, sharing of keys between different instances of the map will be less │ │ │ effective, and it is not possible to match multiple elements having default │ │ │ values in one go.

  • To avoid having to deal with a map that may lack some keys, maps:merge/2 can │ │ │ -efficiently add multiple default values. For example:

    DefaultMap = #{shoe_size => 42, editor => emacs},
    │ │ │ -MapWithDefaultsApplied = maps:merge(DefaultMap, OtherMap)
  • │ │ │ +efficiently add multiple default values. For example:

    DefaultMap = #{shoe_size => 42, editor => emacs},
    │ │ │ +MapWithDefaultsApplied = maps:merge(DefaultMap, OtherMap)

    │ │ │ │ │ │ │ │ │ │ │ │ Using Maps as Dictionaries │ │ │

    │ │ │

    Using a map as a dictionary implies the following usage pattern:

    • Keys are usually variables not known at compile-time.
    • There can be any number of elements in the map.
    • Usually, no more than one element is looked up or updated at once.

    Given that usage pattern, the difference in performance between using the map │ │ │ syntax and the maps module is usually small. Therefore, which one to use is │ │ │ @@ -167,18 +167,18 @@ │ │ │ choice.

    │ │ │ │ │ │ │ │ │ │ │ │ Using Maps as Sets │ │ │

    │ │ │

    Starting in OTP 24, the sets module has an option to represent sets as maps. │ │ │ -Examples:

    1> sets:new([{version,2}]).
    │ │ │ -#{}
    │ │ │ -2> sets:from_list([x,y,z], [{version,2}]).
    │ │ │ -#{x => [],y => [],z => []}

    sets backed by maps is generally the most efficient set representation, with a │ │ │ +Examples:

    1> sets:new([{version,2}]).
    │ │ │ +#{}
    │ │ │ +2> sets:from_list([x,y,z], [{version,2}]).
    │ │ │ +#{x => [],y => [],z => []}

    sets backed by maps is generally the most efficient set representation, with a │ │ │ few possible exceptions:

    • ordsets:intersection/2 can be more efficient than sets:intersection/2. If │ │ │ the intersection operation is frequently used and operations that operate on a │ │ │ single element in a set (such as is_element/2) are avoided, ordsets can │ │ │ be a better choice than sets.
    • If the intersection operation is frequently used and operations that operate │ │ │ on a single element in a set (such as is_element/2) must also be efficient, │ │ │ gb_sets can potentially be a better choice than sets.
    • If the elements of the set are integers in a fairly compact range, the set can │ │ │ be represented as an integer where each bit represents an element in the set. │ │ │ @@ -203,18 +203,18 @@ │ │ │ for the runtime system).

    • N - The number of elements in the map.

    • Keys - A tuple with keys of the map: {Key1,...,KeyN}. The keys are │ │ │ sorted.

    • Value1 - The value corresponding to the first key in the key tuple.

    • ValueN - The value corresponding to the last key in the key tuple.

    As an example, let us look at how the map #{a => foo, z => bar} is │ │ │ represented:

    01234
    FLATMAP2{a,z}foobar

    Table: #{a => foo, z => bar}

    Let us update the map: M#{q => baz}. The map now looks like this:

    012345
    FLATMAP3{a,q,z}foobazbar

    Table: #{a => foo, q => baz, z => bar}

    Finally, change the value of one element: M#{z := bird}. The map now looks │ │ │ like this:

    012345
    FLATMAP3{a,q,z}foobazbird

    Table: #{a => foo, q => baz, z => bird}

    When the value for an existing key is updated, the key tuple is not updated, │ │ │ allowing the key tuple to be shared with other instances of the map that have │ │ │ the same keys. In fact, the key tuple can be shared between all maps with the │ │ │ same keys with some care. To arrange that, define a function that returns a map. │ │ │ -For example:

    new() ->
    │ │ │ -    #{a => default, b => default, c => default}.

    Defined like this, the key tuple {a,b,c} will be a global literal. To ensure │ │ │ +For example:

    new() ->
    │ │ │ +    #{a => default, b => default, c => default}.

    Defined like this, the key tuple {a,b,c} will be a global literal. To ensure │ │ │ that the key tuple is shared when creating an instance of the map, always call │ │ │ -new() and modify the returned map:

        (SOME_MODULE:new())#{a := 42}.

    Using the map syntax with small maps is particularly efficient. As long as the │ │ │ +new() and modify the returned map:

        (SOME_MODULE:new())#{a := 42}.

    Using the map syntax with small maps is particularly efficient. As long as the │ │ │ keys are known at compile-time, the map is updated in one go, making the time to │ │ │ update a map essentially constant regardless of the number of keys updated. The │ │ │ same goes for matching. (When the keys are variables, one or more of the keys │ │ │ could be identical, so the operations need to be performed sequentially from │ │ │ left to right.)

    The memory size for a small map is the size of all keys and values plus 5 words. │ │ │ See Memory for more information about memory sizes.

    │ │ │ │ │ │ @@ -241,21 +241,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ Using the Map Syntax │ │ │

    │ │ │

    Using the map syntax is usually slightly more efficient than using the │ │ │ corresponding function in the maps module.

    The gain in efficiency for the map syntax is more noticeable for the following │ │ │ -operations that can only be achieved using the map syntax:

    • Matching multiple literal keys
    • Updating multiple literal keys
    • Adding multiple literal keys to a map

    For example:

    DO

    Map = Map1#{x := X, y := Y, z := Z}

    DO NOT

    Map2 = maps:update(x, X, Map1),
    │ │ │ -Map3 = maps:update(y, Y, Map2),
    │ │ │ -Map = maps:update(z, Z, Map3)

    If the map is a small map, the first example runs roughly three times as fast.

    Note that for variable keys, the elements are updated sequentially from left to │ │ │ -right. For example, given the following update with variable keys:

    Map = Map1#{Key1 := X, Key2 := Y, Key3 := Z}

    the compiler rewrites it like this to ensure that the updates are applied from │ │ │ -left to right:

    Map2 = Map1#{Key1 := X},
    │ │ │ -Map3 = Map2#{Key2 := Y},
    │ │ │ -Map = Map3#{Key3 := Z}

    If a key is known to exist in a map, using the := operator is slightly more │ │ │ +operations that can only be achieved using the map syntax:

    • Matching multiple literal keys
    • Updating multiple literal keys
    • Adding multiple literal keys to a map

    For example:

    DO

    Map = Map1#{x := X, y := Y, z := Z}

    DO NOT

    Map2 = maps:update(x, X, Map1),
    │ │ │ +Map3 = maps:update(y, Y, Map2),
    │ │ │ +Map = maps:update(z, Z, Map3)

    If the map is a small map, the first example runs roughly three times as fast.

    Note that for variable keys, the elements are updated sequentially from left to │ │ │ +right. For example, given the following update with variable keys:

    Map = Map1#{Key1 := X, Key2 := Y, Key3 := Z}

    the compiler rewrites it like this to ensure that the updates are applied from │ │ │ +left to right:

    Map2 = Map1#{Key1 := X},
    │ │ │ +Map3 = Map2#{Key2 := Y},
    │ │ │ +Map = Map3#{Key3 := Z}

    If a key is known to exist in a map, using the := operator is slightly more │ │ │ efficient than using the => operator for a small map.

    │ │ │ │ │ │ │ │ │ │ │ │ Using the Functions in the maps Module │ │ │

    │ │ │

    Here follows some notes about most of the functions in the maps module. For │ │ │ @@ -306,23 +306,23 @@ │ │ │ │ │ │ │ │ │ │ │ │ maps:get/3 │ │ │ │ │ │

    As an optimization, the compiler will rewrite a call to maps:get/3 to Erlang │ │ │ code similar to the following:

    Result = case Map of
    │ │ │ -             #{Key := Value} -> Value;
    │ │ │ -             #{} -> Default
    │ │ │ +             #{Key := Value} -> Value;
    │ │ │ +             #{} -> Default
    │ │ │           end

    This is reasonably efficient, but if a small map is used as an alternative to │ │ │ using a record it is often better not to rely on default values as it prevents │ │ │ sharing of keys, which may in the end use more memory than what you save from │ │ │ not storing default values in the map.

    If default values are nevertheless required, instead of calling maps:get/3 │ │ │ multiple times, consider putting the default values in a map and merging that │ │ │ -map with the other map:

    DefaultMap = #{Key1 => Value2, Key2 => Value2, ..., KeyN => ValueN},
    │ │ │ -MapWithDefaultsApplied = maps:merge(DefaultMap, OtherMap)

    This helps share keys between the default map and the one you applied defaults │ │ │ +map with the other map:

    DefaultMap = #{Key1 => Value2, Key2 => Value2, ..., KeyN => ValueN},
    │ │ │ +MapWithDefaultsApplied = maps:merge(DefaultMap, OtherMap)

    This helps share keys between the default map and the one you applied defaults │ │ │ to, as long as the default map contains all the keys that will ever be used │ │ │ and not just the ones with default values. Whether this is faster than calling │ │ │ maps:get/3 multiple times depends on the size of the map and the number of │ │ │ default values.

    Change

    Before OTP 26.0 maps:get/3 was implemented by calling the function instead │ │ │ of rewriting it as an Erlang expression. It is now slightly faster but can no │ │ │ longer be traced.

    │ │ │ │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/modules.html │ │ │ @@ -118,20 +118,20 @@ │ │ │

    │ │ │ │ │ │ │ │ │ │ │ │ Module Syntax │ │ │

    │ │ │

    Erlang code is divided into modules. A module consists of a sequence of │ │ │ -attributes and function declarations, each terminated by a period (.).

    Example:

    -module(m).          % module attribute
    │ │ │ --export([fact/1]).   % module attribute
    │ │ │ +attributes and function declarations, each terminated by a period (.).

    Example:

    -module(m).          % module attribute
    │ │ │ +-export([fact/1]).   % module attribute
    │ │ │  
    │ │ │ -fact(N) when N>0 ->  % beginning of function declaration
    │ │ │ -    N * fact(N-1);   %  |
    │ │ │ -fact(0) ->           %  |
    │ │ │ +fact(N) when N>0 ->  % beginning of function declaration
    │ │ │ +    N * fact(N-1);   %  |
    │ │ │ +fact(0) ->           %  |
    │ │ │      1.               % end of function declaration

    For a description of function declarations, see │ │ │ Function Declaration Syntax.

    │ │ │ │ │ │ │ │ │ │ │ │ Module Attributes │ │ │

    │ │ │ @@ -176,71 +176,71 @@ │ │ │ meaning.

    │ │ │ │ │ │ │ │ │ │ │ │ Behaviour Module Attribute │ │ │

    │ │ │

    It is possible to specify that the module is the callback module for a │ │ │ -behaviour:

    -behaviour(Behaviour).

    The atom Behaviour gives the name of the behaviour, which can be a │ │ │ +behaviour:

    -behaviour(Behaviour).

    The atom Behaviour gives the name of the behaviour, which can be a │ │ │ user-defined behaviour or one of the following OTP standard behaviours:

    • gen_server
    • gen_statem
    • gen_event
    • supervisor

    The spelling behavior is also accepted.

    The callback functions of the module can be specified either directly by the │ │ │ -exported function behaviour_info/1:

    behaviour_info(callbacks) -> Callbacks.

    or by a -callback attribute for each callback function:

    -callback Name(Arguments) -> Result.

    Here, Arguments is a list of zero or more arguments. The -callback attribute │ │ │ +exported function behaviour_info/1:

    behaviour_info(callbacks) -> Callbacks.

    or by a -callback attribute for each callback function:

    -callback Name(Arguments) -> Result.

    Here, Arguments is a list of zero or more arguments. The -callback attribute │ │ │ is to be preferred since the extra type information can be used by tools to │ │ │ produce documentation or find discrepancies.

    Read more about behaviours and callback modules in │ │ │ OTP Design Principles.

    │ │ │ │ │ │ │ │ │ │ │ │ Record Definitions │ │ │

    │ │ │ -

    The same syntax as for module attributes is used for record definitions:

    -record(Record, Fields).

    Record definitions are allowed anywhere in a module, also among the function │ │ │ +

    The same syntax as for module attributes is used for record definitions:

    -record(Record, Fields).

    Record definitions are allowed anywhere in a module, also among the function │ │ │ declarations. Read more in Records.

    │ │ │ │ │ │ │ │ │ │ │ │ Preprocessor │ │ │

    │ │ │

    The same syntax as for module attributes is used by the preprocessor, which │ │ │ -supports file inclusion, macros, and conditional compilation:

    -include("SomeFile.hrl").
    │ │ │ --define(Macro, Replacement).

    Read more in Preprocessor.

    │ │ │ +supports file inclusion, macros, and conditional compilation:

    -include("SomeFile.hrl").
    │ │ │ +-define(Macro, Replacement).

    Read more in Preprocessor.

    │ │ │ │ │ │ │ │ │ │ │ │ Setting File and Line │ │ │

    │ │ │

    The same syntax as for module attributes is used for changing the pre-defined │ │ │ -macros ?FILE and ?LINE:

    -file(File, Line).

    This attribute is used by tools, such as Yecc, to inform the compiler that the │ │ │ +macros ?FILE and ?LINE:

    -file(File, Line).

    This attribute is used by tools, such as Yecc, to inform the compiler that the │ │ │ source program is generated by another tool. It also indicates the │ │ │ correspondence of source files to lines of the original user-written file, from │ │ │ which the source program is produced.

    │ │ │ │ │ │ │ │ │ │ │ │ Types and function specifications │ │ │

    │ │ │

    A similar syntax as for module attributes is used for specifying types and │ │ │ -function specifications:

    -type my_type() :: atom() | integer().
    │ │ │ --spec my_function(integer()) -> integer().

    Read more in Types and Function specifications.

    The description is based on │ │ │ +function specifications:

    -type my_type() :: atom() | integer().
    │ │ │ +-spec my_function(integer()) -> integer().

    Read more in Types and Function specifications.

    The description is based on │ │ │ EEP8 - Types and function specifications, │ │ │ which is not to be further updated.

    │ │ │ │ │ │ │ │ │ │ │ │ Documentation attributes │ │ │

    │ │ │

    The module attribute -doc(Documentation) is used to provide user documentation │ │ │ -for a function/type/callback:

    -doc("Example documentation").
    │ │ │ -example() -> ok.

    The attribute should be placed just before the entity it documents.The │ │ │ +for a function/type/callback:

    -doc("Example documentation").
    │ │ │ +example() -> ok.

    The attribute should be placed just before the entity it documents.The │ │ │ parenthesis are optional around Documentation. The allowed values for │ │ │ Documentation are:

    • literal string or │ │ │ utf-8 encoded binary string - The string │ │ │ documenting the entity. Any literal string is allowed, so both │ │ │ triple quoted strings and │ │ │ sigils that translate to literal strings can be used. │ │ │ -The following examples are equivalent:

      -doc("Example \"docs\"").
      │ │ │ --doc(<<"Example \"docs\""/utf8>>).
      │ │ │ +The following examples are equivalent:

      -doc("Example \"docs\"").
      │ │ │ +-doc(<<"Example \"docs\""/utf8>>).
      │ │ │  -doc ~S/Example "docs"/.
      │ │ │  -doc """
      │ │ │     Example "docs"
      │ │ │     """
      │ │ │  -doc ~B|Example "docs"|.

      For clarity it is recommended to use either normal "strings" or triple │ │ │ quoted strings for documentation attributes.

    • {file, file:name/0 } - Read the contents of filename and use │ │ │ that as the documentation string.

    • false - Set the current entity as hidden, that is, it should not be │ │ │ @@ -253,15 +253,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ The feature directive │ │ │

    │ │ │

    While not a module attribute, but rather a directive (since it might affect │ │ │ syntax), there is the -feature(..) directive used for enabling and disabling │ │ │ -features.

    The syntax is similar to that of an attribute, but has two arguments:

    -feature(FeatureName, enable | disable).

    Note that the feature directive can only appear │ │ │ +features.

    The syntax is similar to that of an attribute, but has two arguments:

    -feature(FeatureName, enable | disable).

    Note that the feature directive can only appear │ │ │ in a prefix of the module.

    │ │ │ │ │ │ │ │ │ │ │ │ Comments │ │ │

    │ │ │

    Comments can be placed anywhere in a module except within strings and │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/nif.html │ │ │ @@ -133,26 +133,26 @@ │ │ │ Erlang Program │ │ │ │ │ │

    Even if all functions of a module are NIFs, an Erlang module is still needed for │ │ │ two reasons:

    • The NIF library must be explicitly loaded by Erlang code in the same module.
    • All NIFs of a module must have an Erlang implementation as well.

    Normally these are minimal stub implementations that throw an exception. But │ │ │ they can also be used as fallback implementations for functions that do not have │ │ │ native implementations on some architectures.

    NIF libraries are loaded by calling erlang:load_nif/2, with the name of the │ │ │ shared library as argument. The second argument can be any term that will be │ │ │ -passed on to the library and used for initialization:

    -module(complex6).
    │ │ │ --export([foo/1, bar/1]).
    │ │ │ --nifs([foo/1, bar/1]).
    │ │ │ --on_load(init/0).
    │ │ │ -
    │ │ │ -init() ->
    │ │ │ -    ok = erlang:load_nif("./complex6_nif", 0).
    │ │ │ -
    │ │ │ -foo(_X) ->
    │ │ │ -    erlang:nif_error(nif_library_not_loaded).
    │ │ │ -bar(_Y) ->
    │ │ │ -    erlang:nif_error(nif_library_not_loaded).

    Here, the directive on_load is used to get function init to be automatically │ │ │ +passed on to the library and used for initialization:

    -module(complex6).
    │ │ │ +-export([foo/1, bar/1]).
    │ │ │ +-nifs([foo/1, bar/1]).
    │ │ │ +-on_load(init/0).
    │ │ │ +
    │ │ │ +init() ->
    │ │ │ +    ok = erlang:load_nif("./complex6_nif", 0).
    │ │ │ +
    │ │ │ +foo(_X) ->
    │ │ │ +    erlang:nif_error(nif_library_not_loaded).
    │ │ │ +bar(_Y) ->
    │ │ │ +    erlang:nif_error(nif_library_not_loaded).

    Here, the directive on_load is used to get function init to be automatically │ │ │ called when the module is loaded. If init returns anything other than ok, │ │ │ such when the loading of the NIF library fails in this example, the module is │ │ │ unloaded and calls to functions within it, fail.

    Loading the NIF library overrides the stub implementations and cause calls to │ │ │ foo and bar to be dispatched to the NIF implementations instead.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -209,23 +209,23 @@ │ │ │ │ │ │ │ │ │ │ │ │ Running the Example │ │ │

    │ │ │

    Step 1. Compile the C code:

    unix> gcc -o complex6_nif.so -fpic -shared complex.c complex6_nif.c
    │ │ │  windows> cl -LD -MD -Fe complex6_nif.dll complex.c complex6_nif.c

    Step 2: Start Erlang and compile the Erlang code:

    > erl
    │ │ │ -Erlang R13B04 (erts-5.7.5) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
    │ │ │ +Erlang R13B04 (erts-5.7.5) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
    │ │ │  
    │ │ │ -Eshell V5.7.5  (abort with ^G)
    │ │ │ -1> c(complex6).
    │ │ │ -{ok,complex6}

    Step 3: Run the example:

    3> complex6:foo(3).
    │ │ │ +Eshell V5.7.5  (abort with ^G)
    │ │ │ +1> c(complex6).
    │ │ │ +{ok,complex6}

    Step 3: Run the example:

    3> complex6:foo(3).
    │ │ │  4
    │ │ │ -4> complex6:bar(5).
    │ │ │ +4> complex6:bar(5).
    │ │ │  10
    │ │ │ -5> complex6:foo("not an integer").
    │ │ │ +5> complex6:foo("not an integer").
    │ │ │  ** exception error: bad argument
    │ │ │       in function  complex6:foo/1
    │ │ │          called as comlpex6:foo("not an integer")
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/opaques.html │ │ │ @@ -122,24 +122,24 @@ │ │ │ Opaque Type Aliases │ │ │ │ │ │

    The main use case for opacity in Erlang is to hide the implementation of a data │ │ │ type, enabling evolving the API while minimizing the risk of breaking consumers. │ │ │ The runtime does not check opacity. Dialyzer provides some opacity-checking, but │ │ │ the rest is up to convention.

    This document explains what Erlang opacity is (and the trade-offs involved) via │ │ │ the example of the sets:set() data type. This type was │ │ │ -defined in the sets module like this:

    -opaque set(Element) :: #set{segs :: segs(Element)}.

    OTP 24 changed the definition to the following in │ │ │ -this commit.

    -opaque set(Element) :: #set{segs :: segs(Element)} | #{Element => ?VALUE}.

    And this change was safer and more backwards-compatible than if the type had │ │ │ +defined in the sets module like this:

    -opaque set(Element) :: #set{segs :: segs(Element)}.

    OTP 24 changed the definition to the following in │ │ │ +this commit.

    -opaque set(Element) :: #set{segs :: segs(Element)} | #{Element => ?VALUE}.

    And this change was safer and more backwards-compatible than if the type had │ │ │ been defined with -type instead of -opaque. Here is why: when a module │ │ │ defines an -opaque, the contract is that only the defining module should rely │ │ │ on the definition of the type: no other modules should rely on the definition.

    This means that code that pattern-matched on set as a record/tuple technically │ │ │ broke the contract, and opted in to being potentially broken when the definition │ │ │ of set() changed. Before OTP 24, this code printed ok. In OTP 24 it may │ │ │ -error:

    case sets:new() of
    │ │ │ -    Set when is_tuple(Set) ->
    │ │ │ -        io:format("ok")
    │ │ │ +error:

    case sets:new() of
    │ │ │ +    Set when is_tuple(Set) ->
    │ │ │ +        io:format("ok")
    │ │ │  end.

    When working with an opaque defined in another module, here are some │ │ │ recommendations:

    • Don't examine the underlying type using pattern-matching, guards, or functions │ │ │ that reveal the type, such as tuple_size/1 .
    • Instead, use functions provided by the module for working with the type. For │ │ │ example, sets module provides sets:new/0, sets:add_element/2, │ │ │ sets:is_element/2, and so on.
    • sets:set(a) is a subtype of sets:set(a | b) and not the │ │ │ other way around. Generally, you can rely on the property that the_opaque(T) │ │ │ is a subtype of the_opaque(U) when T is a subtype of U.

    When defining your own opaques, here are some recommendations:

    • Since consumers are expected to not rely on the definition of the opaque type, │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/otp-patch-apply.html │ │ │ @@ -201,15 +201,15 @@ │ │ │ │ │ │ Sanity check │ │ │ │ │ │

      The application dependencies can be checked using the Erlang shell. │ │ │ Application dependencies are verified among installed applications by │ │ │ otp_patch_apply, but these are not necessarily those actually loaded. │ │ │ By calling system_information:sanity_check() one can validate │ │ │ -dependencies among applications actually loaded.

      1> system_information:sanity_check().
      │ │ │ +dependencies among applications actually loaded.

      1> system_information:sanity_check().
      │ │ │  ok

      Please take a look at the reference of sanity_check() for more │ │ │ information.

      │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/patterns.html │ │ │ @@ -128,18 +128,18 @@ │ │ │ succeeds, any unbound variables in the pattern become bound. If the matching │ │ │ fails, an exception is raised.

    Examples:

    1> X.
    │ │ │  ** 1:1: variable 'X' is unbound **
    │ │ │  2> X = 2.
    │ │ │  2
    │ │ │  3> X + 1.
    │ │ │  3
    │ │ │ -4> {X, Y} = {1, 2}.
    │ │ │ +4> {X, Y} = {1, 2}.
    │ │ │  ** exception error: no match of right hand side value {1,2}
    │ │ │ -5> {X, Y} = {2, 3}.
    │ │ │ -{2,3}
    │ │ │ +5> {X, Y} = {2, 3}.
    │ │ │ +{2,3}
    │ │ │  6> Y.
    │ │ │  3
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/prog_ex_records.html │ │ │ @@ -122,105 +122,105 @@ │ │ │ Records and Tuples │ │ │ │ │ │

    The main advantage of using records rather than tuples is that fields in a │ │ │ record are accessed by name, whereas fields in a tuple are accessed by position. │ │ │ To illustrate these differences, suppose that you want to represent a person │ │ │ with the tuple {Name, Address, Phone}.

    To write functions that manipulate this data, remember the following:

    • The Name field is the first element of the tuple.
    • The Address field is the second element.
    • The Phone field is the third element.

    For example, to extract data from a variable P that contains such a tuple, you │ │ │ can write the following code and then use pattern matching to extract the │ │ │ -relevant fields:

    Name = element(1, P),
    │ │ │ -Address = element(2, P),
    │ │ │ +relevant fields:

    Name = element(1, P),
    │ │ │ +Address = element(2, P),
    │ │ │  ...

    Such code is difficult to read and understand, and errors occur if the numbering │ │ │ of the elements in the tuple is wrong. If the data representation of the fields │ │ │ is changed, by re-ordering, adding, or removing fields, all references to the │ │ │ person tuple must be checked and possibly modified.

    Records allow references to the fields by name, instead of by position. In the │ │ │ -following example, a record instead of a tuple is used to store the data:

    -record(person, {name, phone, address}).

    This enables references to the fields of the record by name. For example, if P │ │ │ +following example, a record instead of a tuple is used to store the data:

    -record(person, {name, phone, address}).

    This enables references to the fields of the record by name. For example, if P │ │ │ is a variable whose value is a person record, the following code access the │ │ │ name and address fields of the records:

    Name = P#person.name,
    │ │ │  Address = P#person.address,
    │ │ │ -...

    Internally, records are represented using tagged tuples:

    {person, Name, Phone, Address}

    │ │ │ +...

    Internally, records are represented using tagged tuples:

    {person, Name, Phone, Address}

    │ │ │ │ │ │ │ │ │ │ │ │ Defining a Record │ │ │

    │ │ │

    This following definition of a person is used in several examples in this │ │ │ section. Three fields are included, name, phone, and address. The default │ │ │ values for name and phone is "" and [], respectively. The default value for │ │ │ address is the atom undefined, since no default value is supplied for this │ │ │ -field:

    -record(person, {name = "", phone = [], address}).

    The record must be defined in the shell to enable use of the record syntax in │ │ │ -the examples:

    > rd(person, {name = "", phone = [], address}).
    │ │ │ +field:

    -record(person, {name = "", phone = [], address}).

    The record must be defined in the shell to enable use of the record syntax in │ │ │ +the examples:

    > rd(person, {name = "", phone = [], address}).
    │ │ │  person

    This is because record definitions are only available at compile time, not at │ │ │ runtime. For details on records in the shell, see the shell manual page in │ │ │ STDLIB.

    │ │ │ │ │ │ │ │ │ │ │ │ Creating a Record │ │ │

    │ │ │ -

    A new person record is created as follows:

    > #person{phone=[0,8,2,3,4,3,1,2], name="Robert"}.
    │ │ │ -#person{name = "Robert",phone = [0,8,2,3,4,3,1,2],address = undefined}

    As the address field was omitted, its default value is used.

    From Erlang 5.1/OTP R8B, a value to all fields in a record can be set with the │ │ │ -special field _. _ means "all fields not explicitly specified".

    Example:

    > #person{name = "Jakob", _ = '_'}.
    │ │ │ -#person{name = "Jakob",phone = '_',address = '_'}

    It is primarily intended to be used in ets:match/2 and │ │ │ +

    A new person record is created as follows:

    > #person{phone=[0,8,2,3,4,3,1,2], name="Robert"}.
    │ │ │ +#person{name = "Robert",phone = [0,8,2,3,4,3,1,2],address = undefined}

    As the address field was omitted, its default value is used.

    From Erlang 5.1/OTP R8B, a value to all fields in a record can be set with the │ │ │ +special field _. _ means "all fields not explicitly specified".

    Example:

    > #person{name = "Jakob", _ = '_'}.
    │ │ │ +#person{name = "Jakob",phone = '_',address = '_'}

    It is primarily intended to be used in ets:match/2 and │ │ │ mnesia:match_object/3, to set record fields to the atom '_'. (This is a │ │ │ wildcard in ets:match/2.)

    │ │ │ │ │ │ │ │ │ │ │ │ Accessing a Record Field │ │ │

    │ │ │ -

    The following example shows how to access a record field:

    > P = #person{name = "Joe", phone = [0,8,2,3,4,3,1,2]}.
    │ │ │ -#person{name = "Joe",phone = [0,8,2,3,4,3,1,2],address = undefined}
    │ │ │ +

    The following example shows how to access a record field:

    > P = #person{name = "Joe", phone = [0,8,2,3,4,3,1,2]}.
    │ │ │ +#person{name = "Joe",phone = [0,8,2,3,4,3,1,2],address = undefined}
    │ │ │  > P#person.name.
    │ │ │  "Joe"

    │ │ │ │ │ │ │ │ │ │ │ │ Updating a Record │ │ │

    │ │ │ -

    The following example shows how to update a record:

    > P1 = #person{name="Joe", phone=[1,2,3], address="A street"}.
    │ │ │ -#person{name = "Joe",phone = [1,2,3],address = "A street"}
    │ │ │ -> P2 = P1#person{name="Robert"}.
    │ │ │ -#person{name = "Robert",phone = [1,2,3],address = "A street"}

    │ │ │ +

    The following example shows how to update a record:

    > P1 = #person{name="Joe", phone=[1,2,3], address="A street"}.
    │ │ │ +#person{name = "Joe",phone = [1,2,3],address = "A street"}
    │ │ │ +> P2 = P1#person{name="Robert"}.
    │ │ │ +#person{name = "Robert",phone = [1,2,3],address = "A street"}

    │ │ │ │ │ │ │ │ │ │ │ │ Type Testing │ │ │

    │ │ │

    The following example shows that the guard succeeds if P is record of type │ │ │ -person:

    foo(P) when is_record(P, person) -> a_person;
    │ │ │ -foo(_) -> not_a_person.

    │ │ │ +person:

    foo(P) when is_record(P, person) -> a_person;
    │ │ │ +foo(_) -> not_a_person.

    │ │ │ │ │ │ │ │ │ │ │ │ Pattern Matching │ │ │

    │ │ │

    Matching can be used in combination with records, as shown in the following │ │ │ -example:

    > P3 = #person{name="Joe", phone=[0,0,7], address="A street"}.
    │ │ │ -#person{name = "Joe",phone = [0,0,7],address = "A street"}
    │ │ │ -> #person{name = Name} = P3, Name.
    │ │ │ +example:

    > P3 = #person{name="Joe", phone=[0,0,7], address="A street"}.
    │ │ │ +#person{name = "Joe",phone = [0,0,7],address = "A street"}
    │ │ │ +> #person{name = Name} = P3, Name.
    │ │ │  "Joe"

    The following function takes a list of person records and searches for the │ │ │ -phone number of a person with a particular name:

    find_phone([#person{name=Name, phone=Phone} | _], Name) ->
    │ │ │ -    {found,  Phone};
    │ │ │ -find_phone([_| T], Name) ->
    │ │ │ -    find_phone(T, Name);
    │ │ │ -find_phone([], Name) ->
    │ │ │ +phone number of a person with a particular name:

    find_phone([#person{name=Name, phone=Phone} | _], Name) ->
    │ │ │ +    {found,  Phone};
    │ │ │ +find_phone([_| T], Name) ->
    │ │ │ +    find_phone(T, Name);
    │ │ │ +find_phone([], Name) ->
    │ │ │      not_found.

    The fields referred to in the pattern can be given in any order.

    │ │ │ │ │ │ │ │ │ │ │ │ Nested Records │ │ │

    │ │ │

    The value of a field in a record can be an instance of a record. Retrieval of │ │ │ nested data can be done stepwise, or in a single step, as shown in the following │ │ │ -example:

    -record(name, {first = "Robert", last = "Ericsson"}).
    │ │ │ --record(person, {name = #name{}, phone}).
    │ │ │ +example:

    -record(name, {first = "Robert", last = "Ericsson"}).
    │ │ │ +-record(person, {name = #name{}, phone}).
    │ │ │  
    │ │ │ -demo() ->
    │ │ │ -  P = #person{name= #name{first="Robert",last="Virding"}, phone=123},
    │ │ │ -  First = (P#person.name)#name.first.

    Here, demo() evaluates to "Robert".

    │ │ │ +demo() -> │ │ │ + P = #person{name= #name{first="Robert",last="Virding"}, phone=123}, │ │ │ + First = (P#person.name)#name.first.

    Here, demo() evaluates to "Robert".

    │ │ │ │ │ │ │ │ │ │ │ │ A Longer Example │ │ │

    │ │ │

    Comments are embedded in the following example:

    %% File: person.hrl
    │ │ │  
    │ │ │ @@ -230,48 +230,48 @@
    │ │ │  %%    name:  A string (default is undefined).
    │ │ │  %%    age:   An integer (default is undefined).
    │ │ │  %%    phone: A list of integers (default is []).
    │ │ │  %%    dict:  A dictionary containing various information
    │ │ │  %%           about the person.
    │ │ │  %%           A {Key, Value} list (default is the empty list).
    │ │ │  %%------------------------------------------------------------
    │ │ │ --record(person, {name, age, phone = [], dict = []}).
    -module(person).
    │ │ │ --include("person.hrl").
    │ │ │ --compile(export_all). % For test purposes only.
    │ │ │ +-record(person, {name, age, phone = [], dict = []}).
    -module(person).
    │ │ │ +-include("person.hrl").
    │ │ │ +-compile(export_all). % For test purposes only.
    │ │ │  
    │ │ │  %% This creates an instance of a person.
    │ │ │  %%   Note: The phone number is not supplied so the
    │ │ │  %%         default value [] will be used.
    │ │ │  
    │ │ │ -make_hacker_without_phone(Name, Age) ->
    │ │ │ -   #person{name = Name, age = Age,
    │ │ │ -           dict = [{computer_knowledge, excellent},
    │ │ │ -                   {drinks, coke}]}.
    │ │ │ +make_hacker_without_phone(Name, Age) ->
    │ │ │ +   #person{name = Name, age = Age,
    │ │ │ +           dict = [{computer_knowledge, excellent},
    │ │ │ +                   {drinks, coke}]}.
    │ │ │  
    │ │ │  %% This demonstrates matching in arguments
    │ │ │  
    │ │ │ -print(#person{name = Name, age = Age,
    │ │ │ -              phone = Phone, dict = Dict}) ->
    │ │ │ -  io:format("Name: ~s, Age: ~w, Phone: ~w ~n"
    │ │ │ -            "Dictionary: ~w.~n", [Name, Age, Phone, Dict]).
    │ │ │ +print(#person{name = Name, age = Age,
    │ │ │ +              phone = Phone, dict = Dict}) ->
    │ │ │ +  io:format("Name: ~s, Age: ~w, Phone: ~w ~n"
    │ │ │ +            "Dictionary: ~w.~n", [Name, Age, Phone, Dict]).
    │ │ │  
    │ │ │  %% Demonstrates type testing, selector, updating.
    │ │ │  
    │ │ │ -birthday(P) when is_record(P, person) ->
    │ │ │ -   P#person{age = P#person.age + 1}.
    │ │ │ +birthday(P) when is_record(P, person) ->
    │ │ │ +   P#person{age = P#person.age + 1}.
    │ │ │  
    │ │ │ -register_two_hackers() ->
    │ │ │ -   Hacker1 = make_hacker_without_phone("Joe", 29),
    │ │ │ -   OldHacker = birthday(Hacker1),
    │ │ │ +register_two_hackers() ->
    │ │ │ +   Hacker1 = make_hacker_without_phone("Joe", 29),
    │ │ │ +   OldHacker = birthday(Hacker1),
    │ │ │     % The central_register_server should have
    │ │ │     % an interface function for this.
    │ │ │ -   central_register_server ! {register_person, Hacker1},
    │ │ │ -   central_register_server ! {register_person,
    │ │ │ -             OldHacker#person{name = "Robert",
    │ │ │ -                              phone = [0,8,3,2,4,5,3,1]}}.
    │ │ │ +
    central_register_server ! {register_person, Hacker1}, │ │ │ + central_register_server ! {register_person, │ │ │ + OldHacker#person{name = "Robert", │ │ │ + phone = [0,8,3,2,4,5,3,1]}}.
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │

    │ │ │ │ │ │ │ │ │ Header Files │ │ │

    │ │ │

    As shown above, some files have extension .hrl. These are header files that │ │ │ -are included in the .erl files by:

    -include("File_Name").

    for example:

    -include("mess_interface.hrl").

    In the case above the file is fetched from the same directory as all the other │ │ │ +are included in the .erl files by:

    -include("File_Name").

    for example:

    -include("mess_interface.hrl").

    In the case above the file is fetched from the same directory as all the other │ │ │ files in the messenger example. (manual).

    .hrl files can contain any valid Erlang code but are most often used for record │ │ │ and macro definitions.

    │ │ │ │ │ │ │ │ │ │ │ │ Records │ │ │

    │ │ │ -

    A record is defined as:

    -record(name_of_record,{field_name1, field_name2, field_name3, ......}).

    For example:

    -record(message_to,{to_name, message}).

    This is equivalent to:

    {message_to, To_Name, Message}

    Creating a record is best illustrated by an example:

    #message_to{message="hello", to_name=fred)

    This creates:

    {message_to, fred, "hello"}

    Notice that you do not have to worry about the order you assign values to the │ │ │ +

    A record is defined as:

    -record(name_of_record,{field_name1, field_name2, field_name3, ......}).

    For example:

    -record(message_to,{to_name, message}).

    This is equivalent to:

    {message_to, To_Name, Message}

    Creating a record is best illustrated by an example:

    #message_to{message="hello", to_name=fred)

    This creates:

    {message_to, fred, "hello"}

    Notice that you do not have to worry about the order you assign values to the │ │ │ various parts of the records when you create it. The advantage of using records │ │ │ is that by placing their definitions in header files you can conveniently define │ │ │ interfaces that are easy to change. For example, if you want to add a new field │ │ │ to the record, you only have to change the code where the new field is used and │ │ │ not at every place the record is referred to. If you leave out a field when │ │ │ creating a record, it gets the value of the atom undefined. (manual)

    Pattern matching with records is very similar to creating records. For example, │ │ │ -inside a case or receive:

    #message_to{to_name=ToName, message=Message} ->

    This is the same as:

    {message_to, ToName, Message}

    │ │ │ +inside a case or receive:

    #message_to{to_name=ToName, message=Message} ->

    This is the same as:

    {message_to, ToName, Message}

    │ │ │ │ │ │ │ │ │ │ │ │ Macros │ │ │

    │ │ │

    Another thing that has been added to the messenger is a macro. The file │ │ │ mess_config.hrl contains the definition:

    %%% Configure the location of the server node,
    │ │ │ --define(server_node, messenger@super).

    This file is included in mess_server.erl:

    -include("mess_config.hrl").

    Every occurrence of ?server_node in mess_server.erl is now replaced by │ │ │ -messenger@super.

    A macro is also used when spawning the server process:

    spawn(?MODULE, server, [])

    This is a standard macro (that is, defined by the system, not by the user). │ │ │ +-define(server_node, messenger@super).

    This file is included in mess_server.erl:

    -include("mess_config.hrl").

    Every occurrence of ?server_node in mess_server.erl is now replaced by │ │ │ +messenger@super.

    A macro is also used when spawning the server process:

    spawn(?MODULE, server, [])

    This is a standard macro (that is, defined by the system, not by the user). │ │ │ ?MODULE is always replaced by the name of the current module (that is, the │ │ │ -module definition near the start of the file). There are more advanced ways │ │ │ of using macros with, for example, parameters.

    The three Erlang (.erl) files in the messenger example are individually │ │ │ compiled into object code file (.beam). The Erlang system loads and links │ │ │ these files into the system when they are referred to during execution of the │ │ │ code. In this case, they are simply put in our current working directory (that │ │ │ is, the place you have done "cd" to). There are ways of putting the .beam │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/ref_man_functions.html │ │ │ @@ -120,51 +120,51 @@ │ │ │ │ │ │ │ │ │ Function Declaration Syntax │ │ │ │ │ │

    A function declaration is a sequence of function clauses separated by │ │ │ semicolons, and terminated by a period (.).

    A function clause consists of a clause head and a clause body, separated by │ │ │ ->.

    A clause head consists of the function name, an argument list, and an optional │ │ │ -guard sequence beginning with the keyword when:

    Name(Pattern11,...,Pattern1N) [when GuardSeq1] ->
    │ │ │ +guard sequence beginning with the keyword when:

    Name(Pattern11,...,Pattern1N) [when GuardSeq1] ->
    │ │ │      Body1;
    │ │ │  ...;
    │ │ │ -Name(PatternK1,...,PatternKN) [when GuardSeqK] ->
    │ │ │ +Name(PatternK1,...,PatternKN) [when GuardSeqK] ->
    │ │ │      BodyK.

    The function name is an atom. Each argument is a pattern.

    The number of arguments N is the arity of the function. A function is │ │ │ uniquely defined by the module name, function name, and arity. That is, two │ │ │ functions with the same name and in the same module, but with different arities │ │ │ are two different functions.

    A function named f in module mod and with arity N is often denoted as │ │ │ mod:f/N.

    A clause body consists of a sequence of expressions separated by comma (,):

    Expr1,
    │ │ │  ...,
    │ │ │  ExprN

    Valid Erlang expressions and guard sequences are described in │ │ │ -Expressions.

    Example:

    fact(N) when N > 0 ->  % first clause head
    │ │ │ -    N * fact(N-1);     % first clause body
    │ │ │ +Expressions.

    Example:

    fact(N) when N > 0 ->  % first clause head
    │ │ │ +    N * fact(N-1);     % first clause body
    │ │ │  
    │ │ │ -fact(0) ->             % second clause head
    │ │ │ +fact(0) ->             % second clause head
    │ │ │      1.                 % second clause body

    │ │ │ │ │ │ │ │ │ │ │ │ Function Evaluation │ │ │

    │ │ │

    When a function M:F/N is called, first the code for the function is located. │ │ │ If the function cannot be found, an undef runtime error occurs. Notice that │ │ │ the function must be exported to be visible outside the module it is defined in.

    If the function is found, the function clauses are scanned sequentially until a │ │ │ clause is found that fulfills both of the following two conditions:

    1. The patterns in the clause head can be successfully matched against the given │ │ │ arguments.
    2. The guard sequence, if any, is true.

    If such a clause cannot be found, a function_clause runtime error occurs.

    If such a clause is found, the corresponding clause body is evaluated. That is, │ │ │ the expressions in the body are evaluated sequentially and the value of the last │ │ │ -expression is returned.

    Consider the function fact:

    -module(mod).
    │ │ │ --export([fact/1]).
    │ │ │ +expression is returned.

    Consider the function fact:

    -module(mod).
    │ │ │ +-export([fact/1]).
    │ │ │  
    │ │ │ -fact(N) when N > 0 ->
    │ │ │ -    N * fact(N - 1);
    │ │ │ -fact(0) ->
    │ │ │ +fact(N) when N > 0 ->
    │ │ │ +    N * fact(N - 1);
    │ │ │ +fact(0) ->
    │ │ │      1.

    Assume that you want to calculate the factorial for 1:

    1> mod:fact(1).

    Evaluation starts at the first clause. The pattern N is matched against │ │ │ argument 1. The matching succeeds and the guard (N > 0) is true, thus N is │ │ │ -bound to 1, and the corresponding body is evaluated:

    N * fact(N-1) => (N is bound to 1)
    │ │ │ -1 * fact(0)

    Now, fact(0) is called, and the function clauses are scanned │ │ │ +bound to 1, and the corresponding body is evaluated:

    N * fact(N-1) => (N is bound to 1)
    │ │ │ +1 * fact(0)

    Now, fact(0) is called, and the function clauses are scanned │ │ │ sequentially again. First, the pattern N is matched against 0. The │ │ │ matching succeeds, but the guard (N > 0) is false. Second, the │ │ │ pattern 0 is matched against the argument 0. The matching succeeds │ │ │ and the body is evaluated:

    1 * fact(0) =>
    │ │ │  1 * 1 =>
    │ │ │  1

    Evaluation has succeed and mod:fact(1) returns 1.

    If mod:fact/1 is called with a negative number as argument, no clause head │ │ │ matches. A function_clause runtime error occurs.

    │ │ │ @@ -173,17 +173,17 @@ │ │ │ │ │ │ Tail recursion │ │ │

    │ │ │

    If the last expression of a function body is a function call, a │ │ │ tail-recursive call is done. This is to ensure that no system │ │ │ resources, for example, call stack, are consumed. This means that an │ │ │ infinite loop using tail-recursive calls will not exhaust the call │ │ │ -stack and can (in principle) run forever.

    Example:

    loop(N) ->
    │ │ │ -    io:format("~w~n", [N]),
    │ │ │ -    loop(N+1).

    The earlier factorial example is a counter-example. It is not │ │ │ +stack and can (in principle) run forever.

    Example:

    loop(N) ->
    │ │ │ +    io:format("~w~n", [N]),
    │ │ │ +    loop(N+1).

    The earlier factorial example is a counter-example. It is not │ │ │ tail-recursive, since a multiplication is done on the result of the recursive │ │ │ call to fact(N-1).

    │ │ │ │ │ │ │ │ │ │ │ │ Built-In Functions (BIFs) │ │ │

    │ │ │ @@ -191,17 +191,17 @@ │ │ │ system. BIFs do things that are difficult or impossible to implement │ │ │ in Erlang. Most of the BIFs belong to module erlang, but there │ │ │ are also BIFs belonging to a few other modules, for example lists │ │ │ and ets.

    The most commonly used BIFs belonging to erlang are auto-imported. They do │ │ │ not need to be prefixed with the module name. Which BIFs that are auto-imported │ │ │ is specified in the erlang module in ERTS. For example, standard-type │ │ │ conversion BIFs like atom_to_list and BIFs allowed in guards can be called │ │ │ -without specifying the module name.

    Examples:

    1> tuple_size({a,b,c}).
    │ │ │ +without specifying the module name.

    Examples:

    1> tuple_size({a,b,c}).
    │ │ │  3
    │ │ │ -2> atom_to_list('Erlang').
    │ │ │ +2> atom_to_list('Erlang').
    │ │ │  "Erlang"
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │

    │ │ │ │ │ │ │ │ │ Process Creation │ │ │

    │ │ │ -

    A process is created by calling spawn():

    spawn(Module, Name, Args) -> pid()
    │ │ │ -  Module = Name = atom()
    │ │ │ -  Args = [Arg1,...,ArgN]
    │ │ │ -    ArgI = term()

    spawn() creates a new process and returns the pid.

    The new process starts executing in Module:Name(Arg1,...,ArgN) where the │ │ │ +

    A process is created by calling spawn():

    spawn(Module, Name, Args) -> pid()
    │ │ │ +  Module = Name = atom()
    │ │ │ +  Args = [Arg1,...,ArgN]
    │ │ │ +    ArgI = term()

    spawn() creates a new process and returns the pid.

    The new process starts executing in Module:Name(Arg1,...,ArgN) where the │ │ │ arguments are the elements of the (possible empty) Args argument list.

    There exist a number of different spawn BIFs:

    │ │ │ │ │ │ │ │ │ │ │ │ Registered Processes │ │ │

    │ │ │

    Besides addressing a process by using its pid, there are also BIFs for │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/ref_man_records.html │ │ │ @@ -123,17 +123,17 @@ │ │ │ │ │ │ │ │ │ Defining Records │ │ │ │ │ │

    A record definition consists of the name of the record, followed by the field │ │ │ names of the record. Record and field names must be atoms. Each field can be │ │ │ given an optional default value. If no default value is supplied, undefined is │ │ │ -used.

    -record(Name, {Field1 [= Expr1],
    │ │ │ +used.

    -record(Name, {Field1 [= Expr1],
    │ │ │                 ...
    │ │ │ -               FieldN [= ExprN]}).

    The default value for a field is an arbitrary expression, except that it must │ │ │ + FieldN [= ExprN]}).

    The default value for a field is an arbitrary expression, except that it must │ │ │ not use any variables.

    A record definition can be placed anywhere among the attributes and function │ │ │ declarations of a module, but the definition must come before any usage of the │ │ │ record.

    If a record is used in several modules, it is recommended that the record │ │ │ definition is placed in an include file.

    Change

    Starting from Erlang/OTP 26, records can be defined in the Erlang shell │ │ │ using the syntax described in this section. In earlier releases, it was │ │ │ necessary to use the shell built-in function rd/2.

    │ │ │ │ │ │ @@ -143,32 +143,32 @@ │ │ │

    │ │ │

    The following expression creates a new Name record where the value of each │ │ │ field FieldI is the value of evaluating the corresponding expression ExprI:

    #Name{Field1=Expr1, ..., FieldK=ExprK}

    The fields can be in any order, not necessarily the same order as in the record │ │ │ definition, and fields can be omitted. Omitted fields get their respective │ │ │ default value instead.

    If several fields are to be assigned the same value, the following construction │ │ │ can be used:

    #Name{Field1=Expr1, ..., FieldK=ExprK, _=ExprL}

    Omitted fields then get the value of evaluating ExprL instead of their default │ │ │ values. This feature is primarily intended to be used to create patterns for ETS │ │ │ -and Mnesia match functions.

    Example:

    -record(person, {name, phone, address}).
    │ │ │ +and Mnesia match functions.

    Example:

    -record(person, {name, phone, address}).
    │ │ │  
    │ │ │ -lookup(Name, Tab) ->
    │ │ │ -    ets:match_object(Tab, #person{name=Name, _='_'}).

    │ │ │ +lookup(Name, Tab) -> │ │ │ + ets:match_object(Tab, #person{name=Name, _='_'}).

    │ │ │ │ │ │ │ │ │ │ │ │ Accessing Record Fields │ │ │

    │ │ │
    Expr#Name.Field

    Returns the value of the specified field. Expr is to evaluate to a Name │ │ │ -record.

    Example:

    -record(person, {name, phone, address}).
    │ │ │ +record.

    Example:

    -record(person, {name, phone, address}).
    │ │ │  
    │ │ │ -get_person_name(Person) ->
    │ │ │ +get_person_name(Person) ->
    │ │ │      Person#person.name.

    The following expression returns the position of the specified field in the │ │ │ -tuple representation of the record:

    #Name.Field

    Example:

    -record(person, {name, phone, address}).
    │ │ │ +tuple representation of the record:

    #Name.Field

    Example:

    -record(person, {name, phone, address}).
    │ │ │  
    │ │ │ -lookup(Name, List) ->
    │ │ │ -    lists:keyfind(Name, #person.name, List).

    │ │ │ +lookup(Name, List) -> │ │ │ + lists:keyfind(Name, #person.name, List).

    │ │ │ │ │ │ │ │ │ │ │ │ Updating Records │ │ │

    │ │ │
    Expr#Name{Field1=Expr1, ..., FieldK=ExprK}

    Expr is to evaluate to a Name record. A copy of this record is returned, │ │ │ with the value of each specified field FieldI changed to the value of │ │ │ @@ -178,51 +178,51 @@ │ │ │ │ │ │ │ │ │ Records in Guards │ │ │ │ │ │

    Since record expressions are expanded to tuple expressions, creating │ │ │ records and accessing record fields are allowed in guards. However, │ │ │ all subexpressions (for initializing fields), must be valid guard │ │ │ -expressions as well.

    Examples:

    handle(Msg, State) when Msg =:= #msg{to=void, no=3} ->
    │ │ │ +expressions as well.

    Examples:

    handle(Msg, State) when Msg =:= #msg{to=void, no=3} ->
    │ │ │      ...
    │ │ │  
    │ │ │ -handle(Msg, State) when State#state.running =:= true ->
    │ │ │ -    ...

    There is also a type test BIF is_record(Term, RecordTag).

    Example:

    is_person(P) when is_record(P, person) ->
    │ │ │ +handle(Msg, State) when State#state.running =:= true ->
    │ │ │ +    ...

    There is also a type test BIF is_record(Term, RecordTag).

    Example:

    is_person(P) when is_record(P, person) ->
    │ │ │      true;
    │ │ │ -is_person(_P) ->
    │ │ │ +is_person(_P) ->
    │ │ │      false.

    │ │ │ │ │ │ │ │ │ │ │ │ Records in Patterns │ │ │

    │ │ │

    A pattern that matches a certain record is created in the same way as a record │ │ │ is created:

    #Name{Field1=Expr1, ..., FieldK=ExprK}

    In this case, one or more of Expr1 ... ExprK can be unbound variables.

    │ │ │ │ │ │ │ │ │ │ │ │ Nested Records │ │ │

    │ │ │ -

    Assume the following record definitions:

    -record(nrec0, {name = "nested0"}).
    │ │ │ --record(nrec1, {name = "nested1", nrec0=#nrec0{}}).
    │ │ │ --record(nrec2, {name = "nested2", nrec1=#nrec1{}}).
    │ │ │ +

    Assume the following record definitions:

    -record(nrec0, {name = "nested0"}).
    │ │ │ +-record(nrec1, {name = "nested1", nrec0=#nrec0{}}).
    │ │ │ +-record(nrec2, {name = "nested2", nrec1=#nrec1{}}).
    │ │ │  
    │ │ │ -N2 = #nrec2{},

    Accessing or updating nested records can be written without parentheses:

    "nested0" = N2#nrec2.nrec1#nrec1.nrec0#nrec0.name,
    │ │ │ +N2 = #nrec2{},

    Accessing or updating nested records can be written without parentheses:

    "nested0" = N2#nrec2.nrec1#nrec1.nrec0#nrec0.name,
    │ │ │      N0n = N2#nrec2.nrec1#nrec1.nrec0#nrec0{name = "nested0a"},

    which is equivalent to:

    "nested0" = ((N2#nrec2.nrec1)#nrec1.nrec0)#nrec0.name,
    │ │ │  N0n = ((N2#nrec2.nrec1)#nrec1.nrec0)#nrec0{name = "nested0a"},

    Change

    Before Erlang/OTP R14, parentheses were necessary when accessing or updating │ │ │ nested records.

    │ │ │ │ │ │ │ │ │ │ │ │ Internal Representation of Records │ │ │

    │ │ │

    Record expressions are translated to tuple expressions during compilation. A │ │ │ -record defined as:

    -record(Name, {Field1, ..., FieldN}).

    is internally represented by the tuple:

    {Name, Value1, ..., ValueN}

    Here each ValueI is the default value for FieldI.

    To each module using records, a pseudo function is added during compilation to │ │ │ -obtain information about records:

    record_info(fields, Record) -> [Field]
    │ │ │ -record_info(size, Record) -> Size

    Size is the size of the tuple representation, that is, one more than the │ │ │ +record defined as:

    -record(Name, {Field1, ..., FieldN}).

    is internally represented by the tuple:

    {Name, Value1, ..., ValueN}

    Here each ValueI is the default value for FieldI.

    To each module using records, a pseudo function is added during compilation to │ │ │ +obtain information about records:

    record_info(fields, Record) -> [Field]
    │ │ │ +record_info(size, Record) -> Size

    Size is the size of the tuple representation, that is, one more than the │ │ │ number of fields.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │

    gen_server, simple code replacement is not sufficient. │ │ │ Instead, it is necessary to:

    • Suspend the processes using the module (to avoid that they try to handle any │ │ │ requests before the code replacement is completed).
    • Ask them to transform the internal state format and switch to the new version │ │ │ of the module.
    • Remove the old version.
    • Resume the processes.

    This is called synchronized code replacement and for this the following │ │ │ -instructions are used:

    {update, Module, {advanced, Extra}}
    │ │ │ -{update, Module, supervisor}

    update with argument {advanced,Extra} is used when changing the internal │ │ │ +instructions are used:

    {update, Module, {advanced, Extra}}
    │ │ │ +{update, Module, supervisor}

    update with argument {advanced,Extra} is used when changing the internal │ │ │ state of a behaviour as described above. It causes behaviour processes to call │ │ │ the callback function code_change/3, passing the term Extra and some other │ │ │ information as arguments. See the manual pages for the respective behaviours and │ │ │ Appup Cookbook.

    update with argument supervisor is used when changing the start │ │ │ specification of a supervisor. See Appup Cookbook.

    When a module is to be updated, the release handler finds which processes that │ │ │ are using the module by traversing the supervision tree of each running │ │ │ -application and checking all the child specifications:

    {Id, StartFunc, Restart, Shutdown, Type, Modules}

    A process uses a module if the name is listed in Modules in the child │ │ │ +application and checking all the child specifications:

    {Id, StartFunc, Restart, Shutdown, Type, Modules}

    A process uses a module if the name is listed in Modules in the child │ │ │ specification for the process.

    If Modules=dynamic, which is the case for event managers, the event manager │ │ │ process informs the release handler about the list of currently installed event │ │ │ handlers (gen_event), and it is checked if the module name is in this list │ │ │ instead.

    The release handler suspends, asks for code change, and resumes processes by │ │ │ calling the functions sys:suspend/1,2, sys:change_code/4,5, and │ │ │ sys:resume/1,2, respectively.

    │ │ │ │ │ │ │ │ │ │ │ │ add_module and delete_module │ │ │

    │ │ │ -

    If a new module is introduced, the following instruction is used:

    {add_module, Module}

    This instruction loads module Module. When running Erlang in │ │ │ +

    If a new module is introduced, the following instruction is used:

    {add_module, Module}

    This instruction loads module Module. When running Erlang in │ │ │ embedded mode it is necessary to use this this instruction. It is not │ │ │ strictly required when running Erlang in interactive mode, since the │ │ │ -code server automatically searches for and loads unloaded modules.

    The opposite of add_module is delete_module, which unloads a module:

    {delete_module, Module}

    Any process, in any application, with Module as residence module, is │ │ │ +code server automatically searches for and loads unloaded modules.

    The opposite of add_module is delete_module, which unloads a module:

    {delete_module, Module}

    Any process, in any application, with Module as residence module, is │ │ │ killed when the instruction is evaluated. Therefore, the user must │ │ │ ensure that all such processes are terminated before deleting module │ │ │ Module to avoid a situation with failing supervisor restarts.

    │ │ │ │ │ │ │ │ │ │ │ │ Application Instructions │ │ │ @@ -341,60 +341,60 @@ │ │ │ .app file.
  • Each UpFromVsn is a previous version of the application to upgrade from.
  • Each DownToVsn is a previous version of the application to downgrade to.
  • Each Instructions is a list of release handling instructions.
  • UpFromVsn and DownToVsn can also be specified as regular expressions. For │ │ │ more information about the syntax and contents of the .appup file, see │ │ │ appup in SASL.

    Appup Cookbook includes examples of .appup files for │ │ │ typical upgrade/downgrade cases.

    Example: Consider the release ch_rel-1 from │ │ │ Releases. Assume you want to add a function │ │ │ available/0 to server ch3, which returns the number of available channels │ │ │ (when trying out the example, make the change in a copy of the original │ │ │ -directory, to ensure that the first version is still available):

    -module(ch3).
    │ │ │ --behaviour(gen_server).
    │ │ │ +directory, to ensure that the first version is still available):

    -module(ch3).
    │ │ │ +-behaviour(gen_server).
    │ │ │  
    │ │ │ --export([start_link/0]).
    │ │ │ --export([alloc/0, free/1]).
    │ │ │ --export([available/0]).
    │ │ │ --export([init/1, handle_call/3, handle_cast/2]).
    │ │ │ +-export([start_link/0]).
    │ │ │ +-export([alloc/0, free/1]).
    │ │ │ +-export([available/0]).
    │ │ │ +-export([init/1, handle_call/3, handle_cast/2]).
    │ │ │  
    │ │ │ -start_link() ->
    │ │ │ -    gen_server:start_link({local, ch3}, ch3, [], []).
    │ │ │ +start_link() ->
    │ │ │ +    gen_server:start_link({local, ch3}, ch3, [], []).
    │ │ │  
    │ │ │ -alloc() ->
    │ │ │ -    gen_server:call(ch3, alloc).
    │ │ │ +alloc() ->
    │ │ │ +    gen_server:call(ch3, alloc).
    │ │ │  
    │ │ │ -free(Ch) ->
    │ │ │ -    gen_server:cast(ch3, {free, Ch}).
    │ │ │ +free(Ch) ->
    │ │ │ +    gen_server:cast(ch3, {free, Ch}).
    │ │ │  
    │ │ │ -available() ->
    │ │ │ -    gen_server:call(ch3, available).
    │ │ │ +available() ->
    │ │ │ +    gen_server:call(ch3, available).
    │ │ │  
    │ │ │ -init(_Args) ->
    │ │ │ -    {ok, channels()}.
    │ │ │ +init(_Args) ->
    │ │ │ +    {ok, channels()}.
    │ │ │  
    │ │ │ -handle_call(alloc, _From, Chs) ->
    │ │ │ -    {Ch, Chs2} = alloc(Chs),
    │ │ │ -    {reply, Ch, Chs2};
    │ │ │ -handle_call(available, _From, Chs) ->
    │ │ │ -    N = available(Chs),
    │ │ │ -    {reply, N, Chs}.
    │ │ │ +handle_call(alloc, _From, Chs) ->
    │ │ │ +    {Ch, Chs2} = alloc(Chs),
    │ │ │ +    {reply, Ch, Chs2};
    │ │ │ +handle_call(available, _From, Chs) ->
    │ │ │ +    N = available(Chs),
    │ │ │ +    {reply, N, Chs}.
    │ │ │  
    │ │ │ -handle_cast({free, Ch}, Chs) ->
    │ │ │ -    Chs2 = free(Ch, Chs),
    │ │ │ -    {noreply, Chs2}.

    A new version of the ch_app.app file must now be created, where the version is │ │ │ -updated:

    {application, ch_app,
    │ │ │ - [{description, "Channel allocator"},
    │ │ │ -  {vsn, "2"},
    │ │ │ -  {modules, [ch_app, ch_sup, ch3]},
    │ │ │ -  {registered, [ch3]},
    │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ -  {mod, {ch_app,[]}}
    │ │ │ - ]}.

    To upgrade ch_app from "1" to "2" (and to downgrade from "2" to "1"), │ │ │ +handle_cast({free, Ch}, Chs) -> │ │ │ + Chs2 = free(Ch, Chs), │ │ │ + {noreply, Chs2}.

    A new version of the ch_app.app file must now be created, where the version is │ │ │ +updated:

    {application, ch_app,
    │ │ │ + [{description, "Channel allocator"},
    │ │ │ +  {vsn, "2"},
    │ │ │ +  {modules, [ch_app, ch_sup, ch3]},
    │ │ │ +  {registered, [ch3]},
    │ │ │ +  {applications, [kernel, stdlib, sasl]},
    │ │ │ +  {mod, {ch_app,[]}}
    │ │ │ + ]}.

    To upgrade ch_app from "1" to "2" (and to downgrade from "2" to "1"), │ │ │ you only need to load the new (old) version of the ch3 callback module. Create │ │ │ -the application upgrade file ch_app.appup in the ebin directory:

    {"2",
    │ │ │ - [{"1", [{load_module, ch3}]}],
    │ │ │ - [{"1", [{load_module, ch3}]}]
    │ │ │ -}.

    │ │ │ +the application upgrade file ch_app.appup in the ebin directory:

    {"2",
    │ │ │ + [{"1", [{load_module, ch3}]}],
    │ │ │ + [{"1", [{load_module, ch3}]}]
    │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ Release Upgrade File │ │ │

    │ │ │

    To define how to upgrade/downgrade between the new version and previous versions │ │ │ of a release, a release upgrade file, or in short .relup file, is to be │ │ │ @@ -405,22 +405,22 @@ │ │ │ are to be added and deleted, and which applications that must be upgraded and/or │ │ │ downgraded. The instructions for this are fetched from the .appup files and │ │ │ transformed into a single list of low-level instructions in the right order.

    If the relup file is relatively simple, it can be created manually. It is only │ │ │ to contain low-level instructions.

    For details about the syntax and contents of the release upgrade file, see │ │ │ relup in SASL.

    Example, continued from the previous section: You have a new version "2" of │ │ │ ch_app and an .appup file. A new version of the .rel file is also needed. │ │ │ This time the file is called ch_rel-2.rel and the release version string is │ │ │ -changed from "A" to "B":

    {release,
    │ │ │ - {"ch_rel", "B"},
    │ │ │ - {erts, "14.2.5"},
    │ │ │ - [{kernel, "9.2.4"},
    │ │ │ -  {stdlib, "5.2.3"},
    │ │ │ -  {sasl, "4.2.1"},
    │ │ │ -  {ch_app, "2"}]
    │ │ │ -}.

    Now the relup file can be generated:

    1> systools:make_relup("ch_rel-2", ["ch_rel-1"], ["ch_rel-1"]).
    │ │ │ +changed from "A" to "B":

    {release,
    │ │ │ + {"ch_rel", "B"},
    │ │ │ + {erts, "14.2.5"},
    │ │ │ + [{kernel, "9.2.4"},
    │ │ │ +  {stdlib, "5.2.3"},
    │ │ │ +  {sasl, "4.2.1"},
    │ │ │ +  {ch_app, "2"}]
    │ │ │ +}.

    Now the relup file can be generated:

    1> systools:make_relup("ch_rel-2", ["ch_rel-1"], ["ch_rel-1"]).
    │ │ │  ok

    This generates a relup file with instructions for how to upgrade from version │ │ │ "A" ("ch_rel-1") to version "B" ("ch_rel-2") and how to downgrade from version │ │ │ "B" to version "A".

    Both the old and new versions of the .app and .rel files must be in the code │ │ │ path, as well as the .appup and (new) .beam files. The code path can be │ │ │ extended by using the option path:

    1> systools:make_relup("ch_rel-2", ["ch_rel-1"], ["ch_rel-1"],
    │ │ │  [{path,["../ch_rel-1",
    │ │ │  "../ch_rel-1/lib/ch_app-1/ebin"]}]).
    │ │ │ @@ -433,25 +433,25 @@
    │ │ │  

    When you have made a new version of a release, a release package can be created │ │ │ with this new version and transferred to the target environment.

    To install the new version of the release in runtime, the release │ │ │ handler is used. This is a process belonging to the SASL application, │ │ │ which handles unpacking, installation, and removal of release │ │ │ packages. The release_handler module communicates with this process.

    Assuming there is an operational target system with installation root directory │ │ │ $ROOT, the release package with the new version of the release is to be copied │ │ │ to $ROOT/releases.

    First, unpack the release package. The files are then extracted from the │ │ │ -package:

    release_handler:unpack_release(ReleaseName) => {ok, Vsn}
    • ReleaseName is the name of the release package except the .tar.gz │ │ │ +package:

      release_handler:unpack_release(ReleaseName) => {ok, Vsn}
      • ReleaseName is the name of the release package except the .tar.gz │ │ │ extension.
      • Vsn is the version of the unpacked release, as defined in its .rel file.

      A directory $ROOT/lib/releases/Vsn is created, where the .rel file, the boot │ │ │ script start.boot, the system configuration file sys.config, and relup are │ │ │ placed. For applications with new version numbers, the application directories │ │ │ are placed under $ROOT/lib. Unchanged applications are not affected.

      An unpacked release can be installed. The release handler then evaluates the │ │ │ -instructions in relup, step by step:

      release_handler:install_release(Vsn) => {ok, FromVsn, []}

      If an error occurs during the installation, the system is rebooted using the old │ │ │ +instructions in relup, step by step:

      release_handler:install_release(Vsn) => {ok, FromVsn, []}

      If an error occurs during the installation, the system is rebooted using the old │ │ │ version of the release. If installation succeeds, the system is afterwards using │ │ │ the new version of the release, but if anything happens and the system is │ │ │ rebooted, it starts using the previous version again.

      To be made the default version, the newly installed release must be made │ │ │ permanent, which means the previous version becomes old:

      release_handler:make_permanent(Vsn) => ok

      The system keeps information about which versions are old and permanent in the │ │ │ -files $ROOT/releases/RELEASES and $ROOT/releases/start_erl.data.

      To downgrade from Vsn to FromVsn, install_release must be called again:

      release_handler:install_release(FromVsn) => {ok, Vsn, []}

      An installed, but not permanent, release can be removed. Information about the │ │ │ +files $ROOT/releases/RELEASES and $ROOT/releases/start_erl.data.

      To downgrade from Vsn to FromVsn, install_release must be called again:

      release_handler:install_release(FromVsn) => {ok, Vsn, []}

      An installed, but not permanent, release can be removed. Information about the │ │ │ release is then deleted from $ROOT/releases/RELEASES and the release-specific │ │ │ code, that is, the new application directories and the $ROOT/releases/Vsn │ │ │ directory, are removed.

      release_handler:remove_release(Vsn) => ok

      │ │ │ │ │ │ │ │ │ │ │ │ Example (continued from the previous sections) │ │ │ @@ -462,17 +462,17 @@ │ │ │ is needed, the file is to contain the empty list:

      [].

      Step 2) Start the system as a simple target system. In reality, it is to be │ │ │ started as an embedded system. However, using erl with the correct boot script │ │ │ and config file is enough for illustration purposes:

      % cd $ROOT
      │ │ │  % bin/erl -boot $ROOT/releases/A/start -config $ROOT/releases/A/sys
      │ │ │  ...

      $ROOT is the installation directory of the target system.

      Step 3) In another Erlang shell, generate start scripts and create a release │ │ │ package for the new version "B". Remember to include (a possible updated) │ │ │ sys.config and the relup file. For more information, see │ │ │ -Release Upgrade File.

      1> systools:make_script("ch_rel-2").
      │ │ │ +Release Upgrade File.

      1> systools:make_script("ch_rel-2").
      │ │ │  ok
      │ │ │ -2> systools:make_tar("ch_rel-2").
      │ │ │ +2> systools:make_tar("ch_rel-2").
      │ │ │  ok

      The new release package now also contains version "2" of ch_app and the │ │ │ relup file:

      % tar tf ch_rel-2.tar
      │ │ │  lib/kernel-9.2.4/ebin/kernel.app
      │ │ │  lib/kernel-9.2.4/ebin/application.beam
      │ │ │  ...
      │ │ │  lib/stdlib-5.2.3/ebin/stdlib.app
      │ │ │  lib/stdlib-5.2.3/ebin/argparse.beam
      │ │ │ @@ -485,31 +485,31 @@
      │ │ │  lib/ch_app-2/ebin/ch_sup.beam
      │ │ │  lib/ch_app-2/ebin/ch3.beam
      │ │ │  releases/B/start.boot
      │ │ │  releases/B/relup
      │ │ │  releases/B/sys.config
      │ │ │  releases/B/ch_rel-2.rel
      │ │ │  releases/ch_rel-2.rel

      Step 4) Copy the release package ch_rel-2.tar.gz to the $ROOT/releases │ │ │ -directory.

      Step 5) In the running target system, unpack the release package:

      1> release_handler:unpack_release("ch_rel-2").
      │ │ │ -{ok,"B"}

      The new application version ch_app-2 is installed under $ROOT/lib next to │ │ │ +directory.

      Step 5) In the running target system, unpack the release package:

      1> release_handler:unpack_release("ch_rel-2").
      │ │ │ +{ok,"B"}

      The new application version ch_app-2 is installed under $ROOT/lib next to │ │ │ ch_app-1. The kernel, stdlib, and sasl directories are not affected, as │ │ │ they have not changed.

      Under $ROOT/releases, a new directory B is created, containing │ │ │ -ch_rel-2.rel, start.boot, sys.config, and relup.

      Step 6) Check if the function ch3:available/0 is available:

      2> ch3:available().
      │ │ │ +ch_rel-2.rel, start.boot, sys.config, and relup.

      Step 6) Check if the function ch3:available/0 is available:

      2> ch3:available().
      │ │ │  ** exception error: undefined function ch3:available/0

      Step 7) Install the new release. The instructions in $ROOT/releases/B/relup │ │ │ are executed one by one, resulting in the new version of ch3 being loaded. The │ │ │ -function ch3:available/0 is now available:

      3> release_handler:install_release("B").
      │ │ │ -{ok,"A",[]}
      │ │ │ -4> ch3:available().
      │ │ │ +function ch3:available/0 is now available:

      3> release_handler:install_release("B").
      │ │ │ +{ok,"A",[]}
      │ │ │ +4> ch3:available().
      │ │ │  3
      │ │ │ -5> code:which(ch3).
      │ │ │ +5> code:which(ch3).
      │ │ │  ".../lib/ch_app-2/ebin/ch3.beam"
      │ │ │ -6> code:which(ch_sup).
      │ │ │ +6> code:which(ch_sup).
      │ │ │  ".../lib/ch_app-1/ebin/ch_sup.beam"

      Processes in ch_app for which code have not been updated, for example, the │ │ │ supervisor, are still evaluating code from ch_app-1.

      Step 8) If the target system is now rebooted, it uses version "A" again. The │ │ │ -"B" version must be made permanent, to be used when the system is rebooted.

      7> release_handler:make_permanent("B").
      │ │ │ +"B" version must be made permanent, to be used when the system is rebooted.

      7> release_handler:make_permanent("B").
      │ │ │  ok

      │ │ │ │ │ │ │ │ │ │ │ │ Updating Application Specifications │ │ │

      │ │ │

      When a new version of a release is installed, the application specifications are │ │ │ @@ -518,15 +518,15 @@ │ │ │ boot script is generated from the same .rel file as is used to build the │ │ │ release package itself.

      Specifically, the application configuration parameters are automatically updated │ │ │ according to (in increasing priority order):

      • The data in the boot script, fetched from the new application resource file │ │ │ App.app
      • The new sys.config
      • Command-line arguments -App Par Val

      This means that parameter values set in the other system configuration files and │ │ │ values set using application:set_env/3 are disregarded.

      When an installed release is made permanent, the system process init is set to │ │ │ point out the new sys.config.

      After the installation, the application controller compares the old and new │ │ │ configuration parameters for all running applications and call the callback │ │ │ -function:

      Module:config_change(Changed, New, Removed)
      • Module is the application callback module as defined by the mod key in the │ │ │ +function:

        Module:config_change(Changed, New, Removed)
        • Module is the application callback module as defined by the mod key in the │ │ │ .app file.
        • Changed and New are lists of {Par,Val} for all changed and added │ │ │ configuration parameters, respectively.
        • Removed is a list of all parameters Par that have been removed.

        The function is optional and can be omitted when implementing an application │ │ │ callback module.

        │ │ │

    │ │ │ │ │ │
    │ │ │
    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/release_structure.html │ │ │ @@ -136,37 +136,37 @@ │ │ │ │ │ │ │ │ │ │ │ │ Release Resource File │ │ │ │ │ │

    To define a release, create a release resource file, or in short a .rel │ │ │ file. In the file, specify the name and version of the release, which ERTS │ │ │ -version it is based on, and which applications it consists of:

    {release, {Name,Vsn}, {erts, EVsn},
    │ │ │ - [{Application1, AppVsn1},
    │ │ │ +version it is based on, and which applications it consists of:

    {release, {Name,Vsn}, {erts, EVsn},
    │ │ │ + [{Application1, AppVsn1},
    │ │ │     ...
    │ │ │ -  {ApplicationN, AppVsnN}]}.

    Name, Vsn, EVsn, and AppVsn are strings.

    The file must be named Rel.rel, where Rel is a unique name.

    Each Application (atom) and AppVsn is the name and version of an application │ │ │ + {ApplicationN, AppVsnN}]}.

    Name, Vsn, EVsn, and AppVsn are strings.

    The file must be named Rel.rel, where Rel is a unique name.

    Each Application (atom) and AppVsn is the name and version of an application │ │ │ included in the release. The minimal release based on Erlang/OTP consists of the │ │ │ Kernel and STDLIB applications, so these applications must be included in the │ │ │ list.

    If the release is to be upgraded, it must also include the SASL application.

    Here is an example showing the .app file for a release of ch_app from │ │ │ -the Applications section:

    {application, ch_app,
    │ │ │ - [{description, "Channel allocator"},
    │ │ │ -  {vsn, "1"},
    │ │ │ -  {modules, [ch_app, ch_sup, ch3]},
    │ │ │ -  {registered, [ch3]},
    │ │ │ -  {applications, [kernel, stdlib, sasl]},
    │ │ │ -  {mod, {ch_app,[]}}
    │ │ │ - ]}.

    The .rel file must also contain kernel, stdlib, and sasl, as these │ │ │ -applications are required by ch_app. The file is called ch_rel-1.rel:

    {release,
    │ │ │ - {"ch_rel", "A"},
    │ │ │ - {erts, "14.2.5"},
    │ │ │ - [{kernel, "9.2.4"},
    │ │ │ -  {stdlib, "5.2.3"},
    │ │ │ -  {sasl, "4.2.1"},
    │ │ │ -  {ch_app, "1"}]
    │ │ │ -}.

    │ │ │ +the Applications section:

    {application, ch_app,
    │ │ │ + [{description, "Channel allocator"},
    │ │ │ +  {vsn, "1"},
    │ │ │ +  {modules, [ch_app, ch_sup, ch3]},
    │ │ │ +  {registered, [ch3]},
    │ │ │ +  {applications, [kernel, stdlib, sasl]},
    │ │ │ +  {mod, {ch_app,[]}}
    │ │ │ + ]}.

    The .rel file must also contain kernel, stdlib, and sasl, as these │ │ │ +applications are required by ch_app. The file is called ch_rel-1.rel:

    {release,
    │ │ │ + {"ch_rel", "A"},
    │ │ │ + {erts, "14.2.5"},
    │ │ │ + [{kernel, "9.2.4"},
    │ │ │ +  {stdlib, "5.2.3"},
    │ │ │ +  {sasl, "4.2.1"},
    │ │ │ +  {ch_app, "1"}]
    │ │ │ +}.

    │ │ │ │ │ │ │ │ │ │ │ │ Generating Boot Scripts │ │ │

    │ │ │

    systools in the SASL application includes tools to build and check │ │ │ releases. The functions read the .rel and .app files and perform │ │ │ @@ -190,17 +190,17 @@ │ │ │ │ │ │ │ │ │ │ │ │ Creating a Release Package │ │ │ │ │ │

    The systools:make_tar/1,2 function takes a │ │ │ .rel file as input and creates a zipped tar file with the code for │ │ │ -the specified applications, a release package:

    1> systools:make_script("ch_rel-1").
    │ │ │ +the specified applications, a release package:

    1> systools:make_script("ch_rel-1").
    │ │ │  ok
    │ │ │ -2> systools:make_tar("ch_rel-1").
    │ │ │ +2> systools:make_tar("ch_rel-1").
    │ │ │  ok

    The release package by default contains:

    • The .app files
    • The .rel file
    • The object code for all applications, structured according to the │ │ │ application directory structure
    • The binary boot script renamed to start.boot
    % tar tf ch_rel-1.tar
    │ │ │  lib/kernel-9.2.4/ebin/kernel.app
    │ │ │  lib/kernel-9.2.4/ebin/application.beam
    │ │ │  ...
    │ │ │  lib/stdlib-5.2.3/ebin/stdlib.app
    │ │ │  lib/stdlib-5.2.3/ebin/argparse.beam
    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/robustness.html
    │ │ │ @@ -128,68 +128,68 @@
    │ │ │  
    │ │ │  

    Before improving the messenger program, let us look at some general principles, │ │ │ using the ping pong program as an example. Recall that when "ping" finishes, it │ │ │ tells "pong" that it has done so by sending the atom finished as a message to │ │ │ "pong" so that "pong" can also finish. Another way to let "pong" finish is to │ │ │ make "pong" exit if it does not receive a message from ping within a certain │ │ │ time. This can be done by adding a time-out to pong as shown in the │ │ │ -following example:

    -module(tut19).
    │ │ │ +following example:

    -module(tut19).
    │ │ │  
    │ │ │ --export([start_ping/1, start_pong/0,  ping/2, pong/0]).
    │ │ │ +-export([start_ping/1, start_pong/0,  ping/2, pong/0]).
    │ │ │  
    │ │ │ -ping(0, Pong_Node) ->
    │ │ │ -    io:format("ping finished~n", []);
    │ │ │ +ping(0, Pong_Node) ->
    │ │ │ +    io:format("ping finished~n", []);
    │ │ │  
    │ │ │ -ping(N, Pong_Node) ->
    │ │ │ -    {pong, Pong_Node} ! {ping, self()},
    │ │ │ +ping(N, Pong_Node) ->
    │ │ │ +    {pong, Pong_Node} ! {ping, self()},
    │ │ │      receive
    │ │ │          pong ->
    │ │ │ -            io:format("Ping received pong~n", [])
    │ │ │ +            io:format("Ping received pong~n", [])
    │ │ │      end,
    │ │ │ -    ping(N - 1, Pong_Node).
    │ │ │ +    ping(N - 1, Pong_Node).
    │ │ │  
    │ │ │ -pong() ->
    │ │ │ +pong() ->
    │ │ │      receive
    │ │ │ -        {ping, Ping_PID} ->
    │ │ │ -            io:format("Pong received ping~n", []),
    │ │ │ +        {ping, Ping_PID} ->
    │ │ │ +            io:format("Pong received ping~n", []),
    │ │ │              Ping_PID ! pong,
    │ │ │ -            pong()
    │ │ │ +            pong()
    │ │ │      after 5000 ->
    │ │ │ -            io:format("Pong timed out~n", [])
    │ │ │ +            io:format("Pong timed out~n", [])
    │ │ │      end.
    │ │ │  
    │ │ │ -start_pong() ->
    │ │ │ -    register(pong, spawn(tut19, pong, [])).
    │ │ │ +start_pong() ->
    │ │ │ +    register(pong, spawn(tut19, pong, [])).
    │ │ │  
    │ │ │ -start_ping(Pong_Node) ->
    │ │ │ -    spawn(tut19, ping, [3, Pong_Node]).

    After this is compiled and the file tut19.beam is copied to the necessary │ │ │ +start_ping(Pong_Node) -> │ │ │ + spawn(tut19, ping, [3, Pong_Node]).

    After this is compiled and the file tut19.beam is copied to the necessary │ │ │ directories, the following is seen on (pong@kosken):

    (pong@kosken)1> tut19:start_pong().
    │ │ │  true
    │ │ │  Pong received ping
    │ │ │  Pong received ping
    │ │ │  Pong received ping
    │ │ │  Pong timed out

    And the following is seen on (ping@gollum):

    (ping@gollum)1> tut19:start_ping(pong@kosken).
    │ │ │  <0.36.0>
    │ │ │  Ping received pong
    │ │ │  Ping received pong
    │ │ │  Ping received pong
    │ │ │ -ping finished

    The time-out is set in:

    pong() ->
    │ │ │ +ping finished

    The time-out is set in:

    pong() ->
    │ │ │      receive
    │ │ │ -        {ping, Ping_PID} ->
    │ │ │ -            io:format("Pong received ping~n", []),
    │ │ │ +        {ping, Ping_PID} ->
    │ │ │ +            io:format("Pong received ping~n", []),
    │ │ │              Ping_PID ! pong,
    │ │ │ -            pong()
    │ │ │ +            pong()
    │ │ │      after 5000 ->
    │ │ │ -            io:format("Pong timed out~n", [])
    │ │ │ +            io:format("Pong timed out~n", [])
    │ │ │      end.

    The time-out (after 5000) is started when receive is entered. The time-out │ │ │ is canceled if {ping,Ping_PID} is received. If {ping,Ping_PID} is not │ │ │ received, the actions following the time-out are done after 5000 milliseconds. │ │ │ after must be last in the receive, that is, preceded by all other message │ │ │ reception specifications in the receive. It is also possible to call a │ │ │ -function that returned an integer for the time-out:

    after pong_timeout() ->

    In general, there are better ways than using time-outs to supervise parts of a │ │ │ +function that returned an integer for the time-out:

    after pong_timeout() ->

    In general, there are better ways than using time-outs to supervise parts of a │ │ │ distributed Erlang system. Time-outs are usually appropriate to supervise │ │ │ external events, for example, if you have expected a message from some external │ │ │ system within a specified time. For example, a time-out can be used to log a │ │ │ user out of the messenger system if they have not accessed it for, say, ten │ │ │ minutes.

    │ │ │ │ │ │ │ │ │ @@ -209,96 +209,96 @@ │ │ │ something called a signal to all the processes it has links to.

    The signal carries information about the pid it was sent from and the exit │ │ │ reason.

    The default behaviour of a process that receives a normal exit is to ignore the │ │ │ signal.

    The default behaviour in the two other cases (that is, abnormal exit) above is │ │ │ to:

    • Bypass all messages to the receiving process.
    • Kill the receiving process.
    • Propagate the same error signal to the links of the killed process.

    In this way you can connect all processes in a transaction together using links. │ │ │ If one of the processes exits abnormally, all the processes in the transaction │ │ │ are killed. As it is often wanted to create a process and link to it at the same │ │ │ time, there is a special BIF, spawn_link that does the │ │ │ -same as spawn, but also creates a link to the spawned process.

    Now an example of the ping pong example using links to terminate "pong":

    -module(tut20).
    │ │ │ +same as spawn, but also creates a link to the spawned process.

    Now an example of the ping pong example using links to terminate "pong":

    -module(tut20).
    │ │ │  
    │ │ │ --export([start/1,  ping/2, pong/0]).
    │ │ │ +-export([start/1,  ping/2, pong/0]).
    │ │ │  
    │ │ │ -ping(N, Pong_Pid) ->
    │ │ │ -    link(Pong_Pid),
    │ │ │ -    ping1(N, Pong_Pid).
    │ │ │ +ping(N, Pong_Pid) ->
    │ │ │ +    link(Pong_Pid),
    │ │ │ +    ping1(N, Pong_Pid).
    │ │ │  
    │ │ │ -ping1(0, _) ->
    │ │ │ -    exit(ping);
    │ │ │ +ping1(0, _) ->
    │ │ │ +    exit(ping);
    │ │ │  
    │ │ │ -ping1(N, Pong_Pid) ->
    │ │ │ -    Pong_Pid ! {ping, self()},
    │ │ │ +ping1(N, Pong_Pid) ->
    │ │ │ +    Pong_Pid ! {ping, self()},
    │ │ │      receive
    │ │ │          pong ->
    │ │ │ -            io:format("Ping received pong~n", [])
    │ │ │ +            io:format("Ping received pong~n", [])
    │ │ │      end,
    │ │ │ -    ping1(N - 1, Pong_Pid).
    │ │ │ +    ping1(N - 1, Pong_Pid).
    │ │ │  
    │ │ │ -pong() ->
    │ │ │ +pong() ->
    │ │ │      receive
    │ │ │ -        {ping, Ping_PID} ->
    │ │ │ -            io:format("Pong received ping~n", []),
    │ │ │ +        {ping, Ping_PID} ->
    │ │ │ +            io:format("Pong received ping~n", []),
    │ │ │              Ping_PID ! pong,
    │ │ │ -            pong()
    │ │ │ +            pong()
    │ │ │      end.
    │ │ │  
    │ │ │ -start(Ping_Node) ->
    │ │ │ -    PongPID = spawn(tut20, pong, []),
    │ │ │ -    spawn(Ping_Node, tut20, ping, [3, PongPID]).
    (s1@bill)3> tut20:start(s2@kosken).
    │ │ │ +start(Ping_Node) ->
    │ │ │ +    PongPID = spawn(tut20, pong, []),
    │ │ │ +    spawn(Ping_Node, tut20, ping, [3, PongPID]).
    (s1@bill)3> tut20:start(s2@kosken).
    │ │ │  Pong received ping
    │ │ │  <3820.41.0>
    │ │ │  Ping received pong
    │ │ │  Pong received ping
    │ │ │  Ping received pong
    │ │ │  Pong received ping
    │ │ │  Ping received pong

    This is a slight modification of the ping pong program where both processes are │ │ │ spawned from the same start/1 function, and the "ping" process can be spawned │ │ │ on a separate node. Notice the use of the link BIF. "Ping" calls │ │ │ exit(ping) when it finishes and this causes an exit signal to be │ │ │ sent to "pong", which also terminates.

    It is possible to modify the default behaviour of a process so that it does not │ │ │ get killed when it receives abnormal exit signals. Instead, all signals are │ │ │ turned into normal messages on the format {'EXIT',FromPID,Reason} and added to │ │ │ -the end of the receiving process' message queue. This behaviour is set by:

    process_flag(trap_exit, true)

    There are several other process flags, see erlang(3). │ │ │ +the end of the receiving process' message queue. This behaviour is set by:

    process_flag(trap_exit, true)

    There are several other process flags, see erlang(3). │ │ │ Changing the default behaviour of a process in this way is usually not done in │ │ │ standard user programs, but is left to the supervisory programs in OTP. However, │ │ │ -the ping pong program is modified to illustrate exit trapping.

    -module(tut21).
    │ │ │ +the ping pong program is modified to illustrate exit trapping.

    -module(tut21).
    │ │ │  
    │ │ │ --export([start/1,  ping/2, pong/0]).
    │ │ │ +-export([start/1,  ping/2, pong/0]).
    │ │ │  
    │ │ │ -ping(N, Pong_Pid) ->
    │ │ │ -    link(Pong_Pid),
    │ │ │ -    ping1(N, Pong_Pid).
    │ │ │ +ping(N, Pong_Pid) ->
    │ │ │ +    link(Pong_Pid),
    │ │ │ +    ping1(N, Pong_Pid).
    │ │ │  
    │ │ │ -ping1(0, _) ->
    │ │ │ -    exit(ping);
    │ │ │ +ping1(0, _) ->
    │ │ │ +    exit(ping);
    │ │ │  
    │ │ │ -ping1(N, Pong_Pid) ->
    │ │ │ -    Pong_Pid ! {ping, self()},
    │ │ │ +ping1(N, Pong_Pid) ->
    │ │ │ +    Pong_Pid ! {ping, self()},
    │ │ │      receive
    │ │ │          pong ->
    │ │ │ -            io:format("Ping received pong~n", [])
    │ │ │ +            io:format("Ping received pong~n", [])
    │ │ │      end,
    │ │ │ -    ping1(N - 1, Pong_Pid).
    │ │ │ +    ping1(N - 1, Pong_Pid).
    │ │ │  
    │ │ │ -pong() ->
    │ │ │ -    process_flag(trap_exit, true),
    │ │ │ -    pong1().
    │ │ │ +pong() ->
    │ │ │ +    process_flag(trap_exit, true),
    │ │ │ +    pong1().
    │ │ │  
    │ │ │ -pong1() ->
    │ │ │ +pong1() ->
    │ │ │      receive
    │ │ │ -        {ping, Ping_PID} ->
    │ │ │ -            io:format("Pong received ping~n", []),
    │ │ │ +        {ping, Ping_PID} ->
    │ │ │ +            io:format("Pong received ping~n", []),
    │ │ │              Ping_PID ! pong,
    │ │ │ -            pong1();
    │ │ │ -        {'EXIT', From, Reason} ->
    │ │ │ -            io:format("pong exiting, got ~p~n", [{'EXIT', From, Reason}])
    │ │ │ +            pong1();
    │ │ │ +        {'EXIT', From, Reason} ->
    │ │ │ +            io:format("pong exiting, got ~p~n", [{'EXIT', From, Reason}])
    │ │ │      end.
    │ │ │  
    │ │ │ -start(Ping_Node) ->
    │ │ │ -    PongPID = spawn(tut21, pong, []),
    │ │ │ -    spawn(Ping_Node, tut21, ping, [3, PongPID]).
    (s1@bill)1> tut21:start(s2@gollum).
    │ │ │ +start(Ping_Node) ->
    │ │ │ +    PongPID = spawn(tut21, pong, []),
    │ │ │ +    spawn(Ping_Node, tut21, ping, [3, PongPID]).
    (s1@bill)1> tut21:start(s2@gollum).
    │ │ │  <3820.39.0>
    │ │ │  Pong received ping
    │ │ │  Ping received pong
    │ │ │  Pong received ping
    │ │ │  Ping received pong
    │ │ │  Pong received ping
    │ │ │  Ping received pong
    │ │ │ @@ -351,135 +351,135 @@
    │ │ │  %%% Started: messenger:client(Server_Node, Name)
    │ │ │  %%% To client: logoff
    │ │ │  %%% To client: {message_to, ToName, Message}
    │ │ │  %%%
    │ │ │  %%% Configuration: change the server_node() function to return the
    │ │ │  %%% name of the node where the messenger server runs
    │ │ │  
    │ │ │ --module(messenger).
    │ │ │ --export([start_server/0, server/0,
    │ │ │ -         logon/1, logoff/0, message/2, client/2]).
    │ │ │ +-module(messenger).
    │ │ │ +-export([start_server/0, server/0,
    │ │ │ +         logon/1, logoff/0, message/2, client/2]).
    │ │ │  
    │ │ │  %%% Change the function below to return the name of the node where the
    │ │ │  %%% messenger server runs
    │ │ │ -server_node() ->
    │ │ │ +server_node() ->
    │ │ │      messenger@super.
    │ │ │  
    │ │ │  %%% This is the server process for the "messenger"
    │ │ │  %%% the user list has the format [{ClientPid1, Name1},{ClientPid22, Name2},...]
    │ │ │ -server() ->
    │ │ │ -    process_flag(trap_exit, true),
    │ │ │ -    server([]).
    │ │ │ +server() ->
    │ │ │ +    process_flag(trap_exit, true),
    │ │ │ +    server([]).
    │ │ │  
    │ │ │ -server(User_List) ->
    │ │ │ +server(User_List) ->
    │ │ │      receive
    │ │ │ -        {From, logon, Name} ->
    │ │ │ -            New_User_List = server_logon(From, Name, User_List),
    │ │ │ -            server(New_User_List);
    │ │ │ -        {'EXIT', From, _} ->
    │ │ │ -            New_User_List = server_logoff(From, User_List),
    │ │ │ -            server(New_User_List);
    │ │ │ -        {From, message_to, To, Message} ->
    │ │ │ -            server_transfer(From, To, Message, User_List),
    │ │ │ -            io:format("list is now: ~p~n", [User_List]),
    │ │ │ -            server(User_List)
    │ │ │ +        {From, logon, Name} ->
    │ │ │ +            New_User_List = server_logon(From, Name, User_List),
    │ │ │ +            server(New_User_List);
    │ │ │ +        {'EXIT', From, _} ->
    │ │ │ +            New_User_List = server_logoff(From, User_List),
    │ │ │ +            server(New_User_List);
    │ │ │ +        {From, message_to, To, Message} ->
    │ │ │ +            server_transfer(From, To, Message, User_List),
    │ │ │ +            io:format("list is now: ~p~n", [User_List]),
    │ │ │ +            server(User_List)
    │ │ │      end.
    │ │ │  
    │ │ │  %%% Start the server
    │ │ │ -start_server() ->
    │ │ │ -    register(messenger, spawn(messenger, server, [])).
    │ │ │ +start_server() ->
    │ │ │ +    register(messenger, spawn(messenger, server, [])).
    │ │ │  
    │ │ │  %%% Server adds a new user to the user list
    │ │ │ -server_logon(From, Name, User_List) ->
    │ │ │ +server_logon(From, Name, User_List) ->
    │ │ │      %% check if logged on anywhere else
    │ │ │ -    case lists:keymember(Name, 2, User_List) of
    │ │ │ +    case lists:keymember(Name, 2, User_List) of
    │ │ │          true ->
    │ │ │ -            From ! {messenger, stop, user_exists_at_other_node},  %reject logon
    │ │ │ +            From ! {messenger, stop, user_exists_at_other_node},  %reject logon
    │ │ │              User_List;
    │ │ │          false ->
    │ │ │ -            From ! {messenger, logged_on},
    │ │ │ -            link(From),
    │ │ │ -            [{From, Name} | User_List]        %add user to the list
    │ │ │ +            From ! {messenger, logged_on},
    │ │ │ +            link(From),
    │ │ │ +            [{From, Name} | User_List]        %add user to the list
    │ │ │      end.
    │ │ │  
    │ │ │  %%% Server deletes a user from the user list
    │ │ │ -server_logoff(From, User_List) ->
    │ │ │ -    lists:keydelete(From, 1, User_List).
    │ │ │ +server_logoff(From, User_List) ->
    │ │ │ +    lists:keydelete(From, 1, User_List).
    │ │ │  
    │ │ │  
    │ │ │  %%% Server transfers a message between user
    │ │ │ -server_transfer(From, To, Message, User_List) ->
    │ │ │ +server_transfer(From, To, Message, User_List) ->
    │ │ │      %% check that the user is logged on and who he is
    │ │ │ -    case lists:keysearch(From, 1, User_List) of
    │ │ │ +    case lists:keysearch(From, 1, User_List) of
    │ │ │          false ->
    │ │ │ -            From ! {messenger, stop, you_are_not_logged_on};
    │ │ │ -        {value, {_, Name}} ->
    │ │ │ -            server_transfer(From, Name, To, Message, User_List)
    │ │ │ +            From ! {messenger, stop, you_are_not_logged_on};
    │ │ │ +        {value, {_, Name}} ->
    │ │ │ +            server_transfer(From, Name, To, Message, User_List)
    │ │ │      end.
    │ │ │  
    │ │ │  %%% If the user exists, send the message
    │ │ │ -server_transfer(From, Name, To, Message, User_List) ->
    │ │ │ +server_transfer(From, Name, To, Message, User_List) ->
    │ │ │      %% Find the receiver and send the message
    │ │ │ -    case lists:keysearch(To, 2, User_List) of
    │ │ │ +    case lists:keysearch(To, 2, User_List) of
    │ │ │          false ->
    │ │ │ -            From ! {messenger, receiver_not_found};
    │ │ │ -        {value, {ToPid, To}} ->
    │ │ │ -            ToPid ! {message_from, Name, Message},
    │ │ │ -            From ! {messenger, sent}
    │ │ │ +            From ! {messenger, receiver_not_found};
    │ │ │ +        {value, {ToPid, To}} ->
    │ │ │ +            ToPid ! {message_from, Name, Message},
    │ │ │ +            From ! {messenger, sent}
    │ │ │      end.
    │ │ │  
    │ │ │  %%% User Commands
    │ │ │ -logon(Name) ->
    │ │ │ -    case whereis(mess_client) of
    │ │ │ +logon(Name) ->
    │ │ │ +    case whereis(mess_client) of
    │ │ │          undefined ->
    │ │ │ -            register(mess_client,
    │ │ │ -                     spawn(messenger, client, [server_node(), Name]));
    │ │ │ +            register(mess_client,
    │ │ │ +                     spawn(messenger, client, [server_node(), Name]));
    │ │ │          _ -> already_logged_on
    │ │ │      end.
    │ │ │  
    │ │ │ -logoff() ->
    │ │ │ +logoff() ->
    │ │ │      mess_client ! logoff.
    │ │ │  
    │ │ │ -message(ToName, Message) ->
    │ │ │ -    case whereis(mess_client) of % Test if the client is running
    │ │ │ +message(ToName, Message) ->
    │ │ │ +    case whereis(mess_client) of % Test if the client is running
    │ │ │          undefined ->
    │ │ │              not_logged_on;
    │ │ │ -        _ -> mess_client ! {message_to, ToName, Message},
    │ │ │ +        _ -> mess_client ! {message_to, ToName, Message},
    │ │ │               ok
    │ │ │  end.
    │ │ │  
    │ │ │  %%% The client process which runs on each user node
    │ │ │ -client(Server_Node, Name) ->
    │ │ │ -    {messenger, Server_Node} ! {self(), logon, Name},
    │ │ │ -    await_result(),
    │ │ │ -    client(Server_Node).
    │ │ │ +client(Server_Node, Name) ->
    │ │ │ +    {messenger, Server_Node} ! {self(), logon, Name},
    │ │ │ +    await_result(),
    │ │ │ +    client(Server_Node).
    │ │ │  
    │ │ │ -client(Server_Node) ->
    │ │ │ +client(Server_Node) ->
    │ │ │      receive
    │ │ │          logoff ->
    │ │ │ -            exit(normal);
    │ │ │ -        {message_to, ToName, Message} ->
    │ │ │ -            {messenger, Server_Node} ! {self(), message_to, ToName, Message},
    │ │ │ -            await_result();
    │ │ │ -        {message_from, FromName, Message} ->
    │ │ │ -            io:format("Message from ~p: ~p~n", [FromName, Message])
    │ │ │ +            exit(normal);
    │ │ │ +        {message_to, ToName, Message} ->
    │ │ │ +            {messenger, Server_Node} ! {self(), message_to, ToName, Message},
    │ │ │ +            await_result();
    │ │ │ +        {message_from, FromName, Message} ->
    │ │ │ +            io:format("Message from ~p: ~p~n", [FromName, Message])
    │ │ │      end,
    │ │ │ -    client(Server_Node).
    │ │ │ +    client(Server_Node).
    │ │ │  
    │ │ │  %%% wait for a response from the server
    │ │ │ -await_result() ->
    │ │ │ +await_result() ->
    │ │ │      receive
    │ │ │ -        {messenger, stop, Why} -> % Stop the client
    │ │ │ -            io:format("~p~n", [Why]),
    │ │ │ -            exit(normal);
    │ │ │ -        {messenger, What} ->  % Normal response
    │ │ │ -            io:format("~p~n", [What])
    │ │ │ +        {messenger, stop, Why} -> % Stop the client
    │ │ │ +            io:format("~p~n", [Why]),
    │ │ │ +            exit(normal);
    │ │ │ +        {messenger, What} ->  % Normal response
    │ │ │ +            io:format("~p~n", [What])
    │ │ │      after 5000 ->
    │ │ │ -            io:format("No response from server~n", []),
    │ │ │ -            exit(timeout)
    │ │ │ +            io:format("No response from server~n", []),
    │ │ │ +            exit(timeout)
    │ │ │      end.

    The following changes are added:

    The messenger server traps exits. If it receives an exit signal, │ │ │ {'EXIT',From,Reason}, this means that a client process has terminated or is │ │ │ unreachable for one of the following reasons:

    • The user has logged off (the "logoff" message is removed).
    • The network connection to the client is broken.
    • The node on which the client process resides has gone down.
    • The client processes has done some illegal operation.

    If an exit signal is received as above, the tuple {From,Name} is deleted from │ │ │ the servers User_List using the server_logoff function. If the node on which │ │ │ the server runs goes down, an exit signal (automatically generated by the │ │ │ system) is sent to all of the client processes: │ │ │ {'EXIT',MessengerPID,noconnection} causing all the client processes to │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/seq_prog.html │ │ │ @@ -136,293 +136,293 @@ │ │ │ 7 │ │ │ 2>

    As shown, the Erlang shell numbers the lines that can be entered, (as 1> 2>) and │ │ │ that it correctly says that 2 + 5 is 7. If you make writing mistakes in the │ │ │ shell, you can delete with the backspace key, as in most shells. There are many │ │ │ more editing commands in the shell (see │ │ │ tty - A command line interface in ERTS User's Guide).

    (Notice that many line numbers given by the shell in the following examples are │ │ │ out of sequence. This is because this tutorial was written and code-tested in │ │ │ -separate sessions).

    Here is a bit more complex calculation:

    2> (42 + 77) * 66 / 3.
    │ │ │ +separate sessions).

    Here is a bit more complex calculation:

    2> (42 + 77) * 66 / 3.
    │ │ │  2618.0

    Notice the use of brackets, the multiplication operator *, and the division │ │ │ operator /, as in normal arithmetic (see │ │ │ Expressions).

    Press Control-C to shut down the Erlang system and the Erlang shell.

    The following output is shown:

    BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
    │ │ │         (v)ersion (k)ill (D)b-tables (d)istribution
    │ │ │  a
    │ │ │ -$

    Type a to leave the Erlang system.

    Another way to shut down the Erlang system is by entering halt/0:

    3> halt().
    │ │ │ +$

    Type a to leave the Erlang system.

    Another way to shut down the Erlang system is by entering halt/0:

    3> halt().
    │ │ │  $

    │ │ │ │ │ │ │ │ │ │ │ │ Modules and Functions │ │ │

    │ │ │

    A programming language is not much use if you only can run code from the shell. │ │ │ So here is a small Erlang program. Enter it into a file named tut.erl using a │ │ │ suitable text editor. The file name tut.erl is important, and also that it is │ │ │ in the same directory as the one where you started erl). If you are lucky your │ │ │ editor has an Erlang mode that makes it easier for you to enter and format your │ │ │ code nicely (see The Erlang mode for Emacs │ │ │ in Tools User's Guide), but you can manage perfectly well without. Here is the │ │ │ -code to enter:

    -module(tut).
    │ │ │ --export([double/1]).
    │ │ │ +code to enter:

    -module(tut).
    │ │ │ +-export([double/1]).
    │ │ │  
    │ │ │ -double(X) ->
    │ │ │ +double(X) ->
    │ │ │      2 * X.

    It is not hard to guess that this program doubles the value of numbers. The │ │ │ first two lines of the code are described later. Let us compile the program. │ │ │ -This can be done in an Erlang shell as follows, where c means compile:

    3> c(tut).
    │ │ │ -{ok,tut}

    The {ok,tut} means that the compilation is OK. If it says error it means │ │ │ +This can be done in an Erlang shell as follows, where c means compile:

    3> c(tut).
    │ │ │ +{ok,tut}

    The {ok,tut} means that the compilation is OK. If it says error it means │ │ │ that there is some mistake in the text that you entered. Additional error │ │ │ messages gives an idea to what is wrong so you can modify the text and then try │ │ │ -to compile the program again.

    Now run the program:

    4> tut:double(10).
    │ │ │ +to compile the program again.

    Now run the program:

    4> tut:double(10).
    │ │ │  20

    As expected, double of 10 is 20.

    Now let us get back to the first two lines of the code. Erlang programs are │ │ │ written in files. Each file contains an Erlang module. The first line of code │ │ │ -in the module is the module name (see Modules):

    -module(tut).

    Thus, the module is called tut. Notice the full stop . at the end of the │ │ │ +in the module is the module name (see Modules):

    -module(tut).

    Thus, the module is called tut. Notice the full stop . at the end of the │ │ │ line. The files which are used to store the module must have the same name as │ │ │ the module but with the extension .erl. In this case the file name is │ │ │ tut.erl. When using a function in another module, the syntax │ │ │ module_name:function_name(arguments) is used. So the following means call │ │ │ -function double in module tut with argument 10.

    4> tut:double(10).

    The second line says that the module tut contains a function called double, │ │ │ -which takes one argument (X in our example):

    -export([double/1]).

    The second line also says that this function can be called from outside the │ │ │ +function double in module tut with argument 10.

    4> tut:double(10).

    The second line says that the module tut contains a function called double, │ │ │ +which takes one argument (X in our example):

    -export([double/1]).

    The second line also says that this function can be called from outside the │ │ │ module tut. More about this later. Again, notice the . at the end of the │ │ │ line.

    Now for a more complicated example, the factorial of a number. For example, the │ │ │ -factorial of 4 is 4 3 2 * 1, which equals 24.

    Enter the following code in a file named tut1.erl:

    -module(tut1).
    │ │ │ --export([fac/1]).
    │ │ │ +factorial of 4 is 4  3  2 * 1, which equals 24.

    Enter the following code in a file named tut1.erl:

    -module(tut1).
    │ │ │ +-export([fac/1]).
    │ │ │  
    │ │ │ -fac(1) ->
    │ │ │ +fac(1) ->
    │ │ │      1;
    │ │ │ -fac(N) ->
    │ │ │ -    N * fac(N - 1).

    So this is a module, called tut1 that contains a function called fac>, which │ │ │ -takes one argument, N.

    The first part says that the factorial of 1 is 1.:

    fac(1) ->
    │ │ │ +fac(N) ->
    │ │ │ +    N * fac(N - 1).

    So this is a module, called tut1 that contains a function called fac>, which │ │ │ +takes one argument, N.

    The first part says that the factorial of 1 is 1.:

    fac(1) ->
    │ │ │      1;

    Notice that this part ends with a semicolon ; that indicates that there is │ │ │ more of the function fac> to come.

    The second part says that the factorial of N is N multiplied by the factorial of │ │ │ -N - 1:

    fac(N) ->
    │ │ │ -    N * fac(N - 1).

    Notice that this part ends with a . saying that there are no more parts of │ │ │ -this function.

    Compile the file:

    5> c(tut1).
    │ │ │ -{ok,tut1}

    And now calculate the factorial of 4.

    6> tut1:fac(4).
    │ │ │ +N - 1:

    fac(N) ->
    │ │ │ +    N * fac(N - 1).

    Notice that this part ends with a . saying that there are no more parts of │ │ │ +this function.

    Compile the file:

    5> c(tut1).
    │ │ │ +{ok,tut1}

    And now calculate the factorial of 4.

    6> tut1:fac(4).
    │ │ │  24

    Here the function fac> in module tut1 is called with argument 4.

    A function can have many arguments. Let us expand the module tut1 with the │ │ │ -function to multiply two numbers:

    -module(tut1).
    │ │ │ --export([fac/1, mult/2]).
    │ │ │ +function to multiply two numbers:

    -module(tut1).
    │ │ │ +-export([fac/1, mult/2]).
    │ │ │  
    │ │ │ -fac(1) ->
    │ │ │ +fac(1) ->
    │ │ │      1;
    │ │ │ -fac(N) ->
    │ │ │ -    N * fac(N - 1).
    │ │ │ +fac(N) ->
    │ │ │ +    N * fac(N - 1).
    │ │ │  
    │ │ │ -mult(X, Y) ->
    │ │ │ +mult(X, Y) ->
    │ │ │      X * Y.

    Notice that it is also required to expand the -export line with the │ │ │ -information that there is another function mult with two arguments.

    Compile:

    7> c(tut1).
    │ │ │ -{ok,tut1}

    Try out the new function mult:

    8> tut1:mult(3,4).
    │ │ │ +information that there is another function mult with two arguments.

    Compile:

    7> c(tut1).
    │ │ │ +{ok,tut1}

    Try out the new function mult:

    8> tut1:mult(3,4).
    │ │ │  12

    In this example the numbers are integers and the arguments in the functions in │ │ │ the code N, X, and Y are called variables. Variables must start with a │ │ │ capital letter (see Variables). Examples of │ │ │ variables are Number, ShoeSize, and Age.

    │ │ │ │ │ │ │ │ │ │ │ │ Atoms │ │ │

    │ │ │

    Atom is another data type in Erlang. Atoms start with a small letter (see │ │ │ Atom), for example, charles, centimeter, and │ │ │ inch. Atoms are simply names, nothing else. They are not like variables, which │ │ │ can have a value.

    Enter the next program in a file named tut2.erl). It can be useful for │ │ │ -converting from inches to centimeters and conversely:

    -module(tut2).
    │ │ │ --export([convert/2]).
    │ │ │ +converting from inches to centimeters and conversely:

    -module(tut2).
    │ │ │ +-export([convert/2]).
    │ │ │  
    │ │ │ -convert(M, inch) ->
    │ │ │ +convert(M, inch) ->
    │ │ │      M / 2.54;
    │ │ │  
    │ │ │ -convert(N, centimeter) ->
    │ │ │ -    N * 2.54.

    Compile:

    9> c(tut2).
    │ │ │ -{ok,tut2}

    Test:

    10> tut2:convert(3, inch).
    │ │ │ +convert(N, centimeter) ->
    │ │ │ +    N * 2.54.

    Compile:

    9> c(tut2).
    │ │ │ +{ok,tut2}

    Test:

    10> tut2:convert(3, inch).
    │ │ │  1.1811023622047243
    │ │ │ -11> tut2:convert(7, centimeter).
    │ │ │ +11> tut2:convert(7, centimeter).
    │ │ │  17.78

    Notice the introduction of decimals (floating point numbers) without any │ │ │ explanation. Hopefully you can cope with that.

    Let us see what happens if something other than centimeter or inch is │ │ │ -entered in the convert function:

    12> tut2:convert(3, miles).
    │ │ │ +entered in the convert function:

    12> tut2:convert(3, miles).
    │ │ │  ** exception error: no function clause matching tut2:convert(3,miles) (tut2.erl, line 4)

    The two parts of the convert function are called its clauses. As shown, │ │ │ miles is not part of either of the clauses. The Erlang system cannot match │ │ │ either of the clauses so an error message function_clause is returned. The │ │ │ shell formats the error message nicely, but the error tuple is saved in the │ │ │ -shell's history list and can be output by the shell command v/1:

    13> v(12).
    │ │ │ -{'EXIT',{function_clause,[{tut2,convert,
    │ │ │ -                                [3,miles],
    │ │ │ -                                [{file,"tut2.erl"},{line,4}]},
    │ │ │ -                          {erl_eval,do_apply,6,
    │ │ │ -                                    [{file,"erl_eval.erl"},{line,677}]},
    │ │ │ -                          {shell,exprs,7,[{file,"shell.erl"},{line,687}]},
    │ │ │ -                          {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]},
    │ │ │ -                          {shell,eval_loop,3,
    │ │ │ -                                 [{file,"shell.erl"},{line,627}]}]}}

    │ │ │ +shell's history list and can be output by the shell command v/1:

    13> v(12).
    │ │ │ +{'EXIT',{function_clause,[{tut2,convert,
    │ │ │ +                                [3,miles],
    │ │ │ +                                [{file,"tut2.erl"},{line,4}]},
    │ │ │ +                          {erl_eval,do_apply,6,
    │ │ │ +                                    [{file,"erl_eval.erl"},{line,677}]},
    │ │ │ +                          {shell,exprs,7,[{file,"shell.erl"},{line,687}]},
    │ │ │ +                          {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]},
    │ │ │ +                          {shell,eval_loop,3,
    │ │ │ +                                 [{file,"shell.erl"},{line,627}]}]}}

    │ │ │ │ │ │ │ │ │ │ │ │ Tuples │ │ │

    │ │ │ -

    Now the tut2 program is hardly good programming style. Consider:

    tut2:convert(3, inch).

    Does this mean that 3 is in inches? Or does it mean that 3 is in centimeters and │ │ │ +

    Now the tut2 program is hardly good programming style. Consider:

    tut2:convert(3, inch).

    Does this mean that 3 is in inches? Or does it mean that 3 is in centimeters and │ │ │ is to be converted to inches? Erlang has a way to group things together to make │ │ │ things more understandable. These are called tuples and are surrounded by │ │ │ curly brackets, { and }.

    So, {inch,3} denotes 3 inches and {centimeter,5} denotes 5 centimeters. Now │ │ │ let us write a new program that converts centimeters to inches and conversely. │ │ │ -Enter the following code in a file called tut3.erl):

    -module(tut3).
    │ │ │ --export([convert_length/1]).
    │ │ │ +Enter the following code in a file called tut3.erl):

    -module(tut3).
    │ │ │ +-export([convert_length/1]).
    │ │ │  
    │ │ │ -convert_length({centimeter, X}) ->
    │ │ │ -    {inch, X / 2.54};
    │ │ │ -convert_length({inch, Y}) ->
    │ │ │ -    {centimeter, Y * 2.54}.

    Compile and test:

    14> c(tut3).
    │ │ │ -{ok,tut3}
    │ │ │ -15> tut3:convert_length({inch, 5}).
    │ │ │ -{centimeter,12.7}
    │ │ │ -16> tut3:convert_length(tut3:convert_length({inch, 5})).
    │ │ │ -{inch,5.0}

    Notice on line 16 that 5 inches is converted to centimeters and back again and │ │ │ +convert_length({centimeter, X}) -> │ │ │ + {inch, X / 2.54}; │ │ │ +convert_length({inch, Y}) -> │ │ │ + {centimeter, Y * 2.54}.

    Compile and test:

    14> c(tut3).
    │ │ │ +{ok,tut3}
    │ │ │ +15> tut3:convert_length({inch, 5}).
    │ │ │ +{centimeter,12.7}
    │ │ │ +16> tut3:convert_length(tut3:convert_length({inch, 5})).
    │ │ │ +{inch,5.0}

    Notice on line 16 that 5 inches is converted to centimeters and back again and │ │ │ reassuringly get back to the original value. That is, the argument to a function │ │ │ can be the result of another function. Consider how line 16 (above) works. The │ │ │ argument given to the function {inch,5} is first matched against the first │ │ │ head clause of convert_length, that is, convert_length({centimeter,X}). It │ │ │ can be seen that {centimeter,X} does not match {inch,5} (the head is the bit │ │ │ before the ->). This having failed, let us try the head of the next clause │ │ │ that is, convert_length({inch,Y}). This matches, and Y gets the value 5.

    Tuples can have more than two parts, in fact as many parts as you want, and │ │ │ contain any valid Erlang term. For example, to represent the temperature of │ │ │ -various cities of the world:

    {moscow, {c, -10}}
    │ │ │ -{cape_town, {f, 70}}
    │ │ │ -{paris, {f, 28}}

    Tuples have a fixed number of items in them. Each item in a tuple is called an │ │ │ +various cities of the world:

    {moscow, {c, -10}}
    │ │ │ +{cape_town, {f, 70}}
    │ │ │ +{paris, {f, 28}}

    Tuples have a fixed number of items in them. Each item in a tuple is called an │ │ │ element. In the tuple {moscow,{c,-10}}, element 1 is moscow and element 2 │ │ │ is {c,-10}. Here c represents Celsius and f Fahrenheit.

    │ │ │ │ │ │ │ │ │ │ │ │ Lists │ │ │

    │ │ │

    Whereas tuples group things together, it is also needed to represent lists of │ │ │ things. Lists in Erlang are surrounded by square brackets, [ and ]. For │ │ │ -example, a list of the temperatures of various cities in the world can be:

    [{moscow, {c, -10}}, {cape_town, {f, 70}}, {stockholm, {c, -4}},
    │ │ │ - {paris, {f, 28}}, {london, {f, 36}}]

    Notice that this list was so long that it did not fit on one line. This does not │ │ │ +example, a list of the temperatures of various cities in the world can be:

    [{moscow, {c, -10}}, {cape_town, {f, 70}}, {stockholm, {c, -4}},
    │ │ │ + {paris, {f, 28}}, {london, {f, 36}}]

    Notice that this list was so long that it did not fit on one line. This does not │ │ │ matter, Erlang allows line breaks at all "sensible places" but not, for example, │ │ │ in the middle of atoms, integers, and others.

    A useful way of looking at parts of lists, is by using |. This is best │ │ │ -explained by an example using the shell:

    17> [First |TheRest] = [1,2,3,4,5].
    │ │ │ -[1,2,3,4,5]
    │ │ │ +explained by an example using the shell:

    17> [First |TheRest] = [1,2,3,4,5].
    │ │ │ +[1,2,3,4,5]
    │ │ │  18> First.
    │ │ │  1
    │ │ │  19> TheRest.
    │ │ │ -[2,3,4,5]

    To separate the first elements of the list from the rest of the list, | is │ │ │ -used. First has got value 1 and TheRest has got the value [2,3,4,5].

    Another example:

    20> [E1, E2 | R] = [1,2,3,4,5,6,7].
    │ │ │ -[1,2,3,4,5,6,7]
    │ │ │ +[2,3,4,5]

    To separate the first elements of the list from the rest of the list, | is │ │ │ +used. First has got value 1 and TheRest has got the value [2,3,4,5].

    Another example:

    20> [E1, E2 | R] = [1,2,3,4,5,6,7].
    │ │ │ +[1,2,3,4,5,6,7]
    │ │ │  21> E1.
    │ │ │  1
    │ │ │  22> E2.
    │ │ │  2
    │ │ │  23> R.
    │ │ │ -[3,4,5,6,7]

    Here you see the use of | to get the first two elements from the list. If you │ │ │ +[3,4,5,6,7]

    Here you see the use of | to get the first two elements from the list. If you │ │ │ try to get more elements from the list than there are elements in the list, an │ │ │ error is returned. Notice also the special case of the list with no elements, │ │ │ -[]:

    24> [A, B | C] = [1, 2].
    │ │ │ -[1,2]
    │ │ │ +[]:

    24> [A, B | C] = [1, 2].
    │ │ │ +[1,2]
    │ │ │  25> A.
    │ │ │  1
    │ │ │  26> B.
    │ │ │  2
    │ │ │  27> C.
    │ │ │ -[]

    In the previous examples, new variable names are used, instead of reusing the │ │ │ +[]

    In the previous examples, new variable names are used, instead of reusing the │ │ │ old ones: First, TheRest, E1, E2, R, A, B, and C. The reason for │ │ │ this is that a variable can only be given a value once in its context (scope). │ │ │ More about this later.

    The following example shows how to find the length of a list. Enter the │ │ │ -following code in a file named tut4.erl:

    -module(tut4).
    │ │ │ +following code in a file named tut4.erl:

    -module(tut4).
    │ │ │  
    │ │ │ --export([list_length/1]).
    │ │ │ +-export([list_length/1]).
    │ │ │  
    │ │ │ -list_length([]) ->
    │ │ │ +list_length([]) ->
    │ │ │      0;
    │ │ │ -list_length([First | Rest]) ->
    │ │ │ -    1 + list_length(Rest).

    Compile and test:

    28> c(tut4).
    │ │ │ -{ok,tut4}
    │ │ │ -29> tut4:list_length([1,2,3,4,5,6,7]).
    │ │ │ -7

    Explanation:

    list_length([]) ->
    │ │ │ -    0;

    The length of an empty list is obviously 0.

    list_length([First | Rest]) ->
    │ │ │ -    1 + list_length(Rest).

    The length of a list with the first element First and the remaining elements │ │ │ +list_length([First | Rest]) -> │ │ │ + 1 + list_length(Rest).

    Compile and test:

    28> c(tut4).
    │ │ │ +{ok,tut4}
    │ │ │ +29> tut4:list_length([1,2,3,4,5,6,7]).
    │ │ │ +7

    Explanation:

    list_length([]) ->
    │ │ │ +    0;

    The length of an empty list is obviously 0.

    list_length([First | Rest]) ->
    │ │ │ +    1 + list_length(Rest).

    The length of a list with the first element First and the remaining elements │ │ │ Rest is 1 + the length of Rest.

    (Advanced readers only: This is not tail recursive, there is a better way to │ │ │ write this function.)

    In general, tuples are used where "records" or "structs" are used in other │ │ │ languages. Also, lists are used when representing things with varying sizes, │ │ │ that is, where linked lists are used in other languages.

    Erlang does not have a string data type. Instead, strings can be represented by │ │ │ lists of Unicode characters. This implies for example that the list [97,98,99] │ │ │ is equivalent to "abc". The Erlang shell is "clever" and guesses what list you │ │ │ -mean and outputs it in what it thinks is the most appropriate form, for example:

    30> [97,98,99].
    │ │ │ +mean and outputs it in what it thinks is the most appropriate form, for example:

    30> [97,98,99].
    │ │ │  "abc"

    │ │ │ │ │ │ │ │ │ │ │ │ Maps │ │ │

    │ │ │

    Maps are a set of key to value associations. These associations are encapsulated │ │ │ -with #{ and }. To create an association from "key" to value 42:

    > #{ "key" => 42 }.
    │ │ │ -#{"key" => 42}

    Let us jump straight into the deep end with an example using some interesting │ │ │ +with #{ and }. To create an association from "key" to value 42:

    > #{ "key" => 42 }.
    │ │ │ +#{"key" => 42}

    Let us jump straight into the deep end with an example using some interesting │ │ │ features.

    The following example shows how to calculate alpha blending using maps to │ │ │ -reference color and alpha channels. Enter the code in a file named color.erl):

    -module(color).
    │ │ │ +reference color and alpha channels. Enter the code in a file named color.erl):

    -module(color).
    │ │ │  
    │ │ │ --export([new/4, blend/2]).
    │ │ │ +-export([new/4, blend/2]).
    │ │ │  
    │ │ │ --define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).
    │ │ │ +-define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).
    │ │ │  
    │ │ │ -new(R,G,B,A) when ?is_channel(R), ?is_channel(G),
    │ │ │ -                  ?is_channel(B), ?is_channel(A) ->
    │ │ │ -    #{red => R, green => G, blue => B, alpha => A}.
    │ │ │ -
    │ │ │ -blend(Src,Dst) ->
    │ │ │ -    blend(Src,Dst,alpha(Src,Dst)).
    │ │ │ -
    │ │ │ -blend(Src,Dst,Alpha) when Alpha > 0.0 ->
    │ │ │ -    Dst#{
    │ │ │ -        red   := red(Src,Dst) / Alpha,
    │ │ │ -        green := green(Src,Dst) / Alpha,
    │ │ │ -        blue  := blue(Src,Dst) / Alpha,
    │ │ │ +new(R,G,B,A) when ?is_channel(R), ?is_channel(G),
    │ │ │ +                  ?is_channel(B), ?is_channel(A) ->
    │ │ │ +    #{red => R, green => G, blue => B, alpha => A}.
    │ │ │ +
    │ │ │ +blend(Src,Dst) ->
    │ │ │ +    blend(Src,Dst,alpha(Src,Dst)).
    │ │ │ +
    │ │ │ +blend(Src,Dst,Alpha) when Alpha > 0.0 ->
    │ │ │ +    Dst#{
    │ │ │ +        red   := red(Src,Dst) / Alpha,
    │ │ │ +        green := green(Src,Dst) / Alpha,
    │ │ │ +        blue  := blue(Src,Dst) / Alpha,
    │ │ │          alpha := Alpha
    │ │ │ -    };
    │ │ │ -blend(_,Dst,_) ->
    │ │ │ -    Dst#{
    │ │ │ +    };
    │ │ │ +blend(_,Dst,_) ->
    │ │ │ +    Dst#{
    │ │ │          red   := 0.0,
    │ │ │          green := 0.0,
    │ │ │          blue  := 0.0,
    │ │ │          alpha := 0.0
    │ │ │ -    }.
    │ │ │ +    }.
    │ │ │  
    │ │ │ -alpha(#{alpha := SA}, #{alpha := DA}) ->
    │ │ │ -    SA + DA*(1.0 - SA).
    │ │ │ +alpha(#{alpha := SA}, #{alpha := DA}) ->
    │ │ │ +    SA + DA*(1.0 - SA).
    │ │ │  
    │ │ │ -red(#{red := SV, alpha := SA}, #{red := DV, alpha := DA}) ->
    │ │ │ -    SV*SA + DV*DA*(1.0 - SA).
    │ │ │ -green(#{green := SV, alpha := SA}, #{green := DV, alpha := DA}) ->
    │ │ │ -    SV*SA + DV*DA*(1.0 - SA).
    │ │ │ -blue(#{blue := SV, alpha := SA}, #{blue := DV, alpha := DA}) ->
    │ │ │ -    SV*SA + DV*DA*(1.0 - SA).

    Compile and test:

    > c(color).
    │ │ │ -{ok,color}
    │ │ │ -> C1 = color:new(0.3,0.4,0.5,1.0).
    │ │ │ -#{alpha => 1.0,blue => 0.5,green => 0.4,red => 0.3}
    │ │ │ -> C2 = color:new(1.0,0.8,0.1,0.3).
    │ │ │ -#{alpha => 0.3,blue => 0.1,green => 0.8,red => 1.0}
    │ │ │ -> color:blend(C1,C2).
    │ │ │ -#{alpha => 1.0,blue => 0.5,green => 0.4,red => 0.3}
    │ │ │ -> color:blend(C2,C1).
    │ │ │ -#{alpha => 1.0,blue => 0.38,green => 0.52,red => 0.51}

    This example warrants some explanation:

    -define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).

    First a macro is_channel is defined to help with the guard tests. This is only │ │ │ +red(#{red := SV, alpha := SA}, #{red := DV, alpha := DA}) -> │ │ │ + SV*SA + DV*DA*(1.0 - SA). │ │ │ +green(#{green := SV, alpha := SA}, #{green := DV, alpha := DA}) -> │ │ │ + SV*SA + DV*DA*(1.0 - SA). │ │ │ +blue(#{blue := SV, alpha := SA}, #{blue := DV, alpha := DA}) -> │ │ │ + SV*SA + DV*DA*(1.0 - SA).

    Compile and test:

    > c(color).
    │ │ │ +{ok,color}
    │ │ │ +> C1 = color:new(0.3,0.4,0.5,1.0).
    │ │ │ +#{alpha => 1.0,blue => 0.5,green => 0.4,red => 0.3}
    │ │ │ +> C2 = color:new(1.0,0.8,0.1,0.3).
    │ │ │ +#{alpha => 0.3,blue => 0.1,green => 0.8,red => 1.0}
    │ │ │ +> color:blend(C1,C2).
    │ │ │ +#{alpha => 1.0,blue => 0.5,green => 0.4,red => 0.3}
    │ │ │ +> color:blend(C2,C1).
    │ │ │ +#{alpha => 1.0,blue => 0.38,green => 0.52,red => 0.51}

    This example warrants some explanation:

    -define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).

    First a macro is_channel is defined to help with the guard tests. This is only │ │ │ here for convenience and to reduce syntax cluttering. For more information about │ │ │ -macros, see The Preprocessor.

    new(R,G,B,A) when ?is_channel(R), ?is_channel(G),
    │ │ │ -                  ?is_channel(B), ?is_channel(A) ->
    │ │ │ -    #{red => R, green => G, blue => B, alpha => A}.

    The function new/4 creates a new map term and lets the keys red, green, │ │ │ +macros, see The Preprocessor.

    new(R,G,B,A) when ?is_channel(R), ?is_channel(G),
    │ │ │ +                  ?is_channel(B), ?is_channel(A) ->
    │ │ │ +    #{red => R, green => G, blue => B, alpha => A}.

    The function new/4 creates a new map term and lets the keys red, green, │ │ │ blue, and alpha be associated with an initial value. In this case, only │ │ │ float values between and including 0.0 and 1.0 are allowed, as ensured by the │ │ │ ?is_channel/1 macro for each argument. Only the => operator is allowed when │ │ │ creating a new map.

    By calling blend/2 on any color term created by new/4, the resulting color │ │ │ -can be calculated as determined by the two map terms.

    The first thing blend/2 does is to calculate the resulting alpha channel:

    alpha(#{alpha := SA}, #{alpha := DA}) ->
    │ │ │ -    SA + DA*(1.0 - SA).

    The value associated with key alpha is fetched for both arguments using the │ │ │ +can be calculated as determined by the two map terms.

    The first thing blend/2 does is to calculate the resulting alpha channel:

    alpha(#{alpha := SA}, #{alpha := DA}) ->
    │ │ │ +    SA + DA*(1.0 - SA).

    The value associated with key alpha is fetched for both arguments using the │ │ │ := operator. The other keys in the map are ignored, only the key alpha is │ │ │ -required and checked for.

    This is also the case for functions red/2, blue/2, and green/2.

    red(#{red := SV, alpha := SA}, #{red := DV, alpha := DA}) ->
    │ │ │ -    SV*SA + DV*DA*(1.0 - SA).

    The difference here is that a check is made for two keys in each map argument. │ │ │ -The other keys are ignored.

    Finally, let us return the resulting color in blend/3:

    blend(Src,Dst,Alpha) when Alpha > 0.0 ->
    │ │ │ -    Dst#{
    │ │ │ -        red   := red(Src,Dst) / Alpha,
    │ │ │ -        green := green(Src,Dst) / Alpha,
    │ │ │ -        blue  := blue(Src,Dst) / Alpha,
    │ │ │ +required and checked for.

    This is also the case for functions red/2, blue/2, and green/2.

    red(#{red := SV, alpha := SA}, #{red := DV, alpha := DA}) ->
    │ │ │ +    SV*SA + DV*DA*(1.0 - SA).

    The difference here is that a check is made for two keys in each map argument. │ │ │ +The other keys are ignored.

    Finally, let us return the resulting color in blend/3:

    blend(Src,Dst,Alpha) when Alpha > 0.0 ->
    │ │ │ +    Dst#{
    │ │ │ +        red   := red(Src,Dst) / Alpha,
    │ │ │ +        green := green(Src,Dst) / Alpha,
    │ │ │ +        blue  := blue(Src,Dst) / Alpha,
    │ │ │          alpha := Alpha
    │ │ │ -    };

    The Dst map is updated with new channel values. The syntax for updating an │ │ │ + };

    The Dst map is updated with new channel values. The syntax for updating an │ │ │ existing key with a new value is with the := operator.

    │ │ │ │ │ │ │ │ │ │ │ │ Standard Modules and Manual Pages │ │ │

    │ │ │

    Erlang has many standard modules to help you do things. For example, the module │ │ │ @@ -442,24 +442,24 @@ │ │ │ │ │ │ │ │ │ │ │ │ Writing Output to a Terminal │ │ │

    │ │ │

    It is nice to be able to do formatted output in examples, so the next example │ │ │ shows a simple way to use the io:format/2 function. Like all other exported │ │ │ -functions, you can test the io:format/2 function in the shell:

    31> io:format("hello world~n", []).
    │ │ │ +functions, you can test the io:format/2 function in the shell:

    31> io:format("hello world~n", []).
    │ │ │  hello world
    │ │ │  ok
    │ │ │ -32> io:format("this outputs one Erlang term: ~w~n", [hello]).
    │ │ │ +32> io:format("this outputs one Erlang term: ~w~n", [hello]).
    │ │ │  this outputs one Erlang term: hello
    │ │ │  ok
    │ │ │ -33> io:format("this outputs two Erlang terms: ~w~w~n", [hello, world]).
    │ │ │ +33> io:format("this outputs two Erlang terms: ~w~w~n", [hello, world]).
    │ │ │  this outputs two Erlang terms: helloworld
    │ │ │  ok
    │ │ │ -34> io:format("this outputs two Erlang terms: ~w ~w~n", [hello, world]).
    │ │ │ +34> io:format("this outputs two Erlang terms: ~w ~w~n", [hello, world]).
    │ │ │  this outputs two Erlang terms: hello world
    │ │ │  ok

    The function io:format/2 (that is, format with two arguments) takes two lists. │ │ │ The first one is nearly always a list written between " ". This list is printed │ │ │ out as it is, except that each ~w is replaced by a term taken in order from the │ │ │ second list. Each ~n is replaced by a new line. The io:format/2 function │ │ │ itself returns the atom ok if everything goes as planned. Like other functions │ │ │ in Erlang, it crashes if an error occurs. This is not a fault in Erlang, it is a │ │ │ @@ -473,34 +473,34 @@ │ │ │ A Larger Example │ │ │ │ │ │

    Now for a larger example to consolidate what you have learnt so far. Assume that │ │ │ you have a list of temperature readings from a number of cities in the world. │ │ │ Some of them are in Celsius and some in Fahrenheit (as in the previous list). │ │ │ First let us convert them all to Celsius, then let us print the data neatly.

    %% This module is in file tut5.erl
    │ │ │  
    │ │ │ --module(tut5).
    │ │ │ --export([format_temps/1]).
    │ │ │ +-module(tut5).
    │ │ │ +-export([format_temps/1]).
    │ │ │  
    │ │ │  %% Only this function is exported
    │ │ │ -format_temps([])->                        % No output for an empty list
    │ │ │ +format_temps([])->                        % No output for an empty list
    │ │ │      ok;
    │ │ │ -format_temps([City | Rest]) ->
    │ │ │ -    print_temp(convert_to_celsius(City)),
    │ │ │ -    format_temps(Rest).
    │ │ │ -
    │ │ │ -convert_to_celsius({Name, {c, Temp}}) ->  % No conversion needed
    │ │ │ -    {Name, {c, Temp}};
    │ │ │ -convert_to_celsius({Name, {f, Temp}}) ->  % Do the conversion
    │ │ │ -    {Name, {c, (Temp - 32) * 5 / 9}}.
    │ │ │ -
    │ │ │ -print_temp({Name, {c, Temp}}) ->
    │ │ │ -    io:format("~-15w ~w c~n", [Name, Temp]).
    35> c(tut5).
    │ │ │ -{ok,tut5}
    │ │ │ -36> tut5:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ +format_temps([City | Rest]) ->
    │ │ │ +    print_temp(convert_to_celsius(City)),
    │ │ │ +    format_temps(Rest).
    │ │ │ +
    │ │ │ +convert_to_celsius({Name, {c, Temp}}) ->  % No conversion needed
    │ │ │ +    {Name, {c, Temp}};
    │ │ │ +convert_to_celsius({Name, {f, Temp}}) ->  % Do the conversion
    │ │ │ +    {Name, {c, (Temp - 32) * 5 / 9}}.
    │ │ │ +
    │ │ │ +print_temp({Name, {c, Temp}}) ->
    │ │ │ +    io:format("~-15w ~w c~n", [Name, Temp]).
    35> c(tut5).
    │ │ │ +{ok,tut5}
    │ │ │ +36> tut5:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │  moscow          -10 c
    │ │ │  cape_town       21.11111111111111 c
    │ │ │  stockholm       -4 c
    │ │ │  paris           -2.2222222222222223 c
    │ │ │  london          2.2222222222222223 c
    │ │ │  ok

    Before looking at how this program works, notice that a few comments are added │ │ │ to the code. A comment starts with a %-character and goes on to the end of the │ │ │ @@ -528,28 +528,28 @@ │ │ │ │ │ │ │ │ │ │ │ │ Matching, Guards, and Scope of Variables │ │ │ │ │ │

    It can be useful to find the maximum and minimum temperature in lists like this. │ │ │ Before extending the program to do this, let us look at functions for finding │ │ │ -the maximum value of the elements in a list:

    -module(tut6).
    │ │ │ --export([list_max/1]).
    │ │ │ +the maximum value of the elements in a list:

    -module(tut6).
    │ │ │ +-export([list_max/1]).
    │ │ │  
    │ │ │ -list_max([Head|Rest]) ->
    │ │ │ -   list_max(Rest, Head).
    │ │ │ +list_max([Head|Rest]) ->
    │ │ │ +   list_max(Rest, Head).
    │ │ │  
    │ │ │ -list_max([], Res) ->
    │ │ │ +list_max([], Res) ->
    │ │ │      Res;
    │ │ │ -list_max([Head|Rest], Result_so_far) when Head > Result_so_far ->
    │ │ │ -    list_max(Rest, Head);
    │ │ │ -list_max([Head|Rest], Result_so_far)  ->
    │ │ │ -    list_max(Rest, Result_so_far).
    37> c(tut6).
    │ │ │ -{ok,tut6}
    │ │ │ -38> tut6:list_max([1,2,3,4,5,7,4,3,2,1]).
    │ │ │ +list_max([Head|Rest], Result_so_far) when Head > Result_so_far ->
    │ │ │ +    list_max(Rest, Head);
    │ │ │ +list_max([Head|Rest], Result_so_far)  ->
    │ │ │ +    list_max(Rest, Result_so_far).
    37> c(tut6).
    │ │ │ +{ok,tut6}
    │ │ │ +38> tut6:list_max([1,2,3,4,5,7,4,3,2,1]).
    │ │ │  7

    First notice that two functions have the same name, list_max. However, each of │ │ │ these takes a different number of arguments (parameters). In Erlang these are │ │ │ regarded as completely different functions. Where you need to distinguish │ │ │ between these functions, you write Name/Arity, where Name is the function name │ │ │ and Arity is the number of arguments, in this case list_max/1 and │ │ │ list_max/2.

    In this example you walk through a list "carrying" a value, in this case │ │ │ Result_so_far. list_max/1 simply assumes that the max value of the list is │ │ │ @@ -578,180 +578,180 @@ │ │ │ 5 │ │ │ 40> M = 6. │ │ │ ** exception error: no match of right hand side value 6 │ │ │ 41> M = M + 1. │ │ │ ** exception error: no match of right hand side value 6 │ │ │ 42> N = M + 1. │ │ │ 6

    The use of the match operator is particularly useful for pulling apart Erlang │ │ │ -terms and creating new ones.

    43> {X, Y} = {paris, {f, 28}}.
    │ │ │ -{paris,{f,28}}
    │ │ │ +terms and creating new ones.

    43> {X, Y} = {paris, {f, 28}}.
    │ │ │ +{paris,{f,28}}
    │ │ │  44> X.
    │ │ │  paris
    │ │ │  45> Y.
    │ │ │ -{f,28}

    Here X gets the value paris and Y the value {f,28}.

    If you try to do the same again with another city, an error is returned:

    46> {X, Y} = {london, {f, 36}}.
    │ │ │ +{f,28}

    Here X gets the value paris and Y the value {f,28}.

    If you try to do the same again with another city, an error is returned:

    46> {X, Y} = {london, {f, 36}}.
    │ │ │  ** exception error: no match of right hand side value {london,{f,36}}

    Variables can also be used to improve the readability of programs. For example, │ │ │ -in function list_max/2 above, you can write:

    list_max([Head|Rest], Result_so_far) when Head > Result_so_far ->
    │ │ │ +in function list_max/2 above, you can write:

    list_max([Head|Rest], Result_so_far) when Head > Result_so_far ->
    │ │ │      New_result_far = Head,
    │ │ │ -    list_max(Rest, New_result_far);

    This is possibly a little clearer.

    │ │ │ + list_max(Rest, New_result_far);

    This is possibly a little clearer.

    │ │ │ │ │ │ │ │ │ │ │ │ More About Lists │ │ │

    │ │ │ -

    Remember that the | operator can be used to get the head of a list:

    47> [M1|T1] = [paris, london, rome].
    │ │ │ -[paris,london,rome]
    │ │ │ +

    Remember that the | operator can be used to get the head of a list:

    47> [M1|T1] = [paris, london, rome].
    │ │ │ +[paris,london,rome]
    │ │ │  48> M1.
    │ │ │  paris
    │ │ │  49> T1.
    │ │ │ -[london,rome]

    The | operator can also be used to add a head to a list:

    50> L1 = [madrid | T1].
    │ │ │ -[madrid,london,rome]
    │ │ │ +[london,rome]

    The | operator can also be used to add a head to a list:

    50> L1 = [madrid | T1].
    │ │ │ +[madrid,london,rome]
    │ │ │  51> L1.
    │ │ │ -[madrid,london,rome]

    Now an example of this when working with lists - reversing the order of a list:

    -module(tut8).
    │ │ │ +[madrid,london,rome]

    Now an example of this when working with lists - reversing the order of a list:

    -module(tut8).
    │ │ │  
    │ │ │ --export([reverse/1]).
    │ │ │ +-export([reverse/1]).
    │ │ │  
    │ │ │ -reverse(List) ->
    │ │ │ -    reverse(List, []).
    │ │ │ +reverse(List) ->
    │ │ │ +    reverse(List, []).
    │ │ │  
    │ │ │ -reverse([Head | Rest], Reversed_List) ->
    │ │ │ -    reverse(Rest, [Head | Reversed_List]);
    │ │ │ -reverse([], Reversed_List) ->
    │ │ │ -    Reversed_List.
    52> c(tut8).
    │ │ │ -{ok,tut8}
    │ │ │ -53> tut8:reverse([1,2,3]).
    │ │ │ -[3,2,1]

    Consider how Reversed_List is built. It starts as [], then successively the │ │ │ +reverse([Head | Rest], Reversed_List) -> │ │ │ + reverse(Rest, [Head | Reversed_List]); │ │ │ +reverse([], Reversed_List) -> │ │ │ + Reversed_List.

    52> c(tut8).
    │ │ │ +{ok,tut8}
    │ │ │ +53> tut8:reverse([1,2,3]).
    │ │ │ +[3,2,1]

    Consider how Reversed_List is built. It starts as [], then successively the │ │ │ heads are taken off of the list to be reversed and added to the the │ │ │ -Reversed_List, as shown in the following:

    reverse([1|2,3], []) =>
    │ │ │ -    reverse([2,3], [1|[]])
    │ │ │ +Reversed_List, as shown in the following:

    reverse([1|2,3], []) =>
    │ │ │ +    reverse([2,3], [1|[]])
    │ │ │  
    │ │ │ -reverse([2|3], [1]) =>
    │ │ │ -    reverse([3], [2|[1])
    │ │ │ +reverse([2|3], [1]) =>
    │ │ │ +    reverse([3], [2|[1])
    │ │ │  
    │ │ │ -reverse([3|[]], [2,1]) =>
    │ │ │ -    reverse([], [3|[2,1]])
    │ │ │ +reverse([3|[]], [2,1]) =>
    │ │ │ +    reverse([], [3|[2,1]])
    │ │ │  
    │ │ │ -reverse([], [3,2,1]) =>
    │ │ │ -    [3,2,1]

    The module lists contains many functions for manipulating lists, for example, │ │ │ +reverse([], [3,2,1]) => │ │ │ + [3,2,1]

    The module lists contains many functions for manipulating lists, for example, │ │ │ for reversing them. So before writing a list-manipulating function it is a good │ │ │ idea to check if one not already is written for you (see the lists manual │ │ │ page in STDLIB).

    Now let us get back to the cities and temperatures, but take a more structured │ │ │ -approach this time. First let us convert the whole list to Celsius as follows:

    -module(tut7).
    │ │ │ --export([format_temps/1]).
    │ │ │ +approach this time. First let us convert the whole list to Celsius as follows:

    -module(tut7).
    │ │ │ +-export([format_temps/1]).
    │ │ │  
    │ │ │ -format_temps(List_of_cities) ->
    │ │ │ -    convert_list_to_c(List_of_cities).
    │ │ │ +format_temps(List_of_cities) ->
    │ │ │ +    convert_list_to_c(List_of_cities).
    │ │ │  
    │ │ │ -convert_list_to_c([{Name, {f, F}} | Rest]) ->
    │ │ │ -    Converted_City = {Name, {c, (F -32)* 5 / 9}},
    │ │ │ -    [Converted_City | convert_list_to_c(Rest)];
    │ │ │ -
    │ │ │ -convert_list_to_c([City | Rest]) ->
    │ │ │ -    [City | convert_list_to_c(Rest)];
    │ │ │ -
    │ │ │ -convert_list_to_c([]) ->
    │ │ │ -    [].

    Test the function:

    54> c(tut7).
    │ │ │ -{ok, tut7}.
    │ │ │ -55> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ -[{moscow,{c,-10}},
    │ │ │ - {cape_town,{c,21.11111111111111}},
    │ │ │ - {stockholm,{c,-4}},
    │ │ │ - {paris,{c,-2.2222222222222223}},
    │ │ │ - {london,{c,2.2222222222222223}}]

    Explanation:

    format_temps(List_of_cities) ->
    │ │ │ -    convert_list_to_c(List_of_cities).

    Here format_temps/1 calls convert_list_to_c/1. convert_list_to_c/1 takes │ │ │ +convert_list_to_c([{Name, {f, F}} | Rest]) -> │ │ │ + Converted_City = {Name, {c, (F -32)* 5 / 9}}, │ │ │ + [Converted_City | convert_list_to_c(Rest)]; │ │ │ + │ │ │ +convert_list_to_c([City | Rest]) -> │ │ │ + [City | convert_list_to_c(Rest)]; │ │ │ + │ │ │ +convert_list_to_c([]) -> │ │ │ + [].

    Test the function:

    54> c(tut7).
    │ │ │ +{ok, tut7}.
    │ │ │ +55> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ +[{moscow,{c,-10}},
    │ │ │ + {cape_town,{c,21.11111111111111}},
    │ │ │ + {stockholm,{c,-4}},
    │ │ │ + {paris,{c,-2.2222222222222223}},
    │ │ │ + {london,{c,2.2222222222222223}}]

    Explanation:

    format_temps(List_of_cities) ->
    │ │ │ +    convert_list_to_c(List_of_cities).

    Here format_temps/1 calls convert_list_to_c/1. convert_list_to_c/1 takes │ │ │ off the head of the List_of_cities, converts it to Celsius if needed. The | │ │ │ -operator is used to add the (maybe) converted to the converted rest of the list:

    [Converted_City | convert_list_to_c(Rest)];

    or:

    [City | convert_list_to_c(Rest)];

    This is done until the end of the list is reached, that is, the list is empty:

    convert_list_to_c([]) ->
    │ │ │ -    [].

    Now when the list is converted, a function to print it is added:

    -module(tut7).
    │ │ │ --export([format_temps/1]).
    │ │ │ -
    │ │ │ -format_temps(List_of_cities) ->
    │ │ │ -    Converted_List = convert_list_to_c(List_of_cities),
    │ │ │ -    print_temp(Converted_List).
    │ │ │ -
    │ │ │ -convert_list_to_c([{Name, {f, F}} | Rest]) ->
    │ │ │ -    Converted_City = {Name, {c, (F -32)* 5 / 9}},
    │ │ │ -    [Converted_City | convert_list_to_c(Rest)];
    │ │ │ -
    │ │ │ -convert_list_to_c([City | Rest]) ->
    │ │ │ -    [City | convert_list_to_c(Rest)];
    │ │ │ -
    │ │ │ -convert_list_to_c([]) ->
    │ │ │ -    [].
    │ │ │ -
    │ │ │ -print_temp([{Name, {c, Temp}} | Rest]) ->
    │ │ │ -    io:format("~-15w ~w c~n", [Name, Temp]),
    │ │ │ -    print_temp(Rest);
    │ │ │ -print_temp([]) ->
    │ │ │ -    ok.
    56> c(tut7).
    │ │ │ -{ok,tut7}
    │ │ │ -57> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ +operator is used to add the (maybe) converted to the converted rest of the list:

    [Converted_City | convert_list_to_c(Rest)];

    or:

    [City | convert_list_to_c(Rest)];

    This is done until the end of the list is reached, that is, the list is empty:

    convert_list_to_c([]) ->
    │ │ │ +    [].

    Now when the list is converted, a function to print it is added:

    -module(tut7).
    │ │ │ +-export([format_temps/1]).
    │ │ │ +
    │ │ │ +format_temps(List_of_cities) ->
    │ │ │ +    Converted_List = convert_list_to_c(List_of_cities),
    │ │ │ +    print_temp(Converted_List).
    │ │ │ +
    │ │ │ +convert_list_to_c([{Name, {f, F}} | Rest]) ->
    │ │ │ +    Converted_City = {Name, {c, (F -32)* 5 / 9}},
    │ │ │ +    [Converted_City | convert_list_to_c(Rest)];
    │ │ │ +
    │ │ │ +convert_list_to_c([City | Rest]) ->
    │ │ │ +    [City | convert_list_to_c(Rest)];
    │ │ │ +
    │ │ │ +convert_list_to_c([]) ->
    │ │ │ +    [].
    │ │ │ +
    │ │ │ +print_temp([{Name, {c, Temp}} | Rest]) ->
    │ │ │ +    io:format("~-15w ~w c~n", [Name, Temp]),
    │ │ │ +    print_temp(Rest);
    │ │ │ +print_temp([]) ->
    │ │ │ +    ok.
    56> c(tut7).
    │ │ │ +{ok,tut7}
    │ │ │ +57> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │  moscow          -10 c
    │ │ │  cape_town       21.11111111111111 c
    │ │ │  stockholm       -4 c
    │ │ │  paris           -2.2222222222222223 c
    │ │ │  london          2.2222222222222223 c
    │ │ │  ok

    Now a function has to be added to find the cities with the maximum and minimum │ │ │ temperatures. The following program is not the most efficient way of doing this │ │ │ as you walk through the list of cities four times. But it is better to first │ │ │ strive for clarity and correctness and to make programs efficient only if │ │ │ -needed.

    -module(tut7).
    │ │ │ --export([format_temps/1]).
    │ │ │ +needed.

    -module(tut7).
    │ │ │ +-export([format_temps/1]).
    │ │ │  
    │ │ │ -format_temps(List_of_cities) ->
    │ │ │ -    Converted_List = convert_list_to_c(List_of_cities),
    │ │ │ -    print_temp(Converted_List),
    │ │ │ -    {Max_city, Min_city} = find_max_and_min(Converted_List),
    │ │ │ -    print_max_and_min(Max_city, Min_city).
    │ │ │ -
    │ │ │ -convert_list_to_c([{Name, {f, Temp}} | Rest]) ->
    │ │ │ -    Converted_City = {Name, {c, (Temp -32)* 5 / 9}},
    │ │ │ -    [Converted_City | convert_list_to_c(Rest)];
    │ │ │ -
    │ │ │ -convert_list_to_c([City | Rest]) ->
    │ │ │ -    [City | convert_list_to_c(Rest)];
    │ │ │ -
    │ │ │ -convert_list_to_c([]) ->
    │ │ │ -    [].
    │ │ │ -
    │ │ │ -print_temp([{Name, {c, Temp}} | Rest]) ->
    │ │ │ -    io:format("~-15w ~w c~n", [Name, Temp]),
    │ │ │ -    print_temp(Rest);
    │ │ │ -print_temp([]) ->
    │ │ │ +format_temps(List_of_cities) ->
    │ │ │ +    Converted_List = convert_list_to_c(List_of_cities),
    │ │ │ +    print_temp(Converted_List),
    │ │ │ +    {Max_city, Min_city} = find_max_and_min(Converted_List),
    │ │ │ +    print_max_and_min(Max_city, Min_city).
    │ │ │ +
    │ │ │ +convert_list_to_c([{Name, {f, Temp}} | Rest]) ->
    │ │ │ +    Converted_City = {Name, {c, (Temp -32)* 5 / 9}},
    │ │ │ +    [Converted_City | convert_list_to_c(Rest)];
    │ │ │ +
    │ │ │ +convert_list_to_c([City | Rest]) ->
    │ │ │ +    [City | convert_list_to_c(Rest)];
    │ │ │ +
    │ │ │ +convert_list_to_c([]) ->
    │ │ │ +    [].
    │ │ │ +
    │ │ │ +print_temp([{Name, {c, Temp}} | Rest]) ->
    │ │ │ +    io:format("~-15w ~w c~n", [Name, Temp]),
    │ │ │ +    print_temp(Rest);
    │ │ │ +print_temp([]) ->
    │ │ │      ok.
    │ │ │  
    │ │ │ -find_max_and_min([City | Rest]) ->
    │ │ │ -    find_max_and_min(Rest, City, City).
    │ │ │ +find_max_and_min([City | Rest]) ->
    │ │ │ +    find_max_and_min(Rest, City, City).
    │ │ │  
    │ │ │ -find_max_and_min([{Name, {c, Temp}} | Rest],
    │ │ │ -         {Max_Name, {c, Max_Temp}},
    │ │ │ -         {Min_Name, {c, Min_Temp}}) ->
    │ │ │ +find_max_and_min([{Name, {c, Temp}} | Rest],
    │ │ │ +         {Max_Name, {c, Max_Temp}},
    │ │ │ +         {Min_Name, {c, Min_Temp}}) ->
    │ │ │      if
    │ │ │          Temp > Max_Temp ->
    │ │ │ -            Max_City = {Name, {c, Temp}};           % Change
    │ │ │ +            Max_City = {Name, {c, Temp}};           % Change
    │ │ │          true ->
    │ │ │ -            Max_City = {Max_Name, {c, Max_Temp}} % Unchanged
    │ │ │ +            Max_City = {Max_Name, {c, Max_Temp}} % Unchanged
    │ │ │      end,
    │ │ │      if
    │ │ │           Temp < Min_Temp ->
    │ │ │ -            Min_City = {Name, {c, Temp}};           % Change
    │ │ │ +            Min_City = {Name, {c, Temp}};           % Change
    │ │ │          true ->
    │ │ │ -            Min_City = {Min_Name, {c, Min_Temp}} % Unchanged
    │ │ │ +            Min_City = {Min_Name, {c, Min_Temp}} % Unchanged
    │ │ │      end,
    │ │ │ -    find_max_and_min(Rest, Max_City, Min_City);
    │ │ │ +    find_max_and_min(Rest, Max_City, Min_City);
    │ │ │  
    │ │ │ -find_max_and_min([], Max_City, Min_City) ->
    │ │ │ -    {Max_City, Min_City}.
    │ │ │ +find_max_and_min([], Max_City, Min_City) ->
    │ │ │ +    {Max_City, Min_City}.
    │ │ │  
    │ │ │ -print_max_and_min({Max_name, {c, Max_temp}}, {Min_name, {c, Min_temp}}) ->
    │ │ │ -    io:format("Max temperature was ~w c in ~w~n", [Max_temp, Max_name]),
    │ │ │ -    io:format("Min temperature was ~w c in ~w~n", [Min_temp, Min_name]).
    58> c(tut7).
    │ │ │ -{ok, tut7}
    │ │ │ -59> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ +print_max_and_min({Max_name, {c, Max_temp}}, {Min_name, {c, Min_temp}}) ->
    │ │ │ +    io:format("Max temperature was ~w c in ~w~n", [Max_temp, Max_name]),
    │ │ │ +    io:format("Min temperature was ~w c in ~w~n", [Min_temp, Min_name]).
    58> c(tut7).
    │ │ │ +{ok, tut7}
    │ │ │ +59> tut7:format_temps([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │  moscow          -10 c
    │ │ │  cape_town       21.11111111111111 c
    │ │ │  stockholm       -4 c
    │ │ │  paris           -2.2222222222222223 c
    │ │ │  london          2.2222222222222223 c
    │ │ │  Max temperature was 21.11111111111111 c in cape_town
    │ │ │  Min temperature was -10 c in moscow
    │ │ │ @@ -773,88 +773,88 @@
    │ │ │          Action 4
    │ │ │  end

    Notice that there is no ; before end. Conditions do the same as guards, that │ │ │ is, tests that succeed or fail. Erlang starts at the top and tests until it │ │ │ finds a condition that succeeds. Then it evaluates (performs) the action │ │ │ following the condition and ignores all other conditions and actions before the │ │ │ end. If no condition matches, a run-time failure occurs. A condition that │ │ │ always succeeds is the atom true. This is often used last in an if, meaning, │ │ │ -do the action following the true if all other conditions have failed.

    The following is a short program to show the workings of if.

    -module(tut9).
    │ │ │ --export([test_if/2]).
    │ │ │ +do the action following the true if all other conditions have failed.

    The following is a short program to show the workings of if.

    -module(tut9).
    │ │ │ +-export([test_if/2]).
    │ │ │  
    │ │ │ -test_if(A, B) ->
    │ │ │ +test_if(A, B) ->
    │ │ │      if
    │ │ │          A == 5 ->
    │ │ │ -            io:format("A == 5~n", []),
    │ │ │ +            io:format("A == 5~n", []),
    │ │ │              a_equals_5;
    │ │ │          B == 6 ->
    │ │ │ -            io:format("B == 6~n", []),
    │ │ │ +            io:format("B == 6~n", []),
    │ │ │              b_equals_6;
    │ │ │          A == 2, B == 3 ->                      %That is A equals 2 and B equals 3
    │ │ │ -            io:format("A == 2, B == 3~n", []),
    │ │ │ +            io:format("A == 2, B == 3~n", []),
    │ │ │              a_equals_2_b_equals_3;
    │ │ │          A == 1 ; B == 7 ->                     %That is A equals 1 or B equals 7
    │ │ │ -            io:format("A == 1 ; B == 7~n", []),
    │ │ │ +            io:format("A == 1 ; B == 7~n", []),
    │ │ │              a_equals_1_or_b_equals_7
    │ │ │ -    end.

    Testing this program gives:

    60> c(tut9).
    │ │ │ -{ok,tut9}
    │ │ │ -61> tut9:test_if(5,33).
    │ │ │ +    end.

    Testing this program gives:

    60> c(tut9).
    │ │ │ +{ok,tut9}
    │ │ │ +61> tut9:test_if(5,33).
    │ │ │  A == 5
    │ │ │  a_equals_5
    │ │ │ -62> tut9:test_if(33,6).
    │ │ │ +62> tut9:test_if(33,6).
    │ │ │  B == 6
    │ │ │  b_equals_6
    │ │ │ -63> tut9:test_if(2, 3).
    │ │ │ +63> tut9:test_if(2, 3).
    │ │ │  A == 2, B == 3
    │ │ │  a_equals_2_b_equals_3
    │ │ │ -64> tut9:test_if(1, 33).
    │ │ │ +64> tut9:test_if(1, 33).
    │ │ │  A == 1 ; B == 7
    │ │ │  a_equals_1_or_b_equals_7
    │ │ │ -65> tut9:test_if(33, 7).
    │ │ │ +65> tut9:test_if(33, 7).
    │ │ │  A == 1 ; B == 7
    │ │ │  a_equals_1_or_b_equals_7
    │ │ │ -66> tut9:test_if(33, 33).
    │ │ │ +66> tut9:test_if(33, 33).
    │ │ │  ** exception error: no true branch found when evaluating an if expression
    │ │ │       in function  tut9:test_if/2 (tut9.erl, line 5)

    Notice that tut9:test_if(33,33) does not cause any condition to succeed. This │ │ │ leads to the run time error if_clause, here nicely formatted by the shell. See │ │ │ Guard Sequences for details of the many guard tests │ │ │ available.

    case is another construct in Erlang. Recall that the convert_length function │ │ │ -was written as:

    convert_length({centimeter, X}) ->
    │ │ │ -    {inch, X / 2.54};
    │ │ │ -convert_length({inch, Y}) ->
    │ │ │ -    {centimeter, Y * 2.54}.

    The same program can also be written as:

    -module(tut10).
    │ │ │ --export([convert_length/1]).
    │ │ │ +was written as:

    convert_length({centimeter, X}) ->
    │ │ │ +    {inch, X / 2.54};
    │ │ │ +convert_length({inch, Y}) ->
    │ │ │ +    {centimeter, Y * 2.54}.

    The same program can also be written as:

    -module(tut10).
    │ │ │ +-export([convert_length/1]).
    │ │ │  
    │ │ │ -convert_length(Length) ->
    │ │ │ +convert_length(Length) ->
    │ │ │      case Length of
    │ │ │ -        {centimeter, X} ->
    │ │ │ -            {inch, X / 2.54};
    │ │ │ -        {inch, Y} ->
    │ │ │ -            {centimeter, Y * 2.54}
    │ │ │ -    end.
    67> c(tut10).
    │ │ │ -{ok,tut10}
    │ │ │ -68> tut10:convert_length({inch, 6}).
    │ │ │ -{centimeter,15.24}
    │ │ │ -69> tut10:convert_length({centimeter, 2.5}).
    │ │ │ -{inch,0.984251968503937}

    Both case and if have return values, that is, in the above example case │ │ │ + {centimeter, X} -> │ │ │ + {inch, X / 2.54}; │ │ │ + {inch, Y} -> │ │ │ + {centimeter, Y * 2.54} │ │ │ + end.

    67> c(tut10).
    │ │ │ +{ok,tut10}
    │ │ │ +68> tut10:convert_length({inch, 6}).
    │ │ │ +{centimeter,15.24}
    │ │ │ +69> tut10:convert_length({centimeter, 2.5}).
    │ │ │ +{inch,0.984251968503937}

    Both case and if have return values, that is, in the above example case │ │ │ returned either {inch,X/2.54} or {centimeter,Y*2.54}. The behaviour of │ │ │ case can also be modified by using guards. The following example clarifies │ │ │ this. It tells us the length of a month, given the year. The year must be known, │ │ │ -since February has 29 days in a leap year.

    -module(tut11).
    │ │ │ --export([month_length/2]).
    │ │ │ +since February has 29 days in a leap year.

    -module(tut11).
    │ │ │ +-export([month_length/2]).
    │ │ │  
    │ │ │ -month_length(Year, Month) ->
    │ │ │ +month_length(Year, Month) ->
    │ │ │      %% All years divisible by 400 are leap
    │ │ │      %% Years divisible by 100 are not leap (except the 400 rule above)
    │ │ │      %% Years divisible by 4 are leap (except the 100 rule above)
    │ │ │      Leap = if
    │ │ │ -        trunc(Year / 400) * 400 == Year ->
    │ │ │ +        trunc(Year / 400) * 400 == Year ->
    │ │ │              leap;
    │ │ │ -        trunc(Year / 100) * 100 == Year ->
    │ │ │ +        trunc(Year / 100) * 100 == Year ->
    │ │ │              not_leap;
    │ │ │ -        trunc(Year / 4) * 4 == Year ->
    │ │ │ +        trunc(Year / 4) * 4 == Year ->
    │ │ │              leap;
    │ │ │          true ->
    │ │ │              not_leap
    │ │ │      end,
    │ │ │      case Month of
    │ │ │          sep -> 30;
    │ │ │          apr -> 30;
    │ │ │ @@ -865,152 +865,152 @@
    │ │ │          jan -> 31;
    │ │ │          mar -> 31;
    │ │ │          may -> 31;
    │ │ │          jul -> 31;
    │ │ │          aug -> 31;
    │ │ │          oct -> 31;
    │ │ │          dec -> 31
    │ │ │ -    end.
    70> c(tut11).
    │ │ │ -{ok,tut11}
    │ │ │ -71> tut11:month_length(2004, feb).
    │ │ │ +    end.
    70> c(tut11).
    │ │ │ +{ok,tut11}
    │ │ │ +71> tut11:month_length(2004, feb).
    │ │ │  29
    │ │ │ -72> tut11:month_length(2003, feb).
    │ │ │ +72> tut11:month_length(2003, feb).
    │ │ │  28
    │ │ │ -73> tut11:month_length(1947, aug).
    │ │ │ +73> tut11:month_length(1947, aug).
    │ │ │  31

    │ │ │ │ │ │ │ │ │ │ │ │ Built-In Functions (BIFs) │ │ │

    │ │ │

    BIFs are functions that for some reason are built-in to the Erlang virtual │ │ │ machine. BIFs often implement functionality that is impossible or is too │ │ │ inefficient to implement in Erlang. Some BIFs can be called using the function │ │ │ name only but they are by default belonging to the erlang module. For example, │ │ │ the call to the BIF trunc below is equivalent to a call to erlang:trunc.

    As shown, first it is checked if a year is leap. If a year is divisible by 400, │ │ │ it is a leap year. To determine this, first divide the year by 400 and use the │ │ │ BIF trunc (more about this later) to cut off any decimals. Then multiply by │ │ │ 400 again and see if the same value is returned again. For example, year 2004:

    2004 / 400 = 5.01
    │ │ │ -trunc(5.01) = 5
    │ │ │ +trunc(5.01) = 5
    │ │ │  5 * 400 = 2000

    2000 is not the same as 2004, so 2004 is not divisible by 400. Year 2000:

    2000 / 400 = 5.0
    │ │ │ -trunc(5.0) = 5
    │ │ │ +trunc(5.0) = 5
    │ │ │  5 * 400 = 2000

    That is, a leap year. The next two trunc-tests evaluate if the year is │ │ │ divisible by 100 or 4 in the same way. The first if returns leap or │ │ │ not_leap, which lands up in the variable Leap. This variable is used in the │ │ │ guard for feb in the following case that tells us how long the month is.

    This example showed the use of trunc. It is easier to use the Erlang operator │ │ │ rem that gives the remainder after division, for example:

    74> 2004 rem 400.
    │ │ │ -4

    So instead of writing:

    trunc(Year / 400) * 400 == Year ->
    │ │ │ +4

    So instead of writing:

    trunc(Year / 400) * 400 == Year ->
    │ │ │      leap;

    it can be written:

    Year rem 400 == 0 ->
    │ │ │      leap;

    There are many other BIFs such as trunc. Only a few BIFs can be used in │ │ │ guards, and you cannot use functions you have defined yourself in guards. (see │ │ │ Guard Sequences) (For advanced readers: This is to │ │ │ ensure that guards do not have side effects.) Let us play with a few of these │ │ │ -functions in the shell:

    75> trunc(5.6).
    │ │ │ +functions in the shell:

    75> trunc(5.6).
    │ │ │  5
    │ │ │ -76> round(5.6).
    │ │ │ +76> round(5.6).
    │ │ │  6
    │ │ │ -77> length([a,b,c,d]).
    │ │ │ +77> length([a,b,c,d]).
    │ │ │  4
    │ │ │ -78> float(5).
    │ │ │ +78> float(5).
    │ │ │  5.0
    │ │ │ -79> is_atom(hello).
    │ │ │ +79> is_atom(hello).
    │ │ │  true
    │ │ │ -80> is_atom("hello").
    │ │ │ +80> is_atom("hello").
    │ │ │  false
    │ │ │ -81> is_tuple({paris, {c, 30}}).
    │ │ │ +81> is_tuple({paris, {c, 30}}).
    │ │ │  true
    │ │ │ -82> is_tuple([paris, {c, 30}]).
    │ │ │ +82> is_tuple([paris, {c, 30}]).
    │ │ │  false

    All of these can be used in guards. Now for some BIFs that cannot be used in │ │ │ -guards:

    83> atom_to_list(hello).
    │ │ │ +guards:

    83> atom_to_list(hello).
    │ │ │  "hello"
    │ │ │ -84> list_to_atom("goodbye").
    │ │ │ +84> list_to_atom("goodbye").
    │ │ │  goodbye
    │ │ │ -85> integer_to_list(22).
    │ │ │ +85> integer_to_list(22).
    │ │ │  "22"

    These three BIFs do conversions that would be difficult (or impossible) to do in │ │ │ Erlang.

    │ │ │ │ │ │ │ │ │ │ │ │ Higher-Order Functions (Funs) │ │ │

    │ │ │

    Erlang, like most modern functional programming languages, has higher-order │ │ │ -functions. Here is an example using the shell:

    86> Xf = fun(X) -> X * 2 end.
    │ │ │ +functions. Here is an example using the shell:

    86> Xf = fun(X) -> X * 2 end.
    │ │ │  #Fun<erl_eval.5.123085357>
    │ │ │ -87> Xf(5).
    │ │ │ +87> Xf(5).
    │ │ │  10

    Here is defined a function that doubles the value of a number and assigned this │ │ │ function to a variable. Thus Xf(5) returns value 10. Two useful functions when │ │ │ -working with lists are foreach and map, which are defined as follows:

    foreach(Fun, [First|Rest]) ->
    │ │ │ -    Fun(First),
    │ │ │ -    foreach(Fun, Rest);
    │ │ │ -foreach(Fun, []) ->
    │ │ │ +working with lists are foreach and map, which are defined as follows:

    foreach(Fun, [First|Rest]) ->
    │ │ │ +    Fun(First),
    │ │ │ +    foreach(Fun, Rest);
    │ │ │ +foreach(Fun, []) ->
    │ │ │      ok.
    │ │ │  
    │ │ │ -map(Fun, [First|Rest]) ->
    │ │ │ -    [Fun(First)|map(Fun,Rest)];
    │ │ │ -map(Fun, []) ->
    │ │ │ -    [].

    These two functions are provided in the standard module lists. foreach takes │ │ │ +map(Fun, [First|Rest]) -> │ │ │ + [Fun(First)|map(Fun,Rest)]; │ │ │ +map(Fun, []) -> │ │ │ + [].

    These two functions are provided in the standard module lists. foreach takes │ │ │ a list and applies a fun to every element in the list. map creates a new list │ │ │ by applying a fun to every element in a list. Going back to the shell, map is │ │ │ -used and a fun to add 3 to every element of a list:

    88> Add_3 = fun(X) -> X + 3 end.
    │ │ │ +used and a fun to add 3 to every element of a list:

    88> Add_3 = fun(X) -> X + 3 end.
    │ │ │  #Fun<erl_eval.5.123085357>
    │ │ │ -89> lists:map(Add_3, [1,2,3]).
    │ │ │ -[4,5,6]

    Let us (again) print the temperatures in a list of cities:

    90> Print_City = fun({City, {X, Temp}}) -> io:format("~-15w ~w ~w~n",
    │ │ │ -[City, X, Temp]) end.
    │ │ │ +89> lists:map(Add_3, [1,2,3]).
    │ │ │ +[4,5,6]

    Let us (again) print the temperatures in a list of cities:

    90> Print_City = fun({City, {X, Temp}}) -> io:format("~-15w ~w ~w~n",
    │ │ │ +[City, X, Temp]) end.
    │ │ │  #Fun<erl_eval.5.123085357>
    │ │ │ -91> lists:foreach(Print_City, [{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ +91> lists:foreach(Print_City, [{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │  moscow          c -10
    │ │ │  cape_town       f 70
    │ │ │  stockholm       c -4
    │ │ │  paris           f 28
    │ │ │  london          f 36
    │ │ │  ok

    Let us now define a fun that can be used to go through a list of cities and │ │ │ -temperatures and transform them all to Celsius.

    -module(tut13).
    │ │ │ +temperatures and transform them all to Celsius.

    -module(tut13).
    │ │ │  
    │ │ │ --export([convert_list_to_c/1]).
    │ │ │ +-export([convert_list_to_c/1]).
    │ │ │  
    │ │ │ -convert_to_c({Name, {f, Temp}}) ->
    │ │ │ -    {Name, {c, trunc((Temp - 32) * 5 / 9)}};
    │ │ │ -convert_to_c({Name, {c, Temp}}) ->
    │ │ │ -    {Name, {c, Temp}}.
    │ │ │ -
    │ │ │ -convert_list_to_c(List) ->
    │ │ │ -    lists:map(fun convert_to_c/1, List).
    92> tut13:convert_list_to_c([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ -[{moscow,{c,-10}},
    │ │ │ - {cape_town,{c,21}},
    │ │ │ - {stockholm,{c,-4}},
    │ │ │ - {paris,{c,-2}},
    │ │ │ - {london,{c,2}}]

    The convert_to_c function is the same as before, but here it is used as a fun:

    lists:map(fun convert_to_c/1, List)

    When a function defined elsewhere is used as a fun, it can be referred to as │ │ │ +convert_to_c({Name, {f, Temp}}) -> │ │ │ + {Name, {c, trunc((Temp - 32) * 5 / 9)}}; │ │ │ +convert_to_c({Name, {c, Temp}}) -> │ │ │ + {Name, {c, Temp}}. │ │ │ + │ │ │ +convert_list_to_c(List) -> │ │ │ + lists:map(fun convert_to_c/1, List).

    92> tut13:convert_list_to_c([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ +[{moscow,{c,-10}},
    │ │ │ + {cape_town,{c,21}},
    │ │ │ + {stockholm,{c,-4}},
    │ │ │ + {paris,{c,-2}},
    │ │ │ + {london,{c,2}}]

    The convert_to_c function is the same as before, but here it is used as a fun:

    lists:map(fun convert_to_c/1, List)

    When a function defined elsewhere is used as a fun, it can be referred to as │ │ │ Function/Arity (remember that Arity = number of arguments). So in the │ │ │ map-call lists:map(fun convert_to_c/1, List) is written. As shown, │ │ │ convert_list_to_c becomes much shorter and easier to understand.

    The standard module lists also contains a function sort(Fun, List) where │ │ │ Fun is a fun with two arguments. This fun returns true if the first argument │ │ │ is less than the second argument, or else false. Sorting is added to the │ │ │ -convert_list_to_c:

    -module(tut13).
    │ │ │ +convert_list_to_c:

    -module(tut13).
    │ │ │  
    │ │ │ --export([convert_list_to_c/1]).
    │ │ │ +-export([convert_list_to_c/1]).
    │ │ │  
    │ │ │ -convert_to_c({Name, {f, Temp}}) ->
    │ │ │ -    {Name, {c, trunc((Temp - 32) * 5 / 9)}};
    │ │ │ -convert_to_c({Name, {c, Temp}}) ->
    │ │ │ -    {Name, {c, Temp}}.
    │ │ │ -
    │ │ │ -convert_list_to_c(List) ->
    │ │ │ -    New_list = lists:map(fun convert_to_c/1, List),
    │ │ │ -    lists:sort(fun({_, {c, Temp1}}, {_, {c, Temp2}}) ->
    │ │ │ -                       Temp1 < Temp2 end, New_list).
    93> c(tut13).
    │ │ │ -{ok,tut13}
    │ │ │ -94> tut13:convert_list_to_c([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ -{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ -[{moscow,{c,-10}},
    │ │ │ - {stockholm,{c,-4}},
    │ │ │ - {paris,{c,-2}},
    │ │ │ - {london,{c,2}},
    │ │ │ - {cape_town,{c,21}}]

    In sort the fun is used:

    fun({_, {c, Temp1}}, {_, {c, Temp2}}) -> Temp1 < Temp2 end,

    Here the concept of an anonymous variable _ is introduced. This is simply │ │ │ +convert_to_c({Name, {f, Temp}}) -> │ │ │ + {Name, {c, trunc((Temp - 32) * 5 / 9)}}; │ │ │ +convert_to_c({Name, {c, Temp}}) -> │ │ │ + {Name, {c, Temp}}. │ │ │ + │ │ │ +convert_list_to_c(List) -> │ │ │ + New_list = lists:map(fun convert_to_c/1, List), │ │ │ + lists:sort(fun({_, {c, Temp1}}, {_, {c, Temp2}}) -> │ │ │ + Temp1 < Temp2 end, New_list).

    93> c(tut13).
    │ │ │ +{ok,tut13}
    │ │ │ +94> tut13:convert_list_to_c([{moscow, {c, -10}}, {cape_town, {f, 70}},
    │ │ │ +{stockholm, {c, -4}}, {paris, {f, 28}}, {london, {f, 36}}]).
    │ │ │ +[{moscow,{c,-10}},
    │ │ │ + {stockholm,{c,-4}},
    │ │ │ + {paris,{c,-2}},
    │ │ │ + {london,{c,2}},
    │ │ │ + {cape_town,{c,21}}]

    In sort the fun is used:

    fun({_, {c, Temp1}}, {_, {c, Temp2}}) -> Temp1 < Temp2 end,

    Here the concept of an anonymous variable _ is introduced. This is simply │ │ │ shorthand for a variable that gets a value, but the value is ignored. This can │ │ │ be used anywhere suitable, not just in funs. Temp1 < Temp2 returns true if │ │ │ Temp1 is less than Temp2.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/spec_proc.html │ │ │ @@ -123,72 +123,72 @@ │ │ │ │ │ │ │ │ │ │ │ │ Simple Debugging │ │ │ │ │ │

    The sys module has functions for simple debugging of processes implemented │ │ │ using behaviours. The code_lock example from │ │ │ -gen_statem Behaviour is used to illustrate this:

    Erlang/OTP 27 [erts-15.0] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
    │ │ │ +gen_statem Behaviour is used to illustrate this:

    Erlang/OTP 27 [erts-15.0] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
    │ │ │  
    │ │ │ -Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
    │ │ │ -1> code_lock:start_link([1,2,3,4]).
    │ │ │ +Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
    │ │ │ +1> code_lock:start_link([1,2,3,4]).
    │ │ │  Lock
    │ │ │ -{ok,<0.90.0>}
    │ │ │ -2> sys:statistics(code_lock, true).
    │ │ │ +{ok,<0.90.0>}
    │ │ │ +2> sys:statistics(code_lock, true).
    │ │ │  ok
    │ │ │ -3> sys:trace(code_lock, true).
    │ │ │ +3> sys:trace(code_lock, true).
    │ │ │  ok
    │ │ │ -4> code_lock:button(1).
    │ │ │ -*DBG* code_lock receive cast {button,1} in state locked
    │ │ │ +4> code_lock:button(1).
    │ │ │ +*DBG* code_lock receive cast {button,1} in state locked
    │ │ │  ok
    │ │ │ -*DBG* code_lock consume cast {button,1} in state locked
    │ │ │ -5> code_lock:button(2).
    │ │ │ -*DBG* code_lock receive cast {button,2} in state locked
    │ │ │ +*DBG* code_lock consume cast {button,1} in state locked
    │ │ │ +5> code_lock:button(2).
    │ │ │ +*DBG* code_lock receive cast {button,2} in state locked
    │ │ │  ok
    │ │ │ -*DBG* code_lock consume cast {button,2} in state locked
    │ │ │ -6> code_lock:button(3).
    │ │ │ -*DBG* code_lock receive cast {button,3} in state locked
    │ │ │ +*DBG* code_lock consume cast {button,2} in state locked
    │ │ │ +6> code_lock:button(3).
    │ │ │ +*DBG* code_lock receive cast {button,3} in state locked
    │ │ │  ok
    │ │ │ -*DBG* code_lock consume cast {button,3} in state locked
    │ │ │ -7> code_lock:button(4).
    │ │ │ -*DBG* code_lock receive cast {button,4} in state locked
    │ │ │ +*DBG* code_lock consume cast {button,3} in state locked
    │ │ │ +7> code_lock:button(4).
    │ │ │ +*DBG* code_lock receive cast {button,4} in state locked
    │ │ │  ok
    │ │ │  Unlock
    │ │ │ -*DBG* code_lock consume cast {button,4} in state locked => open
    │ │ │ -*DBG* code_lock start_timer {state_timeout,10000,lock,[]} in state open
    │ │ │ +*DBG* code_lock consume cast {button,4} in state locked => open
    │ │ │ +*DBG* code_lock start_timer {state_timeout,10000,lock,[]} in state open
    │ │ │  *DBG* code_lock receive state_timeout lock in state open
    │ │ │  Lock
    │ │ │  *DBG* code_lock consume state_timeout lock in state open => locked
    │ │ │ -8> sys:statistics(code_lock, get).
    │ │ │ -{ok,[{start_time,{{2024,5,3},{8,11,1}}},
    │ │ │ -     {current_time,{{2024,5,3},{8,11,48}}},
    │ │ │ -     {reductions,4098},
    │ │ │ -     {messages_in,5},
    │ │ │ -     {messages_out,0}]}
    │ │ │ -9> sys:statistics(code_lock, false).
    │ │ │ +8> sys:statistics(code_lock, get).
    │ │ │ +{ok,[{start_time,{{2024,5,3},{8,11,1}}},
    │ │ │ +     {current_time,{{2024,5,3},{8,11,48}}},
    │ │ │ +     {reductions,4098},
    │ │ │ +     {messages_in,5},
    │ │ │ +     {messages_out,0}]}
    │ │ │ +9> sys:statistics(code_lock, false).
    │ │ │  ok
    │ │ │ -10> sys:trace(code_lock, false).
    │ │ │ +10> sys:trace(code_lock, false).
    │ │ │  ok
    │ │ │ -11> sys:get_status(code_lock).
    │ │ │ -{status,<0.90.0>,
    │ │ │ -        {module,gen_statem},
    │ │ │ -        [[{'$initial_call',{code_lock,init,1}},
    │ │ │ -          {'$ancestors',[<0.88.0>,<0.87.0>,<0.70.0>,<0.65.0>,<0.69.0>,
    │ │ │ -                         <0.64.0>,kernel_sup,<0.47.0>]}],
    │ │ │ -         running,<0.88.0>,[],
    │ │ │ -         [{header,"Status for state machine code_lock"},
    │ │ │ -          {data,[{"Status",running},
    │ │ │ -                 {"Parent",<0.88.0>},
    │ │ │ -                 {"Modules",[code_lock]},
    │ │ │ -                 {"Time-outs",{0,[]}},
    │ │ │ -                 {"Logged Events",[]},
    │ │ │ -                 {"Postponed",[]}]},
    │ │ │ -          {data,[{"State",
    │ │ │ -                  {locked,#{code => [1,2,3,4],
    │ │ │ -                            length => 4,buttons => []}}}]}]]}

    │ │ │ +11> sys:get_status(code_lock). │ │ │ +{status,<0.90.0>, │ │ │ + {module,gen_statem}, │ │ │ + [[{'$initial_call',{code_lock,init,1}}, │ │ │ + {'$ancestors',[<0.88.0>,<0.87.0>,<0.70.0>,<0.65.0>,<0.69.0>, │ │ │ + <0.64.0>,kernel_sup,<0.47.0>]}], │ │ │ + running,<0.88.0>,[], │ │ │ + [{header,"Status for state machine code_lock"}, │ │ │ + {data,[{"Status",running}, │ │ │ + {"Parent",<0.88.0>}, │ │ │ + {"Modules",[code_lock]}, │ │ │ + {"Time-outs",{0,[]}}, │ │ │ + {"Logged Events",[]}, │ │ │ + {"Postponed",[]}]}, │ │ │ + {data,[{"State", │ │ │ + {locked,#{code => [1,2,3,4], │ │ │ + length => 4,buttons => []}}}]}]]}

    │ │ │ │ │ │ │ │ │ │ │ │ Special Processes │ │ │

    │ │ │

    This section describes how to write a process that complies to the OTP design │ │ │ principles, without using a standard behaviour. Such a process is to:

    System messages are messages with a special meaning, used in the supervision │ │ │ @@ -198,238 +198,238 @@ │ │ │ │ │ │ │ │ │ │ │ │ Example │ │ │ │ │ │

    Here follows the simple server from │ │ │ Overview, │ │ │ -implemented using sys and proc_lib to fit into a supervision tree:

    -module(ch4).
    │ │ │ --export([start_link/0]).
    │ │ │ --export([alloc/0, free/1]).
    │ │ │ --export([init/1]).
    │ │ │ --export([system_continue/3, system_terminate/4,
    │ │ │ +implemented using sys and proc_lib to fit into a supervision tree:

    -module(ch4).
    │ │ │ +-export([start_link/0]).
    │ │ │ +-export([alloc/0, free/1]).
    │ │ │ +-export([init/1]).
    │ │ │ +-export([system_continue/3, system_terminate/4,
    │ │ │           write_debug/3,
    │ │ │ -         system_get_state/1, system_replace_state/2]).
    │ │ │ +         system_get_state/1, system_replace_state/2]).
    │ │ │  
    │ │ │ -start_link() ->
    │ │ │ -    proc_lib:start_link(ch4, init, [self()]).
    │ │ │ +start_link() ->
    │ │ │ +    proc_lib:start_link(ch4, init, [self()]).
    │ │ │  
    │ │ │ -alloc() ->
    │ │ │ -    ch4 ! {self(), alloc},
    │ │ │ +alloc() ->
    │ │ │ +    ch4 ! {self(), alloc},
    │ │ │      receive
    │ │ │ -        {ch4, Res} ->
    │ │ │ +        {ch4, Res} ->
    │ │ │              Res
    │ │ │      end.
    │ │ │  
    │ │ │ -free(Ch) ->
    │ │ │ -    ch4 ! {free, Ch},
    │ │ │ +free(Ch) ->
    │ │ │ +    ch4 ! {free, Ch},
    │ │ │      ok.
    │ │ │  
    │ │ │ -init(Parent) ->
    │ │ │ -    register(ch4, self()),
    │ │ │ -    Chs = channels(),
    │ │ │ -    Deb = sys:debug_options([]),
    │ │ │ -    proc_lib:init_ack(Parent, {ok, self()}),
    │ │ │ -    loop(Chs, Parent, Deb).
    │ │ │ +init(Parent) ->
    │ │ │ +    register(ch4, self()),
    │ │ │ +    Chs = channels(),
    │ │ │ +    Deb = sys:debug_options([]),
    │ │ │ +    proc_lib:init_ack(Parent, {ok, self()}),
    │ │ │ +    loop(Chs, Parent, Deb).
    │ │ │  
    │ │ │ -loop(Chs, Parent, Deb) ->
    │ │ │ +loop(Chs, Parent, Deb) ->
    │ │ │      receive
    │ │ │ -        {From, alloc} ->
    │ │ │ -            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
    │ │ │ -                                    ch4, {in, alloc, From}),
    │ │ │ -            {Ch, Chs2} = alloc(Chs),
    │ │ │ -            From ! {ch4, Ch},
    │ │ │ -            Deb3 = sys:handle_debug(Deb2, fun ch4:write_debug/3,
    │ │ │ -                                    ch4, {out, {ch4, Ch}, From}),
    │ │ │ -            loop(Chs2, Parent, Deb3);
    │ │ │ -        {free, Ch} ->
    │ │ │ -            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
    │ │ │ -                                    ch4, {in, {free, Ch}}),
    │ │ │ -            Chs2 = free(Ch, Chs),
    │ │ │ -            loop(Chs2, Parent, Deb2);
    │ │ │ -
    │ │ │ -        {system, From, Request} ->
    │ │ │ -            sys:handle_system_msg(Request, From, Parent,
    │ │ │ -                                  ch4, Deb, Chs)
    │ │ │ +        {From, alloc} ->
    │ │ │ +            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
    │ │ │ +                                    ch4, {in, alloc, From}),
    │ │ │ +            {Ch, Chs2} = alloc(Chs),
    │ │ │ +            From ! {ch4, Ch},
    │ │ │ +            Deb3 = sys:handle_debug(Deb2, fun ch4:write_debug/3,
    │ │ │ +                                    ch4, {out, {ch4, Ch}, From}),
    │ │ │ +            loop(Chs2, Parent, Deb3);
    │ │ │ +        {free, Ch} ->
    │ │ │ +            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
    │ │ │ +                                    ch4, {in, {free, Ch}}),
    │ │ │ +            Chs2 = free(Ch, Chs),
    │ │ │ +            loop(Chs2, Parent, Deb2);
    │ │ │ +
    │ │ │ +        {system, From, Request} ->
    │ │ │ +            sys:handle_system_msg(Request, From, Parent,
    │ │ │ +                                  ch4, Deb, Chs)
    │ │ │      end.
    │ │ │  
    │ │ │ -system_continue(Parent, Deb, Chs) ->
    │ │ │ -    loop(Chs, Parent, Deb).
    │ │ │ +system_continue(Parent, Deb, Chs) ->
    │ │ │ +    loop(Chs, Parent, Deb).
    │ │ │  
    │ │ │ -system_terminate(Reason, _Parent, _Deb, _Chs) ->
    │ │ │ -    exit(Reason).
    │ │ │ +system_terminate(Reason, _Parent, _Deb, _Chs) ->
    │ │ │ +    exit(Reason).
    │ │ │  
    │ │ │ -system_get_state(Chs) ->
    │ │ │ -    {ok, Chs}.
    │ │ │ +system_get_state(Chs) ->
    │ │ │ +    {ok, Chs}.
    │ │ │  
    │ │ │ -system_replace_state(StateFun, Chs) ->
    │ │ │ -    NChs = StateFun(Chs),
    │ │ │ -    {ok, NChs, NChs}.
    │ │ │ +system_replace_state(StateFun, Chs) ->
    │ │ │ +    NChs = StateFun(Chs),
    │ │ │ +    {ok, NChs, NChs}.
    │ │ │  
    │ │ │ -write_debug(Dev, Event, Name) ->
    │ │ │ -    io:format(Dev, "~p event = ~p~n", [Name, Event]).

    As it is not relevant to the example, the channel handling functions have been │ │ │ +write_debug(Dev, Event, Name) -> │ │ │ + io:format(Dev, "~p event = ~p~n", [Name, Event]).

    As it is not relevant to the example, the channel handling functions have been │ │ │ omitted. To compile this example, the │ │ │ implementation of channel handling │ │ │ needs to be added to the module.

    Here is an example showing how the debugging functions in the sys │ │ │ module can be used for ch4:

    % erl
    │ │ │ -Erlang/OTP 27 [erts-15.0] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
    │ │ │ +Erlang/OTP 27 [erts-15.0] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
    │ │ │  
    │ │ │ -Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
    │ │ │ -1> ch4:start_link().
    │ │ │ -{ok,<0.90.0>}
    │ │ │ -2> sys:statistics(ch4, true).
    │ │ │ +Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
    │ │ │ +1> ch4:start_link().
    │ │ │ +{ok,<0.90.0>}
    │ │ │ +2> sys:statistics(ch4, true).
    │ │ │  ok
    │ │ │ -3> sys:trace(ch4, true).
    │ │ │ +3> sys:trace(ch4, true).
    │ │ │  ok
    │ │ │ -4> ch4:alloc().
    │ │ │ -ch4 event = {in,alloc,<0.88.0>}
    │ │ │ -ch4 event = {out,{ch4,1},<0.88.0>}
    │ │ │ +4> ch4:alloc().
    │ │ │ +ch4 event = {in,alloc,<0.88.0>}
    │ │ │ +ch4 event = {out,{ch4,1},<0.88.0>}
    │ │ │  1
    │ │ │ -5> ch4:free(ch1).
    │ │ │ -ch4 event = {in,{free,ch1}}
    │ │ │ +5> ch4:free(ch1).
    │ │ │ +ch4 event = {in,{free,ch1}}
    │ │ │  ok
    │ │ │ -6> sys:statistics(ch4, get).
    │ │ │ -{ok,[{start_time,{{2024,5,3},{8,26,13}}},
    │ │ │ -     {current_time,{{2024,5,3},{8,26,49}}},
    │ │ │ -     {reductions,202},
    │ │ │ -     {messages_in,2},
    │ │ │ -     {messages_out,1}]}
    │ │ │ -7> sys:statistics(ch4, false).
    │ │ │ +6> sys:statistics(ch4, get).
    │ │ │ +{ok,[{start_time,{{2024,5,3},{8,26,13}}},
    │ │ │ +     {current_time,{{2024,5,3},{8,26,49}}},
    │ │ │ +     {reductions,202},
    │ │ │ +     {messages_in,2},
    │ │ │ +     {messages_out,1}]}
    │ │ │ +7> sys:statistics(ch4, false).
    │ │ │  ok
    │ │ │ -8> sys:trace(ch4, false).
    │ │ │ +8> sys:trace(ch4, false).
    │ │ │  ok
    │ │ │ -9> sys:get_status(ch4).
    │ │ │ -{status,<0.90.0>,
    │ │ │ -        {module,ch4},
    │ │ │ -        [[{'$initial_call',{ch4,init,1}},
    │ │ │ -          {'$ancestors',[<0.88.0>,<0.87.0>,<0.70.0>,<0.65.0>,<0.69.0>,
    │ │ │ -                         <0.64.0>,kernel_sup,<0.47.0>]}],
    │ │ │ -         running,<0.88.0>,[],
    │ │ │ -         {[1],[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19|...]}]}

    │ │ │ +9> sys:get_status(ch4). │ │ │ +{status,<0.90.0>, │ │ │ + {module,ch4}, │ │ │ + [[{'$initial_call',{ch4,init,1}}, │ │ │ + {'$ancestors',[<0.88.0>,<0.87.0>,<0.70.0>,<0.65.0>,<0.69.0>, │ │ │ + <0.64.0>,kernel_sup,<0.47.0>]}], │ │ │ + running,<0.88.0>,[], │ │ │ + {[1],[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19|...]}]}

    │ │ │ │ │ │ │ │ │ │ │ │ Starting the Process │ │ │

    │ │ │

    A function in the proc_lib module is to be used to start the process. Several │ │ │ functions are available, for example, │ │ │ proc_lib:spawn_link/3,4 │ │ │ for asynchronous start and │ │ │ proc_lib:start_link/3,4,5 for synchronous start.

    Information necessary for a process within a supervision tree, such as │ │ │ details on ancestors and the initial call, is stored when a process │ │ │ is started through one of these functions.

    If the process terminates with a reason other than normal or shutdown, a │ │ │ crash report is generated. For more information about the crash report, see │ │ │ Logging in Kernel User's Guide.

    In the example, synchronous start is used. The process starts by calling │ │ │ -ch4:start_link():

    start_link() ->
    │ │ │ -    proc_lib:start_link(ch4, init, [self()]).

    ch4:start_link/0 calls proc_lib:start_link/3, which takes a module │ │ │ +ch4:start_link():

    start_link() ->
    │ │ │ +    proc_lib:start_link(ch4, init, [self()]).

    ch4:start_link/0 calls proc_lib:start_link/3, which takes a module │ │ │ name, a function name, and an argument list as arguments. It then │ │ │ spawns a new process and establishes a link. The new process starts │ │ │ by executing the given function, here ch4:init(Pid), where Pid is │ │ │ the pid of the parent process (obtained by the call to │ │ │ self() in the call to proc_lib:start_link/3).

    All initialization, including name registration, is done in init/1. The new │ │ │ -process has to acknowledge that it has been started to the parent:

    init(Parent) ->
    │ │ │ +process has to acknowledge that it has been started to the parent:

    init(Parent) ->
    │ │ │      ...
    │ │ │ -    proc_lib:init_ack(Parent, {ok, self()}),
    │ │ │ -    loop(...).

    proc_lib:start_link/3 is synchronous and does not return until │ │ │ + proc_lib:init_ack(Parent, {ok, self()}), │ │ │ + loop(...).

    proc_lib:start_link/3 is synchronous and does not return until │ │ │ proc_lib:init_ack/1,2 or │ │ │ proc_lib:init_fail/2,3 has been called, │ │ │ or the process has exited.

    │ │ │ │ │ │ │ │ │ │ │ │ Debugging │ │ │

    │ │ │

    To support the debug facilities in sys, a debug structure is needed. The │ │ │ -Deb term is initialized using sys:debug_options/1:

    init(Parent) ->
    │ │ │ +Deb term is initialized using sys:debug_options/1:

    init(Parent) ->
    │ │ │      ...
    │ │ │ -    Deb = sys:debug_options([]),
    │ │ │ +    Deb = sys:debug_options([]),
    │ │ │      ...
    │ │ │ -    loop(Chs, Parent, Deb).

    sys:debug_options/1 takes a list of options. Given an empty list as in this │ │ │ + loop(Chs, Parent, Deb).

    sys:debug_options/1 takes a list of options. Given an empty list as in this │ │ │ example means that debugging is initially disabled. For information about the │ │ │ possible options, see sys in STDLIB.

    For each system event to be logged or traced, the following function │ │ │ -is to be called:

    sys:handle_debug(Deb, Func, Info, Event) => Deb1

    The arguments have the follow meaning:

    • Deb is the debug structure as returned from sys:debug_options/1.
    • Func is a fun specifying a (user-defined) function used to format trace │ │ │ +is to be called:

      sys:handle_debug(Deb, Func, Info, Event) => Deb1

      The arguments have the follow meaning:

      • Deb is the debug structure as returned from sys:debug_options/1.
      • Func is a fun specifying a (user-defined) function used to format trace │ │ │ output. For each system event, the format function is called as │ │ │ Func(Dev, Event, Info), where:
        • Dev is the I/O device to which the output is to be printed. See io │ │ │ in STDLIB.
        • Event and Info are passed as-is from the call to sys:handle_debug/4.
      • Info is used to pass more information to Func. It can be any term, and it │ │ │ is passed as-is.
      • Event is the system event. It is up to the user to define what a system │ │ │ event is and how it is to be represented. Typically, at least incoming and │ │ │ outgoing messages are considered system events and represented by the tuples │ │ │ {in,Msg[,From]} and {out,Msg,To[,State]}, respectively.

      sys:handle_debug/4 returns an updated debug structure Deb1.

      In the example, sys:handle_debug/4 is called for each incoming and │ │ │ outgoing message. The format function Func is the function │ │ │ -ch4:write_debug/3, which prints the message using io:format/3.

      loop(Chs, Parent, Deb) ->
      │ │ │ +ch4:write_debug/3, which prints the message using io:format/3.

      loop(Chs, Parent, Deb) ->
      │ │ │      receive
      │ │ │ -        {From, alloc} ->
      │ │ │ -            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
      │ │ │ -                                    ch4, {in, alloc, From}),
      │ │ │ -            {Ch, Chs2} = alloc(Chs),
      │ │ │ -            From ! {ch4, Ch},
      │ │ │ -            Deb3 = sys:handle_debug(Deb2, fun ch4:write_debug/3,
      │ │ │ -                                    ch4, {out, {ch4, Ch}, From}),
      │ │ │ -            loop(Chs2, Parent, Deb3);
      │ │ │ -        {free, Ch} ->
      │ │ │ -            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
      │ │ │ -                                    ch4, {in, {free, Ch}}),
      │ │ │ -            Chs2 = free(Ch, Chs),
      │ │ │ -            loop(Chs2, Parent, Deb2);
      │ │ │ +        {From, alloc} ->
      │ │ │ +            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
      │ │ │ +                                    ch4, {in, alloc, From}),
      │ │ │ +            {Ch, Chs2} = alloc(Chs),
      │ │ │ +            From ! {ch4, Ch},
      │ │ │ +            Deb3 = sys:handle_debug(Deb2, fun ch4:write_debug/3,
      │ │ │ +                                    ch4, {out, {ch4, Ch}, From}),
      │ │ │ +            loop(Chs2, Parent, Deb3);
      │ │ │ +        {free, Ch} ->
      │ │ │ +            Deb2 = sys:handle_debug(Deb, fun ch4:write_debug/3,
      │ │ │ +                                    ch4, {in, {free, Ch}}),
      │ │ │ +            Chs2 = free(Ch, Chs),
      │ │ │ +            loop(Chs2, Parent, Deb2);
      │ │ │          ...
      │ │ │      end.
      │ │ │  
      │ │ │ -write_debug(Dev, Event, Name) ->
      │ │ │ -    io:format(Dev, "~p event = ~p~n", [Name, Event]).

      │ │ │ +write_debug(Dev, Event, Name) -> │ │ │ + io:format(Dev, "~p event = ~p~n", [Name, Event]).

      │ │ │ │ │ │ │ │ │ │ │ │ Handling System Messages │ │ │

      │ │ │

      System messages are received as:

      {system, From, Request}

      The content and meaning of these messages are not to be interpreted by the │ │ │ -process. Instead the following function is to be called:

      sys:handle_system_msg(Request, From, Parent, Module, Deb, State)

      The arguments have the following meaning:

      • Request and From from the received system message are to be │ │ │ +process. Instead the following function is to be called:

        sys:handle_system_msg(Request, From, Parent, Module, Deb, State)

        The arguments have the following meaning:

        • Request and From from the received system message are to be │ │ │ passed as-is to the call to sys:handle_system_msg/6.
        • Parent is the pid of the parent process.
        • Module is the name of the module implementing the speciall process.
        • Deb is the debug structure.
        • State is a term describing the internal state and is passed on to │ │ │ Module:system_continue/3, Module:system_terminate/4/ │ │ │ Module:system_get_state/1, and Module:system_replace_state/2.

        sys:handle_system_msg/6 does not return. It handles the system │ │ │ message and eventually calls either of the following functions:

        • Module:system_continue(Parent, Deb, State) - if process execution is to │ │ │ continue.

        • Module:system_terminate(Reason, Parent, Deb, State) - if the │ │ │ process is to terminate.

        While handling the system message, sys:handle_system_msg/6 can call │ │ │ one of the following functions:

        • Module:system_get_state(State) - if the process is to return its state.

        • Module:system_replace_state(StateFun, State) - if the process is │ │ │ to replace its state using the fun StateFun fun. See sys:replace_state/3 │ │ │ for more information.

        • system_code_change(Misc, Module, OldVsn, Extra) - if the process is to │ │ │ perform a code change.

        A process in a supervision tree is expected to terminate with the same reason as │ │ │ -its parent.

        In the example, system messages are handed by the following code:

        loop(Chs, Parent, Deb) ->
        │ │ │ +its parent.

        In the example, system messages are handed by the following code:

        loop(Chs, Parent, Deb) ->
        │ │ │      receive
        │ │ │          ...
        │ │ │  
        │ │ │ -        {system, From, Request} ->
        │ │ │ -            sys:handle_system_msg(Request, From, Parent,
        │ │ │ -                                  ch4, Deb, Chs)
        │ │ │ +        {system, From, Request} ->
        │ │ │ +            sys:handle_system_msg(Request, From, Parent,
        │ │ │ +                                  ch4, Deb, Chs)
        │ │ │      end.
        │ │ │  
        │ │ │ -system_continue(Parent, Deb, Chs) ->
        │ │ │ -    loop(Chs, Parent, Deb).
        │ │ │ +system_continue(Parent, Deb, Chs) ->
        │ │ │ +    loop(Chs, Parent, Deb).
        │ │ │  
        │ │ │ -system_terminate(Reason, Parent, Deb, Chs) ->
        │ │ │ -    exit(Reason).
        │ │ │ +system_terminate(Reason, Parent, Deb, Chs) ->
        │ │ │ +    exit(Reason).
        │ │ │  
        │ │ │ -system_get_state(Chs) ->
        │ │ │ -    {ok, Chs, Chs}.
        │ │ │ +system_get_state(Chs) ->
        │ │ │ +    {ok, Chs, Chs}.
        │ │ │  
        │ │ │ -system_replace_state(StateFun, Chs) ->
        │ │ │ -    NChs = StateFun(Chs),
        │ │ │ -    {ok, NChs, NChs}.

        If a special process is configured to trap exits, it must take notice │ │ │ +system_replace_state(StateFun, Chs) -> │ │ │ + NChs = StateFun(Chs), │ │ │ + {ok, NChs, NChs}.

        If a special process is configured to trap exits, it must take notice │ │ │ of 'EXIT' messages from its parent process and terminate using the │ │ │ -same exit reason once the parent process has terminated.

        Here is an example:

        init(Parent) ->
        │ │ │ +same exit reason once the parent process has terminated.

        Here is an example:

        init(Parent) ->
        │ │ │      ...,
        │ │ │ -    process_flag(trap_exit, true),
        │ │ │ +    process_flag(trap_exit, true),
        │ │ │      ...,
        │ │ │ -    loop(Parent).
        │ │ │ +    loop(Parent).
        │ │ │  
        │ │ │ -loop(Parent) ->
        │ │ │ +loop(Parent) ->
        │ │ │      receive
        │ │ │          ...
        │ │ │ -        {'EXIT', Parent, Reason} ->
        │ │ │ +        {'EXIT', Parent, Reason} ->
        │ │ │              %% Clean up here, if needed.
        │ │ │ -            exit(Reason);
        │ │ │ +            exit(Reason);
        │ │ │          ...
        │ │ │      end.

        │ │ │ │ │ │ │ │ │ │ │ │ User-Defined Behaviours │ │ │

        │ │ │ @@ -448,71 +448,71 @@ │ │ │ function. Note that the -optional_callbacks attribute is to be used together │ │ │ with the -callback attribute; it cannot be combined with the │ │ │ behaviour_info() function described below.

        Tools that need to know about optional callback functions can call │ │ │ Behaviour:behaviour_info(optional_callbacks) to get a list of all optional │ │ │ callback functions.

        Note

        We recommend using the -callback attribute rather than the │ │ │ behaviour_info() function. The reason is that the extra type information can │ │ │ be used by tools to produce documentation or find discrepancies.

        As an alternative to the -callback and -optional_callbacks attributes you │ │ │ -may directly implement and export behaviour_info():

        behaviour_info(callbacks) ->
        │ │ │ -    [{Name1, Arity1},...,{NameN, ArityN}].

        where each {Name, Arity} specifies the name and arity of a callback function. │ │ │ +may directly implement and export behaviour_info():

        behaviour_info(callbacks) ->
        │ │ │ +    [{Name1, Arity1},...,{NameN, ArityN}].

        where each {Name, Arity} specifies the name and arity of a callback function. │ │ │ This function is otherwise automatically generated by the compiler using the │ │ │ -callback attributes.

        When the compiler encounters the module attribute -behaviour(Behaviour). in a │ │ │ module Mod, it calls Behaviour:behaviour_info(callbacks) and compares the │ │ │ result with the set of functions actually exported from Mod, and issues a │ │ │ warning if any callback function is missing.

        Example:

        %% User-defined behaviour module
        │ │ │ --module(simple_server).
        │ │ │ --export([start_link/2, init/3, ...]).
        │ │ │ +-module(simple_server).
        │ │ │ +-export([start_link/2, init/3, ...]).
        │ │ │  
        │ │ │ --callback init(State :: term()) -> 'ok'.
        │ │ │ --callback handle_req(Req :: term(), State :: term()) -> {'ok', Reply :: term()}.
        │ │ │ --callback terminate() -> 'ok'.
        │ │ │ --callback format_state(State :: term()) -> term().
        │ │ │ +-callback init(State :: term()) -> 'ok'.
        │ │ │ +-callback handle_req(Req :: term(), State :: term()) -> {'ok', Reply :: term()}.
        │ │ │ +-callback terminate() -> 'ok'.
        │ │ │ +-callback format_state(State :: term()) -> term().
        │ │ │  
        │ │ │ --optional_callbacks([format_state/1]).
        │ │ │ +-optional_callbacks([format_state/1]).
        │ │ │  
        │ │ │  %% Alternatively you may define:
        │ │ │  %%
        │ │ │  %% -export([behaviour_info/1]).
        │ │ │  %% behaviour_info(callbacks) ->
        │ │ │  %%     [{init,1},
        │ │ │  %%      {handle_req,2},
        │ │ │  %%      {terminate,0}].
        │ │ │  
        │ │ │ -start_link(Name, Module) ->
        │ │ │ -    proc_lib:start_link(?MODULE, init, [self(), Name, Module]).
        │ │ │ +start_link(Name, Module) ->
        │ │ │ +    proc_lib:start_link(?MODULE, init, [self(), Name, Module]).
        │ │ │  
        │ │ │ -init(Parent, Name, Module) ->
        │ │ │ -    register(Name, self()),
        │ │ │ +init(Parent, Name, Module) ->
        │ │ │ +    register(Name, self()),
        │ │ │      ...,
        │ │ │ -    Dbg = sys:debug_options([]),
        │ │ │ -    proc_lib:init_ack(Parent, {ok, self()}),
        │ │ │ -    loop(Parent, Module, Deb, ...).
        │ │ │ +    Dbg = sys:debug_options([]),
        │ │ │ +    proc_lib:init_ack(Parent, {ok, self()}),
        │ │ │ +    loop(Parent, Module, Deb, ...).
        │ │ │  
        │ │ │ -...

        In a callback module:

        -module(db).
        │ │ │ --behaviour(simple_server).
        │ │ │ +...

        In a callback module:

        -module(db).
        │ │ │ +-behaviour(simple_server).
        │ │ │  
        │ │ │ --export([init/1, handle_req/2, terminate/0]).
        │ │ │ +-export([init/1, handle_req/2, terminate/0]).
        │ │ │  
        │ │ │  ...

        The contracts specified with -callback attributes in behaviour modules can be │ │ │ further refined by adding -spec attributes in callback modules. This can be │ │ │ useful as -callback contracts are usually generic. The same callback module │ │ │ -with contracts for the callbacks:

        -module(db).
        │ │ │ --behaviour(simple_server).
        │ │ │ +with contracts for the callbacks:

        -module(db).
        │ │ │ +-behaviour(simple_server).
        │ │ │  
        │ │ │ --export([init/1, handle_req/2, terminate/0]).
        │ │ │ +-export([init/1, handle_req/2, terminate/0]).
        │ │ │  
        │ │ │ --record(state, {field1 :: [atom()], field2 :: integer()}).
        │ │ │ +-record(state, {field1 :: [atom()], field2 :: integer()}).
        │ │ │  
        │ │ │ --type state()   :: #state{}.
        │ │ │ --type request() :: {'store', term(), term()};
        │ │ │ -                   {'lookup', term()}.
        │ │ │ +-type state()   :: #state{}.
        │ │ │ +-type request() :: {'store', term(), term()};
        │ │ │ +                   {'lookup', term()}.
        │ │ │  
        │ │ │  ...
        │ │ │  
        │ │ │ --spec handle_req(request(), state()) -> {'ok', term()}.
        │ │ │ +-spec handle_req(request(), state()) -> {'ok', term()}.
        │ │ │  
        │ │ │  ...

        Each -spec contract is to be a subtype of the respective -callback contract.

        │ │ │ │ │ │ │ │ │
        │ │ │
        │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/statem.html │ │ │ @@ -124,15 +124,15 @@ │ │ │ │ │ │

        Established Automata Theory does not deal much with how a state transition │ │ │ is triggered, but assumes that the output is a function of the input │ │ │ (and the state) and that they are some kind of values.

        For an Event-Driven State Machine, the input is an event that triggers │ │ │ a state transition and the output is actions executed during │ │ │ the state transition. Analogously to the mathematical model │ │ │ of a Finite State Machine, it can be described as a set of relations │ │ │ -of the following form:

        State(S) x Event(E) -> Actions(A), State(S')

        These relations are interpreted as follows: if we are in state S, │ │ │ +of the following form:

        State(S) x Event(E) -> Actions(A), State(S')

        These relations are interpreted as follows: if we are in state S, │ │ │ and event E occurs, we are to perform actions A, and make a transition │ │ │ to state S'. Notice that S' can be equal to S, │ │ │ and that A can be empty.

        In gen_statem we define a state change as a state transition in which the │ │ │ new state S' is different from the current state S, where "different" means │ │ │ Erlang's strict inequality: =/= also known as "does not match". gen_statem │ │ │ does more things during state changes than during other state transitions.

        As A and S' depend only on S and E, the kind of state machine described │ │ │ here is a Mealy machine (see, for example, the Wikipedia article │ │ │ @@ -405,20 +405,20 @@ │ │ │ │ │ │ State Enter Calls │ │ │ │ │ │

        The gen_statem behaviour can, if this is enabled, regardless of callback │ │ │ mode, automatically call the state callback │ │ │ with special arguments whenever the state changes, so you can write │ │ │ state enter actions near the rest of the state transition rules. │ │ │ -It typically looks like this:

        StateName(enter, OldState, Data) ->
        │ │ │ +It typically looks like this:

        StateName(enter, OldState, Data) ->
        │ │ │      ... code for state enter actions here ...
        │ │ │ -    {keep_state, NewData};
        │ │ │ -StateName(EventType, EventContent, Data) ->
        │ │ │ +    {keep_state, NewData};
        │ │ │ +StateName(EventType, EventContent, Data) ->
        │ │ │      ... code for actions here ...
        │ │ │ -    {next_state, NewStateName, NewData}.

        Since the state enter call is not an event there are restrictions on the │ │ │ + {next_state, NewStateName, NewData}.

        Since the state enter call is not an event there are restrictions on the │ │ │ allowed return value and state transition actions. │ │ │ You must not change the state, postpone this non-event, │ │ │ insert any events, or change the │ │ │ callback module.

        The first state that is entered after gen_statem:init/1 will get │ │ │ a state enter call with OldState equal to the current state.

        You may repeat the state enter call using the {repeat_state,...} return │ │ │ value from the state callback. In this case │ │ │ OldState will also be equal to the current state.

        Depending on how your state machine is specified, this can be a very useful │ │ │ @@ -499,72 +499,72 @@ │ │ │ │ │ │ locked --> check_code : {button, Button}\n* Collect Buttons │ │ │ check_code --> locked : Incorrect code │ │ │ check_code --> open : Correct code\n* do_unlock()\n* Clear Buttons\n* Set state_timeout 10 s │ │ │ │ │ │ open --> open : {button, Digit} │ │ │ open --> locked : state_timeout\n* do_lock()

        This code lock state machine can be implemented using gen_statem with │ │ │ -the following callback module:

        -module(code_lock).
        │ │ │ --behaviour(gen_statem).
        │ │ │ --define(NAME, code_lock).
        │ │ │ +the following callback module:

        -module(code_lock).
        │ │ │ +-behaviour(gen_statem).
        │ │ │ +-define(NAME, code_lock).
        │ │ │  
        │ │ │ --export([start_link/1]).
        │ │ │ --export([button/1]).
        │ │ │ --export([init/1,callback_mode/0,terminate/3]).
        │ │ │ --export([locked/3,open/3]).
        │ │ │ -
        │ │ │ -start_link(Code) ->
        │ │ │ -    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
        │ │ │ -
        │ │ │ -button(Button) ->
        │ │ │ -    gen_statem:cast(?NAME, {button,Button}).
        │ │ │ -
        │ │ │ -init(Code) ->
        │ │ │ -    do_lock(),
        │ │ │ -    Data = #{code => Code, length => length(Code), buttons => []},
        │ │ │ -    {ok, locked, Data}.
        │ │ │ -
        │ │ │ -callback_mode() ->
        │ │ │ -    state_functions.
        locked(
        │ │ │ -  cast, {button,Button},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +-export([start_link/1]).
        │ │ │ +-export([button/1]).
        │ │ │ +-export([init/1,callback_mode/0,terminate/3]).
        │ │ │ +-export([locked/3,open/3]).
        │ │ │ +
        │ │ │ +start_link(Code) ->
        │ │ │ +    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
        │ │ │ +
        │ │ │ +button(Button) ->
        │ │ │ +    gen_statem:cast(?NAME, {button,Button}).
        │ │ │ +
        │ │ │ +init(Code) ->
        │ │ │ +    do_lock(),
        │ │ │ +    Data = #{code => Code, length => length(Code), buttons => []},
        │ │ │ +    {ok, locked, Data}.
        │ │ │ +
        │ │ │ +callback_mode() ->
        │ │ │ +    state_functions.
        locked(
        │ │ │ +  cast, {button,Button},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │      NewButtons =
        │ │ │          if
        │ │ │ -            length(Buttons) < Length ->
        │ │ │ +            length(Buttons) < Length ->
        │ │ │                  Buttons;
        │ │ │              true ->
        │ │ │ -                tl(Buttons)
        │ │ │ -        end ++ [Button],
        │ │ │ +                tl(Buttons)
        │ │ │ +        end ++ [Button],
        │ │ │      if
        │ │ │          NewButtons =:= Code -> % Correct
        │ │ │ -	    do_unlock(),
        │ │ │ -            {next_state, open, Data#{buttons := []},
        │ │ │ -             [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ +	    do_unlock(),
        │ │ │ +            {next_state, open, Data#{buttons := []},
        │ │ │ +             [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │  	true -> % Incomplete | Incorrect
        │ │ │ -            {next_state, locked, Data#{buttons := NewButtons}}
        │ │ │ -    end.
        open(state_timeout, lock,  Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {next_state, locked, Data};
        │ │ │ -open(cast, {button,_}, Data) ->
        │ │ │ -    {next_state, open, Data}.
        do_lock() ->
        │ │ │ -    io:format("Lock~n", []).
        │ │ │ -do_unlock() ->
        │ │ │ -    io:format("Unlock~n", []).
        │ │ │ +            {next_state, locked, Data#{buttons := NewButtons}}
        │ │ │ +    end.
        open(state_timeout, lock,  Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {next_state, locked, Data};
        │ │ │ +open(cast, {button,_}, Data) ->
        │ │ │ +    {next_state, open, Data}.
        do_lock() ->
        │ │ │ +    io:format("Lock~n", []).
        │ │ │ +do_unlock() ->
        │ │ │ +    io:format("Unlock~n", []).
        │ │ │  
        │ │ │ -terminate(_Reason, State, _Data) ->
        │ │ │ -    State =/= locked andalso do_lock(),
        │ │ │ +terminate(_Reason, State, _Data) ->
        │ │ │ +    State =/= locked andalso do_lock(),
        │ │ │      ok.

        The code is explained in the next sections.

        │ │ │ │ │ │ │ │ │ │ │ │ Starting gen_statem │ │ │

        │ │ │

        In the example in the previous section, gen_statem is started by calling │ │ │ -code_lock:start_link(Code):

        start_link(Code) ->
        │ │ │ -    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).

        start_link/1 calls function gen_statem:start_link/4, │ │ │ +code_lock:start_link(Code):

        start_link(Code) ->
        │ │ │ +    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).

        start_link/1 calls function gen_statem:start_link/4, │ │ │ which spawns and links to a new process, a gen_statem.

        • The first argument, {local,?NAME}, specifies the name. In this case, the │ │ │ gen_statem is locally registered as code_lock through the macro ?NAME.

          If the name is omitted, the gen_statem is not registered. Instead its pid │ │ │ must be used. The name can also be specified as {global, Name}, then the │ │ │ gen_statem is registered using global:register_name/2 in Kernel.

        • The second argument, ?MODULE, is the name of the callback module, │ │ │ that is, the module where the callback functions are located, │ │ │ which is this module.

          The interface functions (start_link/1 and button/1) are located in the │ │ │ same module as the callback functions (init/1, locked/3, and open/3). │ │ │ @@ -574,184 +574,184 @@ │ │ │ see gen_statem:start_link/3.

        If name registration succeeds, the new gen_statem process calls callback │ │ │ function code_lock:init(Code). This function is expected to return │ │ │ {ok, State, Data}, where State is the initial state of the gen_statem, │ │ │ in this case locked; assuming that the door is locked to begin with. │ │ │ Data is the internal server data of the gen_statem. Here the server data │ │ │ is a map() with key code that stores the correct │ │ │ button sequence, key length store its length, and key buttons │ │ │ -that stores the collected buttons up to the same length.

        init(Code) ->
        │ │ │ -    do_lock(),
        │ │ │ -    Data = #{code => Code, length => length(Code), buttons => []},
        │ │ │ -    {ok, locked, Data}.

        Function gen_statem:start_link/3,4 │ │ │ +that stores the collected buttons up to the same length.

        init(Code) ->
        │ │ │ +    do_lock(),
        │ │ │ +    Data = #{code => Code, length => length(Code), buttons => []},
        │ │ │ +    {ok, locked, Data}.

        Function gen_statem:start_link/3,4 │ │ │ is synchronous. It does not return until the gen_statem is initialized │ │ │ and is ready to receive events.

        Function gen_statem:start_link/3,4 │ │ │ must be used if the gen_statem is part of a supervision tree, that is, │ │ │ started by a supervisor. Function, │ │ │ gen_statem:start/3,4 can be used to start │ │ │ a standalone gen_statem, meaning it is not part of a supervision tree.

        Function Module:callback_mode/0 selects │ │ │ the CallbackMode for the callback module, │ │ │ in this case state_functions. │ │ │ -That is, each state has its own handler function:

        callback_mode() ->
        │ │ │ +That is, each state has its own handler function:

        callback_mode() ->
        │ │ │      state_functions.

        │ │ │ │ │ │ │ │ │ │ │ │ Handling Events │ │ │

        │ │ │

        The function notifying the code lock about a button event is implemented using │ │ │ -gen_statem:cast/2:

        button(Button) ->
        │ │ │ -    gen_statem:cast(?NAME, {button,Button}).

        The first argument is the name of the gen_statem and must agree with │ │ │ +gen_statem:cast/2:

        button(Button) ->
        │ │ │ +    gen_statem:cast(?NAME, {button,Button}).

        The first argument is the name of the gen_statem and must agree with │ │ │ the name used to start it. So, we use the same macro ?NAME as when starting. │ │ │ {button, Button} is the event content.

        The event is sent to the gen_statem. When the event is received, the │ │ │ gen_statem calls StateName(cast, Event, Data), which is expected │ │ │ to return a tuple {next_state, NewStateName, NewData}, or │ │ │ {next_state, NewStateName, NewData, Actions}. StateName is the name │ │ │ of the current state and NewStateName is the name of the next state. │ │ │ NewData is a new value for the server data of the gen_statem, │ │ │ -and Actions is a list of actions to be performed by the gen_statem engine.

        locked(
        │ │ │ -  cast, {button,Button},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +and Actions is a list of actions to be performed by the gen_statem engine.

        locked(
        │ │ │ +  cast, {button,Button},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │      NewButtons =
        │ │ │          if
        │ │ │ -            length(Buttons) < Length ->
        │ │ │ +            length(Buttons) < Length ->
        │ │ │                  Buttons;
        │ │ │              true ->
        │ │ │ -                tl(Buttons)
        │ │ │ -        end ++ [Button],
        │ │ │ +                tl(Buttons)
        │ │ │ +        end ++ [Button],
        │ │ │      if
        │ │ │          NewButtons =:= Code -> % Correct
        │ │ │ -	    do_unlock(),
        │ │ │ -            {next_state, open, Data#{buttons := []},
        │ │ │ -             [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ +	    do_unlock(),
        │ │ │ +            {next_state, open, Data#{buttons := []},
        │ │ │ +             [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │  	true -> % Incomplete | Incorrect
        │ │ │ -            {next_state, locked, Data#{buttons := NewButtons}}
        │ │ │ +            {next_state, locked, Data#{buttons := NewButtons}}
        │ │ │      end.

        In state locked, when a button is pressed, it is collected with the │ │ │ previously pressed buttons up to the length of the correct code, then │ │ │ compared with the correct code. Depending on the result, the door is │ │ │ either unlocked and the gen_statem goes to state open, or the door │ │ │ remains in state locked.

        When changing to state open, the collected buttons are reset, the lock │ │ │ -unlocked, and a state time-out for 10 seconds is started.

        open(cast, {button,_}, Data) ->
        │ │ │ -    {next_state, open, Data}.

        In state open, a button event is ignored by staying in the same state. │ │ │ +unlocked, and a state time-out for 10 seconds is started.

        open(cast, {button,_}, Data) ->
        │ │ │ +    {next_state, open, Data}.

        In state open, a button event is ignored by staying in the same state. │ │ │ This can also be done by returning {keep_state, Data}, or in this case │ │ │ since Data is unchanged, by returning keep_state_and_data.

        │ │ │ │ │ │ │ │ │ │ │ │ State Time-Outs │ │ │

        │ │ │

        When a correct code has been given, the door is unlocked and the following │ │ │ -tuple is returned from locked/2:

        {next_state, open, Data#{buttons := []},
        │ │ │ - [{state_timeout,10_000,lock}]}; % Time in milliseconds

        10,000 is a time-out value in milliseconds. After this time (10 seconds), │ │ │ +tuple is returned from locked/2:

        {next_state, open, Data#{buttons := []},
        │ │ │ + [{state_timeout,10_000,lock}]}; % Time in milliseconds

        10,000 is a time-out value in milliseconds. After this time (10 seconds), │ │ │ a time-out occurs. Then, StateName(state_timeout, lock, Data) is called. │ │ │ The time-out occurs when the door has been in state open for 10 seconds. │ │ │ -After that the door is locked again:

        open(state_timeout, lock,  Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {next_state, locked, Data};

        The timer for a state time-out is automatically canceled when │ │ │ +After that the door is locked again:

        open(state_timeout, lock,  Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {next_state, locked, Data};

        The timer for a state time-out is automatically canceled when │ │ │ the state machine does a state change.

        You can restart, cancel, or update a state time-out. See section │ │ │ Time-Outs for details.

        │ │ │ │ │ │ │ │ │ │ │ │ All State Events │ │ │

        │ │ │

        Sometimes events can arrive in any state of the gen_statem. It is convenient │ │ │ to handle these in a common state handler function that all state functions │ │ │ call for events not specific to the state.

        Consider a code_length/0 function that returns the length │ │ │ of the correct code. We dispatch all events that are not state-specific │ │ │ to the common function handle_common/3:

        ...
        │ │ │ --export([button/1,code_length/0]).
        │ │ │ +-export([button/1,code_length/0]).
        │ │ │  ...
        │ │ │  
        │ │ │ -code_length() ->
        │ │ │ -    gen_statem:call(?NAME, code_length).
        │ │ │ +code_length() ->
        │ │ │ +    gen_statem:call(?NAME, code_length).
        │ │ │  
        │ │ │  ...
        │ │ │ -locked(...) -> ... ;
        │ │ │ -locked(EventType, EventContent, Data) ->
        │ │ │ -    handle_common(EventType, EventContent, Data).
        │ │ │ +locked(...) -> ... ;
        │ │ │ +locked(EventType, EventContent, Data) ->
        │ │ │ +    handle_common(EventType, EventContent, Data).
        │ │ │  
        │ │ │  ...
        │ │ │ -open(...) -> ... ;
        │ │ │ -open(EventType, EventContent, Data) ->
        │ │ │ -    handle_common(EventType, EventContent, Data).
        │ │ │ -
        │ │ │ -handle_common({call,From}, code_length, #{code := Code} = Data) ->
        │ │ │ -    {keep_state, Data,
        │ │ │ -     [{reply,From,length(Code)}]}.

        Another way to do it is through a convenience macro ?HANDLE_COMMON/0:

        ...
        │ │ │ --export([button/1,code_length/0]).
        │ │ │ +open(...) -> ... ;
        │ │ │ +open(EventType, EventContent, Data) ->
        │ │ │ +    handle_common(EventType, EventContent, Data).
        │ │ │ +
        │ │ │ +handle_common({call,From}, code_length, #{code := Code} = Data) ->
        │ │ │ +    {keep_state, Data,
        │ │ │ +     [{reply,From,length(Code)}]}.

        Another way to do it is through a convenience macro ?HANDLE_COMMON/0:

        ...
        │ │ │ +-export([button/1,code_length/0]).
        │ │ │  ...
        │ │ │  
        │ │ │ -code_length() ->
        │ │ │ -    gen_statem:call(?NAME, code_length).
        │ │ │ +code_length() ->
        │ │ │ +    gen_statem:call(?NAME, code_length).
        │ │ │  
        │ │ │ --define(HANDLE_COMMON,
        │ │ │ -    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, D)).
        │ │ │ +-define(HANDLE_COMMON,
        │ │ │ +    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, D)).
        │ │ │  %%
        │ │ │ -handle_common({call,From}, code_length, #{code := Code} = Data) ->
        │ │ │ -    {keep_state, Data,
        │ │ │ -     [{reply,From,length(Code)}]}.
        │ │ │ +handle_common({call,From}, code_length, #{code := Code} = Data) ->
        │ │ │ +    {keep_state, Data,
        │ │ │ +     [{reply,From,length(Code)}]}.
        │ │ │  
        │ │ │  ...
        │ │ │ -locked(...) -> ... ;
        │ │ │ +locked(...) -> ... ;
        │ │ │  ?HANDLE_COMMON.
        │ │ │  
        │ │ │  ...
        │ │ │ -open(...) -> ... ;
        │ │ │ +open(...) -> ... ;
        │ │ │  ?HANDLE_COMMON.

        This example uses gen_statem:call/2, which waits for a reply from the server. │ │ │ The reply is sent with a {reply, From, Reply} tuple in an action list in the │ │ │ {keep_state, ...} tuple that retains the current state. This return form is │ │ │ convenient when you want to stay in the current state but do not know or care │ │ │ about what it is.

        If the common state callback needs to know the current state a function │ │ │ -handle_common/4 can be used instead:

        -define(HANDLE_COMMON,
        │ │ │ -    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, ?FUNCTION_NAME, D)).

        │ │ │ +handle_common/4 can be used instead:

        -define(HANDLE_COMMON,
        │ │ │ +    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, ?FUNCTION_NAME, D)).

        │ │ │ │ │ │ │ │ │ │ │ │ One State Callback │ │ │

        │ │ │

        If callback mode handle_event_function is used, │ │ │ all events are handled in │ │ │ Module:handle_event/4 and we can │ │ │ (but do not have to) use an event-centered approach where we first branch │ │ │ depending on event and then depending on state:

        ...
        │ │ │ --export([handle_event/4]).
        │ │ │ +-export([handle_event/4]).
        │ │ │  
        │ │ │  ...
        │ │ │ -callback_mode() ->
        │ │ │ +callback_mode() ->
        │ │ │      handle_event_function.
        │ │ │  
        │ │ │ -handle_event(cast, {button,Button}, State, #{code := Code} = Data) ->
        │ │ │ +handle_event(cast, {button,Button}, State, #{code := Code} = Data) ->
        │ │ │      case State of
        │ │ │  	locked ->
        │ │ │ -            #{length := Length, buttons := Buttons} = Data,
        │ │ │ +            #{length := Length, buttons := Buttons} = Data,
        │ │ │              NewButtons =
        │ │ │                  if
        │ │ │ -                    length(Buttons) < Length ->
        │ │ │ +                    length(Buttons) < Length ->
        │ │ │                          Buttons;
        │ │ │                      true ->
        │ │ │ -                        tl(Buttons)
        │ │ │ -                end ++ [Button],
        │ │ │ +                        tl(Buttons)
        │ │ │ +                end ++ [Button],
        │ │ │              if
        │ │ │                  NewButtons =:= Code -> % Correct
        │ │ │ -                    do_unlock(),
        │ │ │ -                    {next_state, open, Data#{buttons := []},
        │ │ │ -                     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ +                    do_unlock(),
        │ │ │ +                    {next_state, open, Data#{buttons := []},
        │ │ │ +                     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │                  true -> % Incomplete | Incorrect
        │ │ │ -                    {keep_state, Data#{buttons := NewButtons}}
        │ │ │ +                    {keep_state, Data#{buttons := NewButtons}}
        │ │ │              end;
        │ │ │  	open ->
        │ │ │              keep_state_and_data
        │ │ │      end;
        │ │ │ -handle_event(state_timeout, lock, open, Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {next_state, locked, Data};
        │ │ │ -handle_event(
        │ │ │ -  {call,From}, code_length, _State, #{code := Code} = Data) ->
        │ │ │ -    {keep_state, Data,
        │ │ │ -     [{reply,From,length(Code)}]}.
        │ │ │ +handle_event(state_timeout, lock, open, Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {next_state, locked, Data};
        │ │ │ +handle_event(
        │ │ │ +  {call,From}, code_length, _State, #{code := Code} = Data) ->
        │ │ │ +    {keep_state, Data,
        │ │ │ +     [{reply,From,length(Code)}]}.
        │ │ │  
        │ │ │  ...

        │ │ │ │ │ │ │ │ │ │ │ │ Stopping │ │ │

        │ │ │ @@ -763,59 +763,59 @@ │ │ │ │ │ │

        If the gen_statem is part of a supervision tree, no stop function is needed. │ │ │ The gen_statem is automatically terminated by its supervisor. Exactly how │ │ │ this is done is defined by a shutdown strategy │ │ │ set in the supervisor.

        If it is necessary to clean up before termination, the shutdown strategy │ │ │ must be a time-out value and the gen_statem must in function init/1 │ │ │ set itself to trap exit signals by calling │ │ │ -process_flag(trap_exit, true):

        init(Args) ->
        │ │ │ -    process_flag(trap_exit, true),
        │ │ │ -    do_lock(),
        │ │ │ +process_flag(trap_exit, true):

        init(Args) ->
        │ │ │ +    process_flag(trap_exit, true),
        │ │ │ +    do_lock(),
        │ │ │      ...

        When ordered to shut down, the gen_statem then calls callback function │ │ │ terminate(shutdown, State, Data).

        In this example, function terminate/3 locks the door if it is open, │ │ │ so we do not accidentally leave the door open │ │ │ -when the supervision tree terminates:

        terminate(_Reason, State, _Data) ->
        │ │ │ -    State =/= locked andalso do_lock(),
        │ │ │ +when the supervision tree terminates:

        terminate(_Reason, State, _Data) ->
        │ │ │ +    State =/= locked andalso do_lock(),
        │ │ │      ok.

        │ │ │ │ │ │ │ │ │ │ │ │ Standalone gen_statem │ │ │

        │ │ │

        If the gen_statem is not part of a supervision tree, it can be stopped │ │ │ using gen_statem:stop/1, preferably through │ │ │ an API function:

        ...
        │ │ │ --export([start_link/1,stop/0]).
        │ │ │ +-export([start_link/1,stop/0]).
        │ │ │  
        │ │ │  ...
        │ │ │ -stop() ->
        │ │ │ -    gen_statem:stop(?NAME).

        This makes the gen_statem call callback function terminate/3 just like │ │ │ +stop() -> │ │ │ + gen_statem:stop(?NAME).

        This makes the gen_statem call callback function terminate/3 just like │ │ │ for a supervised server and waits for the process to terminate.

        │ │ │ │ │ │ │ │ │ │ │ │ Event Time-Outs │ │ │

        │ │ │

        A time-out feature inherited from gen_statem's predecessor gen_fsm, │ │ │ is an event time-out, that is, if an event arrives the timer is canceled. │ │ │ You get either an event or a time-out, but not both.

        It is ordered by the │ │ │ transition action {timeout, Time, EventContent}, │ │ │ or just an integer Time, even without the enclosing actions list (the latter │ │ │ is a form inherited from gen_fsm).

        This type of time-out is useful, for example, to act on inactivity. │ │ │ Let's restart the code sequence if no button is pressed for say 30 seconds:

        ...
        │ │ │  
        │ │ │ -locked(timeout, _, Data) ->
        │ │ │ -    {next_state, locked, Data#{buttons := []}};
        │ │ │ -locked(
        │ │ │ -  cast, {button,Button},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +locked(timeout, _, Data) ->
        │ │ │ +    {next_state, locked, Data#{buttons := []}};
        │ │ │ +locked(
        │ │ │ +  cast, {button,Button},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │  ...
        │ │ │  	true -> % Incomplete | Incorrect
        │ │ │ -            {next_state, locked, Data#{buttons := NewButtons},
        │ │ │ -             30_000} % Time in milliseconds
        │ │ │ +            {next_state, locked, Data#{buttons := NewButtons},
        │ │ │ +             30_000} % Time in milliseconds
        │ │ │  ...

        Whenever we receive a button event we start an event time-out of 30 seconds, │ │ │ and if we get an event type of timeout we reset the remaining │ │ │ code sequence.

        An event time-out is canceled by any other event so you either get │ │ │ some other event or the time-out event. Therefore, canceling, │ │ │ restarting, or updating an event time-out is neither possible nor │ │ │ necessary. Whatever event you act on has already canceled │ │ │ the event time-out, so there is never a running event time-out │ │ │ @@ -834,30 +834,30 @@ │ │ │ another, maybe cancel the time-out without changing states, or perhaps run │ │ │ multiple time-outs in parallel. All this can be accomplished with │ │ │ generic time-outs. They may look a little │ │ │ bit like event time-outs but contain │ │ │ a name to allow for any number of them simultaneously and they are │ │ │ not automatically canceled.

        Here is how to accomplish the state time-out in the previous example │ │ │ by instead using a generic time-out named for example open:

        ...
        │ │ │ -locked(
        │ │ │ -  cast, {button,Button},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +locked(
        │ │ │ +  cast, {button,Button},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │  ...
        │ │ │      if
        │ │ │          NewButtons =:= Code -> % Correct
        │ │ │ -	    do_unlock(),
        │ │ │ -            {next_state, open, Data#{buttons := []},
        │ │ │ -             [{{timeout,open},10_000,lock}]}; % Time in milliseconds
        │ │ │ +	    do_unlock(),
        │ │ │ +            {next_state, open, Data#{buttons := []},
        │ │ │ +             [{{timeout,open},10_000,lock}]}; % Time in milliseconds
        │ │ │  ...
        │ │ │  
        │ │ │ -open({timeout,open}, lock, Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {next_state,locked,Data};
        │ │ │ -open(cast, {button,_}, Data) ->
        │ │ │ -    {keep_state,Data};
        │ │ │ +open({timeout,open}, lock, Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {next_state,locked,Data};
        │ │ │ +open(cast, {button,_}, Data) ->
        │ │ │ +    {keep_state,Data};
        │ │ │  ...

        Specific generic time-outs can just as state time-outs │ │ │ be restarted or canceled by setting it to a new time or infinity.

        In this particular case we do not need to cancel the time-out since │ │ │ the time-out event is the only possible reason to do a state change │ │ │ from open to locked.

        Instead of bothering with when to cancel a time-out, a late time-out event │ │ │ can be handled by ignoring it if it arrives in a state │ │ │ where it is known to be late.

        You can restart, cancel, or update a generic time-out. │ │ │ See section Time-Outs for details.

        │ │ │ @@ -869,32 +869,32 @@ │ │ │

        The most versatile way to handle time-outs is to use Erlang Timers; see │ │ │ erlang:start_timer/3,4. Most time-out tasks │ │ │ can be performed with the time-out features in gen_statem, │ │ │ but an example of one that cannot is if you should need the return value │ │ │ from erlang:cancel_timer(Tref), that is, │ │ │ the remaining time of the timer.

        Here is how to accomplish the state time-out in the previous example │ │ │ by instead using an Erlang Timer:

        ...
        │ │ │ -locked(
        │ │ │ -  cast, {button,Button},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +locked(
        │ │ │ +  cast, {button,Button},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │  ...
        │ │ │      if
        │ │ │          NewButtons =:= Code -> % Correct
        │ │ │ -	    do_unlock(),
        │ │ │ +	    do_unlock(),
        │ │ │  	    Tref =
        │ │ │ -                 erlang:start_timer(
        │ │ │ -                     10_000, self(), lock), % Time in milliseconds
        │ │ │ -            {next_state, open, Data#{buttons := [], timer => Tref}};
        │ │ │ +                 erlang:start_timer(
        │ │ │ +                     10_000, self(), lock), % Time in milliseconds
        │ │ │ +            {next_state, open, Data#{buttons := [], timer => Tref}};
        │ │ │  ...
        │ │ │  
        │ │ │ -open(info, {timeout,Tref,lock}, #{timer := Tref} = Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {next_state,locked,maps:remove(timer, Data)};
        │ │ │ -open(cast, {button,_}, Data) ->
        │ │ │ -    {keep_state,Data};
        │ │ │ +open(info, {timeout,Tref,lock}, #{timer := Tref} = Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {next_state,locked,maps:remove(timer, Data)};
        │ │ │ +open(cast, {button,_}, Data) ->
        │ │ │ +    {keep_state,Data};
        │ │ │  ...

        Removing the timer key from the map when we do a state change to locked │ │ │ is not strictly necessary since we can only get into state open │ │ │ with an updated timer map value. But it can be nice to not have │ │ │ outdated values in the state Data.

        If you need to cancel a timer because of some other event, you can use │ │ │ erlang:cancel_timer(Tref). Note that no time-out │ │ │ message will arrive after this (because the timer has been │ │ │ explicitly canceled), unless you have already postponed one earlier │ │ │ @@ -910,16 +910,16 @@ │ │ │ Postponing Events │ │ │

        │ │ │

        If you want to ignore a particular event in the current state and handle it │ │ │ in a future state, you can postpone the event. A postponed event │ │ │ is retried after a state change, that is, OldState =/= NewState.

        Postponing is ordered by the │ │ │ transition action postpone.

        In this example, instead of ignoring button events while in the open state, │ │ │ we can postpone them handle them later in the locked state:

        ...
        │ │ │ -open(cast, {button,_}, Data) ->
        │ │ │ -    {keep_state,Data,[postpone]};
        │ │ │ +open(cast, {button,_}, Data) ->
        │ │ │ +    {keep_state,Data,[postpone]};
        │ │ │  ...

        Since a postponed event is only retried after a state change, you have to │ │ │ think about where to keep a state data item. You can keep it in the server │ │ │ Data or in the State itself, for example by having two more or less │ │ │ identical states to keep a boolean value, or by using a complex state (see │ │ │ section Complex State) with │ │ │ callback mode │ │ │ handle_event_function. If a change │ │ │ @@ -940,55 +940,55 @@ │ │ │ │ │ │ │ │ │ │ │ │ Selective Receive │ │ │ │ │ │

        Erlang's selective receive statement is often used to describe simple state │ │ │ machine examples in straightforward Erlang code. The following is a possible │ │ │ -implementation of the first example:

        -module(code_lock).
        │ │ │ --define(NAME, code_lock_1).
        │ │ │ --export([start_link/1,button/1]).
        │ │ │ -
        │ │ │ -start_link(Code) ->
        │ │ │ -    spawn(
        │ │ │ -      fun () ->
        │ │ │ -	      true = register(?NAME, self()),
        │ │ │ -	      do_lock(),
        │ │ │ -	      locked(Code, length(Code), [])
        │ │ │ -      end).
        │ │ │ +implementation of the first example:

        -module(code_lock).
        │ │ │ +-define(NAME, code_lock_1).
        │ │ │ +-export([start_link/1,button/1]).
        │ │ │ +
        │ │ │ +start_link(Code) ->
        │ │ │ +    spawn(
        │ │ │ +      fun () ->
        │ │ │ +	      true = register(?NAME, self()),
        │ │ │ +	      do_lock(),
        │ │ │ +	      locked(Code, length(Code), [])
        │ │ │ +      end).
        │ │ │  
        │ │ │ -button(Button) ->
        │ │ │ -    ?NAME ! {button,Button}.
        locked(Code, Length, Buttons) ->
        │ │ │ +button(Button) ->
        │ │ │ +    ?NAME ! {button,Button}.
        locked(Code, Length, Buttons) ->
        │ │ │      receive
        │ │ │ -        {button,Button} ->
        │ │ │ +        {button,Button} ->
        │ │ │              NewButtons =
        │ │ │                  if
        │ │ │ -                    length(Buttons) < Length ->
        │ │ │ +                    length(Buttons) < Length ->
        │ │ │                          Buttons;
        │ │ │                      true ->
        │ │ │ -                        tl(Buttons)
        │ │ │ -                end ++ [Button],
        │ │ │ +                        tl(Buttons)
        │ │ │ +                end ++ [Button],
        │ │ │              if
        │ │ │                  NewButtons =:= Code -> % Correct
        │ │ │ -                    do_unlock(),
        │ │ │ -		    open(Code, Length);
        │ │ │ +                    do_unlock(),
        │ │ │ +		    open(Code, Length);
        │ │ │                  true -> % Incomplete | Incorrect
        │ │ │ -                    locked(Code, Length, NewButtons)
        │ │ │ +                    locked(Code, Length, NewButtons)
        │ │ │              end
        │ │ │ -    end.
        open(Code, Length) ->
        │ │ │ +    end.
        open(Code, Length) ->
        │ │ │      receive
        │ │ │      after 10_000 -> % Time in milliseconds
        │ │ │ -	    do_lock(),
        │ │ │ -	    locked(Code, Length, [])
        │ │ │ +	    do_lock(),
        │ │ │ +	    locked(Code, Length, [])
        │ │ │      end.
        │ │ │  
        │ │ │ -do_lock() ->
        │ │ │ -    io:format("Locked~n", []).
        │ │ │ -do_unlock() ->
        │ │ │ -    io:format("Open~n", []).

        The selective receive in this case causes open to implicitly postpone any │ │ │ +do_lock() -> │ │ │ + io:format("Locked~n", []). │ │ │ +do_unlock() -> │ │ │ + io:format("Open~n", []).

        The selective receive in this case causes open to implicitly postpone any │ │ │ events to the locked state.

        A catch-all receive should never be used from a gen_statem behaviour │ │ │ (or from any gen_* behaviour), as the receive statement is within │ │ │ the gen_* engine itself. sys-compatible behaviours must respond to │ │ │ system messages and therefore do that in their engine receive loop, │ │ │ passing non-system messages to the callback module. Using a catch-all │ │ │ receive can result in system messages being discarded, which in turn │ │ │ can lead to unexpected behaviour. If a selective receive must be used, │ │ │ @@ -1011,40 +1011,40 @@ │ │ │ section), especially if only one or a few states have state enter actions, │ │ │ this is a perfect use case for the built in │ │ │ state enter calls.

        You return a list containing state_enter from your │ │ │ callback_mode/0 function and the │ │ │ gen_statem engine will call your state callback once with an event │ │ │ (enter, OldState, ...) whenever it does a state change. Then you │ │ │ just need to handle these event-like calls in all states.

        ...
        │ │ │ -init(Code) ->
        │ │ │ -    process_flag(trap_exit, true),
        │ │ │ -    Data = #{code => Code, length = length(Code)},
        │ │ │ -    {ok, locked, Data}.
        │ │ │ -
        │ │ │ -callback_mode() ->
        │ │ │ -    [state_functions,state_enter].
        │ │ │ -
        │ │ │ -locked(enter, _OldState, Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {keep_state,Data#{buttons => []}};
        │ │ │ -locked(
        │ │ │ -  cast, {button,Button},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +init(Code) ->
        │ │ │ +    process_flag(trap_exit, true),
        │ │ │ +    Data = #{code => Code, length = length(Code)},
        │ │ │ +    {ok, locked, Data}.
        │ │ │ +
        │ │ │ +callback_mode() ->
        │ │ │ +    [state_functions,state_enter].
        │ │ │ +
        │ │ │ +locked(enter, _OldState, Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {keep_state,Data#{buttons => []}};
        │ │ │ +locked(
        │ │ │ +  cast, {button,Button},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │  ...
        │ │ │      if
        │ │ │          NewButtons =:= Code -> % Correct
        │ │ │ -            {next_state, open, Data};
        │ │ │ +            {next_state, open, Data};
        │ │ │  ...
        │ │ │  
        │ │ │ -open(enter, _OldState, _Data) ->
        │ │ │ -    do_unlock(),
        │ │ │ -    {keep_state_and_data,
        │ │ │ -     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ -open(state_timeout, lock, Data) ->
        │ │ │ -    {next_state, locked, Data};
        │ │ │ +open(enter, _OldState, _Data) ->
        │ │ │ +    do_unlock(),
        │ │ │ +    {keep_state_and_data,
        │ │ │ +     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ +open(state_timeout, lock, Data) ->
        │ │ │ +    {next_state, locked, Data};
        │ │ │  ...

        You can repeat the state enter code by returning one of │ │ │ {repeat_state, ...},{repeat_state_and_data, _}, │ │ │ or repeat_state_and_data that otherwise behaves exactly like their │ │ │ keep_state siblings. See the type │ │ │ state_callback_result() │ │ │ in the Reference Manual.

        │ │ │ │ │ │ @@ -1066,44 +1066,44 @@ │ │ │ to dispatch pre-processed events as internal events to the main state │ │ │ machine.

        Using internal events also can make it easier to synchronize the state │ │ │ machines.

        A variant of this is to use a complex state with │ │ │ one state callback, modeling the state │ │ │ with, for example, a tuple {MainFSMState, SubFSMState}.

        To illustrate this we make up an example where the buttons instead generate │ │ │ down and up (press and release) events, and the lock responds │ │ │ to an up event only after the corresponding down event.

        ...
        │ │ │ --export([down/1, up/1]).
        │ │ │ +-export([down/1, up/1]).
        │ │ │  ...
        │ │ │ -down(Button) ->
        │ │ │ -    gen_statem:cast(?NAME, {down,Button}).
        │ │ │ +down(Button) ->
        │ │ │ +    gen_statem:cast(?NAME, {down,Button}).
        │ │ │  
        │ │ │ -up(Button) ->
        │ │ │ -    gen_statem:cast(?NAME, {up,Button}).
        │ │ │ +up(Button) ->
        │ │ │ +    gen_statem:cast(?NAME, {up,Button}).
        │ │ │  
        │ │ │  ...
        │ │ │  
        │ │ │ -locked(enter, _OldState, Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {keep_state,Data#{buttons => []}};
        │ │ │ -locked(
        │ │ │ -  internal, {button,Button},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ -...
        handle_common(cast, {down,Button}, Data) ->
        │ │ │ -    {keep_state, Data#{button => Button}};
        │ │ │ -handle_common(cast, {up,Button}, Data) ->
        │ │ │ +locked(enter, _OldState, Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {keep_state,Data#{buttons => []}};
        │ │ │ +locked(
        │ │ │ +  internal, {button,Button},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +...
        handle_common(cast, {down,Button}, Data) ->
        │ │ │ +    {keep_state, Data#{button => Button}};
        │ │ │ +handle_common(cast, {up,Button}, Data) ->
        │ │ │      case Data of
        │ │ │ -        #{button := Button} ->
        │ │ │ -            {keep_state,maps:remove(button, Data),
        │ │ │ -             [{next_event,internal,{button,Button}}]};
        │ │ │ -        #{} ->
        │ │ │ +        #{button := Button} ->
        │ │ │ +            {keep_state,maps:remove(button, Data),
        │ │ │ +             [{next_event,internal,{button,Button}}]};
        │ │ │ +        #{} ->
        │ │ │              keep_state_and_data
        │ │ │      end;
        │ │ │  ...
        │ │ │  
        │ │ │ -open(internal, {button,_}, Data) ->
        │ │ │ -    {keep_state,Data,[postpone]};
        │ │ │ +open(internal, {button,_}, Data) ->
        │ │ │ +    {keep_state,Data,[postpone]};
        │ │ │  ...

        If you start this program with code_lock:start([17]) you can unlock with │ │ │ code_lock:down(17), code_lock:up(17).

        │ │ │ │ │ │ │ │ │ │ │ │ Example Revisited │ │ │

        │ │ │ @@ -1131,152 +1131,152 @@ │ │ │ Also, the state diagram does not show that the code_length/0 call │ │ │ must be handled in every state.

        │ │ │ │ │ │ │ │ │ │ │ │ Callback Mode: state_functions │ │ │

        │ │ │ -

        Using state functions:

        -module(code_lock).
        │ │ │ --behaviour(gen_statem).
        │ │ │ --define(NAME, code_lock_2).
        │ │ │ +

        Using state functions:

        -module(code_lock).
        │ │ │ +-behaviour(gen_statem).
        │ │ │ +-define(NAME, code_lock_2).
        │ │ │  
        │ │ │ --export([start_link/1,stop/0]).
        │ │ │ --export([down/1,up/1,code_length/0]).
        │ │ │ --export([init/1,callback_mode/0,terminate/3]).
        │ │ │ --export([locked/3,open/3]).
        │ │ │ -
        │ │ │ -start_link(Code) ->
        │ │ │ -    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
        │ │ │ -stop() ->
        │ │ │ -    gen_statem:stop(?NAME).
        │ │ │ -
        │ │ │ -down(Button) ->
        │ │ │ -    gen_statem:cast(?NAME, {down,Button}).
        │ │ │ -up(Button) ->
        │ │ │ -    gen_statem:cast(?NAME, {up,Button}).
        │ │ │ -code_length() ->
        │ │ │ -    gen_statem:call(?NAME, code_length).
        init(Code) ->
        │ │ │ -    process_flag(trap_exit, true),
        │ │ │ -    Data = #{code => Code, length => length(Code), buttons => []},
        │ │ │ -    {ok, locked, Data}.
        │ │ │ +-export([start_link/1,stop/0]).
        │ │ │ +-export([down/1,up/1,code_length/0]).
        │ │ │ +-export([init/1,callback_mode/0,terminate/3]).
        │ │ │ +-export([locked/3,open/3]).
        │ │ │ +
        │ │ │ +start_link(Code) ->
        │ │ │ +    gen_statem:start_link({local,?NAME}, ?MODULE, Code, []).
        │ │ │ +stop() ->
        │ │ │ +    gen_statem:stop(?NAME).
        │ │ │ +
        │ │ │ +down(Button) ->
        │ │ │ +    gen_statem:cast(?NAME, {down,Button}).
        │ │ │ +up(Button) ->
        │ │ │ +    gen_statem:cast(?NAME, {up,Button}).
        │ │ │ +code_length() ->
        │ │ │ +    gen_statem:call(?NAME, code_length).
        init(Code) ->
        │ │ │ +    process_flag(trap_exit, true),
        │ │ │ +    Data = #{code => Code, length => length(Code), buttons => []},
        │ │ │ +    {ok, locked, Data}.
        │ │ │  
        │ │ │ -callback_mode() ->
        │ │ │ -    [state_functions,state_enter].
        │ │ │ +callback_mode() ->
        │ │ │ +    [state_functions,state_enter].
        │ │ │  
        │ │ │ --define(HANDLE_COMMON,
        │ │ │ -    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, D)).
        │ │ │ +-define(HANDLE_COMMON,
        │ │ │ +    ?FUNCTION_NAME(T, C, D) -> handle_common(T, C, D)).
        │ │ │  %%
        │ │ │ -handle_common(cast, {down,Button}, Data) ->
        │ │ │ -    {keep_state, Data#{button => Button}};
        │ │ │ -handle_common(cast, {up,Button}, Data) ->
        │ │ │ +handle_common(cast, {down,Button}, Data) ->
        │ │ │ +    {keep_state, Data#{button => Button}};
        │ │ │ +handle_common(cast, {up,Button}, Data) ->
        │ │ │      case Data of
        │ │ │ -        #{button := Button} ->
        │ │ │ -            {keep_state, maps:remove(button, Data),
        │ │ │ -             [{next_event,internal,{button,Button}}]};
        │ │ │ -        #{} ->
        │ │ │ +        #{button := Button} ->
        │ │ │ +            {keep_state, maps:remove(button, Data),
        │ │ │ +             [{next_event,internal,{button,Button}}]};
        │ │ │ +        #{} ->
        │ │ │              keep_state_and_data
        │ │ │      end;
        │ │ │ -handle_common({call,From}, code_length, #{code := Code}) ->
        │ │ │ -    {keep_state_and_data,
        │ │ │ -     [{reply,From,length(Code)}]}.
        locked(enter, _OldState, Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {keep_state, Data#{buttons := []}};
        │ │ │ -locked(state_timeout, button, Data) ->
        │ │ │ -    {keep_state, Data#{buttons := []}};
        │ │ │ -locked(
        │ │ │ -  internal, {button,Button},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +handle_common({call,From}, code_length, #{code := Code}) ->
        │ │ │ +    {keep_state_and_data,
        │ │ │ +     [{reply,From,length(Code)}]}.
        locked(enter, _OldState, Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {keep_state, Data#{buttons := []}};
        │ │ │ +locked(state_timeout, button, Data) ->
        │ │ │ +    {keep_state, Data#{buttons := []}};
        │ │ │ +locked(
        │ │ │ +  internal, {button,Button},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │      NewButtons =
        │ │ │          if
        │ │ │ -            length(Buttons) < Length ->
        │ │ │ +            length(Buttons) < Length ->
        │ │ │                  Buttons;
        │ │ │              true ->
        │ │ │ -                tl(Buttons)
        │ │ │ -        end ++ [Button],
        │ │ │ +                tl(Buttons)
        │ │ │ +        end ++ [Button],
        │ │ │      if
        │ │ │          NewButtons =:= Code -> % Correct
        │ │ │ -            {next_state, open, Data};
        │ │ │ +            {next_state, open, Data};
        │ │ │  	true -> % Incomplete | Incorrect
        │ │ │ -            {keep_state, Data#{buttons := NewButtons},
        │ │ │ -             [{state_timeout,30_000,button}]} % Time in milliseconds
        │ │ │ +            {keep_state, Data#{buttons := NewButtons},
        │ │ │ +             [{state_timeout,30_000,button}]} % Time in milliseconds
        │ │ │      end;
        │ │ │ -?HANDLE_COMMON.
        open(enter, _OldState, _Data) ->
        │ │ │ -    do_unlock(),
        │ │ │ -    {keep_state_and_data,
        │ │ │ -     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ -open(state_timeout, lock, Data) ->
        │ │ │ -    {next_state, locked, Data};
        │ │ │ -open(internal, {button,_}, _) ->
        │ │ │ -    {keep_state_and_data, [postpone]};
        │ │ │ +?HANDLE_COMMON.
        open(enter, _OldState, _Data) ->
        │ │ │ +    do_unlock(),
        │ │ │ +    {keep_state_and_data,
        │ │ │ +     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ +open(state_timeout, lock, Data) ->
        │ │ │ +    {next_state, locked, Data};
        │ │ │ +open(internal, {button,_}, _) ->
        │ │ │ +    {keep_state_and_data, [postpone]};
        │ │ │  ?HANDLE_COMMON.
        │ │ │  
        │ │ │ -do_lock() ->
        │ │ │ -    io:format("Locked~n", []).
        │ │ │ -do_unlock() ->
        │ │ │ -    io:format("Open~n", []).
        │ │ │ +do_lock() ->
        │ │ │ +    io:format("Locked~n", []).
        │ │ │ +do_unlock() ->
        │ │ │ +    io:format("Open~n", []).
        │ │ │  
        │ │ │ -terminate(_Reason, State, _Data) ->
        │ │ │ -    State =/= locked andalso do_lock(),
        │ │ │ +terminate(_Reason, State, _Data) ->
        │ │ │ +    State =/= locked andalso do_lock(),
        │ │ │      ok.

        │ │ │ │ │ │ │ │ │ │ │ │ Callback Mode: handle_event_function │ │ │

        │ │ │

        This section describes what to change in the example to use one │ │ │ handle_event/4 function. The previously used approach to first branch │ │ │ depending on event does not work that well here because of │ │ │ -the state enter calls, so this example first branches depending on state:

        -export([handle_event/4]).
        callback_mode() ->
        │ │ │ -    [handle_event_function,state_enter].
        %%
        │ │ │ +the state enter calls, so this example first branches depending on state:

        -export([handle_event/4]).
        callback_mode() ->
        │ │ │ +    [handle_event_function,state_enter].
        %%
        │ │ │  %% State: locked
        │ │ │ -handle_event(enter, _OldState, locked, Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {keep_state, Data#{buttons := []}};
        │ │ │ -handle_event(state_timeout, button, locked, Data) ->
        │ │ │ -    {keep_state, Data#{buttons := []}};
        │ │ │ -handle_event(
        │ │ │ -  internal, {button,Button}, locked,
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +handle_event(enter, _OldState, locked, Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {keep_state, Data#{buttons := []}};
        │ │ │ +handle_event(state_timeout, button, locked, Data) ->
        │ │ │ +    {keep_state, Data#{buttons := []}};
        │ │ │ +handle_event(
        │ │ │ +  internal, {button,Button}, locked,
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │      NewButtons =
        │ │ │          if
        │ │ │ -            length(Buttons) < Length ->
        │ │ │ +            length(Buttons) < Length ->
        │ │ │                  Buttons;
        │ │ │              true ->
        │ │ │ -                tl(Buttons)
        │ │ │ -        end ++ [Button],
        │ │ │ +                tl(Buttons)
        │ │ │ +        end ++ [Button],
        │ │ │      if
        │ │ │          NewButtons =:= Code -> % Correct
        │ │ │ -            {next_state, open, Data};
        │ │ │ +            {next_state, open, Data};
        │ │ │  	true -> % Incomplete | Incorrect
        │ │ │ -            {keep_state, Data#{buttons := NewButtons},
        │ │ │ -             [{state_timeout,30_000,button}]} % Time in milliseconds
        │ │ │ +            {keep_state, Data#{buttons := NewButtons},
        │ │ │ +             [{state_timeout,30_000,button}]} % Time in milliseconds
        │ │ │      end;
        %%
        │ │ │  %% State: open
        │ │ │ -handle_event(enter, _OldState, open, _Data) ->
        │ │ │ -    do_unlock(),
        │ │ │ -    {keep_state_and_data,
        │ │ │ -     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ -handle_event(state_timeout, lock, open, Data) ->
        │ │ │ -    {next_state, locked, Data};
        │ │ │ -handle_event(internal, {button,_}, open, _) ->
        │ │ │ -    {keep_state_and_data,[postpone]};
        %% Common events
        │ │ │ -handle_event(cast, {down,Button}, _State, Data) ->
        │ │ │ -    {keep_state, Data#{button => Button}};
        │ │ │ -handle_event(cast, {up,Button}, _State, Data) ->
        │ │ │ +handle_event(enter, _OldState, open, _Data) ->
        │ │ │ +    do_unlock(),
        │ │ │ +    {keep_state_and_data,
        │ │ │ +     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ +handle_event(state_timeout, lock, open, Data) ->
        │ │ │ +    {next_state, locked, Data};
        │ │ │ +handle_event(internal, {button,_}, open, _) ->
        │ │ │ +    {keep_state_and_data,[postpone]};
        %% Common events
        │ │ │ +handle_event(cast, {down,Button}, _State, Data) ->
        │ │ │ +    {keep_state, Data#{button => Button}};
        │ │ │ +handle_event(cast, {up,Button}, _State, Data) ->
        │ │ │      case Data of
        │ │ │ -        #{button := Button} ->
        │ │ │ -            {keep_state, maps:remove(button, Data),
        │ │ │ -             [{next_event,internal,{button,Button}},
        │ │ │ -              {state_timeout,30_000,button}]}; % Time in milliseconds
        │ │ │ -        #{} ->
        │ │ │ +        #{button := Button} ->
        │ │ │ +            {keep_state, maps:remove(button, Data),
        │ │ │ +             [{next_event,internal,{button,Button}},
        │ │ │ +              {state_timeout,30_000,button}]}; % Time in milliseconds
        │ │ │ +        #{} ->
        │ │ │              keep_state_and_data
        │ │ │      end;
        │ │ │ -handle_event({call,From}, code_length, _State, #{length := Length}) ->
        │ │ │ -    {keep_state_and_data,
        │ │ │ -     [{reply,From,Length}]}.

        Notice that postponing buttons from the open state to the locked state │ │ │ +handle_event({call,From}, code_length, _State, #{length := Length}) -> │ │ │ + {keep_state_and_data, │ │ │ + [{reply,From,Length}]}.

        Notice that postponing buttons from the open state to the locked state │ │ │ seems like a strange thing to do for a code lock, but it at least │ │ │ illustrates event postponing.

        │ │ │ │ │ │ │ │ │ │ │ │ Filter the State │ │ │

        │ │ │ @@ -1286,30 +1286,30 @@ │ │ │ and which digits that remain to unlock.

        This state data can be regarded as sensitive, and maybe not what you want │ │ │ in the error log because of some unpredictable event.

        Another reason to filter the state can be that the state is too large to print, │ │ │ as it fills the error log with uninteresting details.

        To avoid this, you can format the internal state that gets in the error log │ │ │ and gets returned from sys:get_status/1,2 │ │ │ by implementing function │ │ │ Module:format_status/2, │ │ │ for example like this:

        ...
        │ │ │ --export([init/1,terminate/3,format_status/2]).
        │ │ │ +-export([init/1,terminate/3,format_status/2]).
        │ │ │  ...
        │ │ │  
        │ │ │ -format_status(Opt, [_PDict,State,Data]) ->
        │ │ │ +format_status(Opt, [_PDict,State,Data]) ->
        │ │ │      StateData =
        │ │ │ -	{State,
        │ │ │ -	 maps:filter(
        │ │ │ -	   fun (code, _) -> false;
        │ │ │ -	       (_, _) -> true
        │ │ │ +	{State,
        │ │ │ +	 maps:filter(
        │ │ │ +	   fun (code, _) -> false;
        │ │ │ +	       (_, _) -> true
        │ │ │  	   end,
        │ │ │ -	   Data)},
        │ │ │ +	   Data)},
        │ │ │      case Opt of
        │ │ │  	terminate ->
        │ │ │  	    StateData;
        │ │ │  	normal ->
        │ │ │ -	    [{data,[{"State",StateData}]}]
        │ │ │ +	    [{data,[{"State",StateData}]}]
        │ │ │      end.

        It is not mandatory to implement a │ │ │ Module:format_status/2 function. │ │ │ If you do not, a default implementation is used that does the same │ │ │ as this example function without filtering the Data term, that is, │ │ │ StateData = {State, Data}, in this example containing sensitive information.

        │ │ │ │ │ │ │ │ │ @@ -1322,104 +1322,104 @@ │ │ │ like a tuple.

        One reason to use this is when you have a state item that when changed │ │ │ should cancel the state time-out, or one that affects │ │ │ the event handling in combination with postponing events. We will go for │ │ │ the latter and complicate the previous example by introducing │ │ │ a configurable lock button (this is the state item in question), │ │ │ which in the open state immediately locks the door, and an API function │ │ │ set_lock_button/1 to set the lock button.

        Suppose now that we call set_lock_button while the door is open, │ │ │ -and we have already postponed a button event that was the new lock button:

        1> code_lock:start_link([a,b,c], x).
        │ │ │ -{ok,<0.666.0>}
        │ │ │ -2> code_lock:button(a).
        │ │ │ +and we have already postponed a button event that was the new lock button:

        1> code_lock:start_link([a,b,c], x).
        │ │ │ +{ok,<0.666.0>}
        │ │ │ +2> code_lock:button(a).
        │ │ │  ok
        │ │ │ -3> code_lock:button(b).
        │ │ │ +3> code_lock:button(b).
        │ │ │  ok
        │ │ │ -4> code_lock:button(c).
        │ │ │ +4> code_lock:button(c).
        │ │ │  ok
        │ │ │  Open
        │ │ │ -5> code_lock:button(y).
        │ │ │ +5> code_lock:button(y).
        │ │ │  ok
        │ │ │ -6> code_lock:set_lock_button(y).
        │ │ │ +6> code_lock:set_lock_button(y).
        │ │ │  x
        │ │ │  % What should happen here?  Immediate lock or nothing?

        We could say that the button was pressed too early so it should not be │ │ │ recognized as the lock button. Or we can make the lock button part of │ │ │ the state so when we then change the lock button in the locked state, │ │ │ the change becomes a state change and all postponed events are retried, │ │ │ therefore the lock is immediately locked!

        We define the state as {StateName, LockButton}, where StateName │ │ │ -is as before and LockButton is the current lock button:

        -module(code_lock).
        │ │ │ --behaviour(gen_statem).
        │ │ │ --define(NAME, code_lock_3).
        │ │ │ +is as before and LockButton is the current lock button:

        -module(code_lock).
        │ │ │ +-behaviour(gen_statem).
        │ │ │ +-define(NAME, code_lock_3).
        │ │ │  
        │ │ │ --export([start_link/2,stop/0]).
        │ │ │ --export([button/1,set_lock_button/1]).
        │ │ │ --export([init/1,callback_mode/0,terminate/3]).
        │ │ │ --export([handle_event/4]).
        │ │ │ -
        │ │ │ -start_link(Code, LockButton) ->
        │ │ │ -    gen_statem:start_link(
        │ │ │ -        {local,?NAME}, ?MODULE, {Code,LockButton}, []).
        │ │ │ -stop() ->
        │ │ │ -    gen_statem:stop(?NAME).
        │ │ │ -
        │ │ │ -button(Button) ->
        │ │ │ -    gen_statem:cast(?NAME, {button,Button}).
        │ │ │ -set_lock_button(LockButton) ->
        │ │ │ -    gen_statem:call(?NAME, {set_lock_button,LockButton}).
        init({Code,LockButton}) ->
        │ │ │ -    process_flag(trap_exit, true),
        │ │ │ -    Data = #{code => Code, length => length(Code), buttons => []},
        │ │ │ -    {ok, {locked,LockButton}, Data}.
        │ │ │ +-export([start_link/2,stop/0]).
        │ │ │ +-export([button/1,set_lock_button/1]).
        │ │ │ +-export([init/1,callback_mode/0,terminate/3]).
        │ │ │ +-export([handle_event/4]).
        │ │ │ +
        │ │ │ +start_link(Code, LockButton) ->
        │ │ │ +    gen_statem:start_link(
        │ │ │ +        {local,?NAME}, ?MODULE, {Code,LockButton}, []).
        │ │ │ +stop() ->
        │ │ │ +    gen_statem:stop(?NAME).
        │ │ │ +
        │ │ │ +button(Button) ->
        │ │ │ +    gen_statem:cast(?NAME, {button,Button}).
        │ │ │ +set_lock_button(LockButton) ->
        │ │ │ +    gen_statem:call(?NAME, {set_lock_button,LockButton}).
        init({Code,LockButton}) ->
        │ │ │ +    process_flag(trap_exit, true),
        │ │ │ +    Data = #{code => Code, length => length(Code), buttons => []},
        │ │ │ +    {ok, {locked,LockButton}, Data}.
        │ │ │  
        │ │ │ -callback_mode() ->
        │ │ │ -    [handle_event_function,state_enter].
        │ │ │ +callback_mode() ->
        │ │ │ +    [handle_event_function,state_enter].
        │ │ │  
        │ │ │  %% State: locked
        │ │ │ -handle_event(enter, _OldState, {locked,_}, Data) ->
        │ │ │ -    do_lock(),
        │ │ │ -    {keep_state, Data#{buttons := []}};
        │ │ │ -handle_event(state_timeout, button, {locked,_}, Data) ->
        │ │ │ -    {keep_state, Data#{buttons := []}};
        │ │ │ -handle_event(
        │ │ │ -  cast, {button,Button}, {locked,LockButton},
        │ │ │ -  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │ +handle_event(enter, _OldState, {locked,_}, Data) ->
        │ │ │ +    do_lock(),
        │ │ │ +    {keep_state, Data#{buttons := []}};
        │ │ │ +handle_event(state_timeout, button, {locked,_}, Data) ->
        │ │ │ +    {keep_state, Data#{buttons := []}};
        │ │ │ +handle_event(
        │ │ │ +  cast, {button,Button}, {locked,LockButton},
        │ │ │ +  #{code := Code, length := Length, buttons := Buttons} = Data) ->
        │ │ │      NewButtons =
        │ │ │          if
        │ │ │ -            length(Buttons) < Length ->
        │ │ │ +            length(Buttons) < Length ->
        │ │ │                  Buttons;
        │ │ │              true ->
        │ │ │ -                tl(Buttons)
        │ │ │ -        end ++ [Button],
        │ │ │ +                tl(Buttons)
        │ │ │ +        end ++ [Button],
        │ │ │      if
        │ │ │          NewButtons =:= Code -> % Correct
        │ │ │ -            {next_state, {open,LockButton}, Data};
        │ │ │ +            {next_state, {open,LockButton}, Data};
        │ │ │  	true -> % Incomplete | Incorrect
        │ │ │ -            {keep_state, Data#{buttons := NewButtons},
        │ │ │ -             [{state_timeout,30_000,button}]} % Time in milliseconds
        │ │ │ +            {keep_state, Data#{buttons := NewButtons},
        │ │ │ +             [{state_timeout,30_000,button}]} % Time in milliseconds
        │ │ │      end;
        %%
        │ │ │  %% State: open
        │ │ │ -handle_event(enter, _OldState, {open,_}, _Data) ->
        │ │ │ -    do_unlock(),
        │ │ │ -    {keep_state_and_data,
        │ │ │ -     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ -handle_event(state_timeout, lock, {open,LockButton}, Data) ->
        │ │ │ -    {next_state, {locked,LockButton}, Data};
        │ │ │ -handle_event(cast, {button,LockButton}, {open,LockButton}, Data) ->
        │ │ │ -    {next_state, {locked,LockButton}, Data};
        │ │ │ -handle_event(cast, {button,_}, {open,_}, _Data) ->
        │ │ │ -    {keep_state_and_data,[postpone]};
        %%
        │ │ │ +handle_event(enter, _OldState, {open,_}, _Data) ->
        │ │ │ +    do_unlock(),
        │ │ │ +    {keep_state_and_data,
        │ │ │ +     [{state_timeout,10_000,lock}]}; % Time in milliseconds
        │ │ │ +handle_event(state_timeout, lock, {open,LockButton}, Data) ->
        │ │ │ +    {next_state, {locked,LockButton}, Data};
        │ │ │ +handle_event(cast, {button,LockButton}, {open,LockButton}, Data) ->
        │ │ │ +    {next_state, {locked,LockButton}, Data};
        │ │ │ +handle_event(cast, {button,_}, {open,_}, _Data) ->
        │ │ │ +    {keep_state_and_data,[postpone]};
        %%
        │ │ │  %% Common events
        │ │ │ -handle_event(
        │ │ │ -  {call,From}, {set_lock_button,NewLockButton},
        │ │ │ -  {StateName,OldLockButton}, Data) ->
        │ │ │ -    {next_state, {StateName,NewLockButton}, Data,
        │ │ │ -     [{reply,From,OldLockButton}]}.
        do_lock() ->
        │ │ │ -    io:format("Locked~n", []).
        │ │ │ -do_unlock() ->
        │ │ │ -    io:format("Open~n", []).
        │ │ │ +handle_event(
        │ │ │ +  {call,From}, {set_lock_button,NewLockButton},
        │ │ │ +  {StateName,OldLockButton}, Data) ->
        │ │ │ +    {next_state, {StateName,NewLockButton}, Data,
        │ │ │ +     [{reply,From,OldLockButton}]}.
        do_lock() ->
        │ │ │ +    io:format("Locked~n", []).
        │ │ │ +do_unlock() ->
        │ │ │ +    io:format("Open~n", []).
        │ │ │  
        │ │ │ -terminate(_Reason, State, _Data) ->
        │ │ │ -    State =/= locked andalso do_lock(),
        │ │ │ +terminate(_Reason, State, _Data) ->
        │ │ │ +    State =/= locked andalso do_lock(),
        │ │ │      ok.

        │ │ │ │ │ │ │ │ │ │ │ │ Hibernation │ │ │

        │ │ │

        If you have many servers in one node and they have some state(s) in their │ │ │ @@ -1428,19 +1428,19 @@ │ │ │ footprint of a server can be minimized by hibernating it through │ │ │ proc_lib:hibernate/3.

        Note

        It is rather costly to hibernate a process; see erlang:hibernate/3. It is │ │ │ not something you want to do after every event.

        We can in this example hibernate in the {open, _} state, │ │ │ because what normally occurs in that state is that the state time-out │ │ │ after a while triggers a transition to {locked, _}:

        ...
        │ │ │  %%
        │ │ │  %% State: open
        │ │ │ -handle_event(enter, _OldState, {open,_}, _Data) ->
        │ │ │ -    do_unlock(),
        │ │ │ -    {keep_state_and_data,
        │ │ │ -     [{state_timeout,10_000,lock}, % Time in milliseconds
        │ │ │ -      hibernate]};
        │ │ │ +handle_event(enter, _OldState, {open,_}, _Data) ->
        │ │ │ +    do_unlock(),
        │ │ │ +    {keep_state_and_data,
        │ │ │ +     [{state_timeout,10_000,lock}, % Time in milliseconds
        │ │ │ +      hibernate]};
        │ │ │  ...

        The atom hibernate in the action list on the │ │ │ last line when entering the {open, _} state is the only change. If any event │ │ │ arrives in the {open, _}, state, we do not bother to rehibernate, │ │ │ so the server stays awake after any event.

        To change that we would need to insert action hibernate in more places. │ │ │ For example, the state-independent set_lock_button operation │ │ │ would have to use hibernate but only in the {open, _} state, │ │ │ which would clutter the code.

        Another not uncommon scenario is to use the │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/sup_princ.html │ │ │ @@ -128,48 +128,48 @@ │ │ │ the order specified by this list, and are terminated in the reverse order.

        │ │ │ │ │ │ │ │ │ │ │ │ Example │ │ │

        │ │ │

        The callback module for a supervisor starting the server from │ │ │ -gen_server Behaviour can look as follows:

        -module(ch_sup).
        │ │ │ --behaviour(supervisor).
        │ │ │ +gen_server Behaviour can look as follows:

        -module(ch_sup).
        │ │ │ +-behaviour(supervisor).
        │ │ │  
        │ │ │ --export([start_link/0]).
        │ │ │ --export([init/1]).
        │ │ │ +-export([start_link/0]).
        │ │ │ +-export([init/1]).
        │ │ │  
        │ │ │ -start_link() ->
        │ │ │ -    supervisor:start_link(ch_sup, []).
        │ │ │ +start_link() ->
        │ │ │ +    supervisor:start_link(ch_sup, []).
        │ │ │  
        │ │ │ -init(_Args) ->
        │ │ │ -    SupFlags = #{strategy => one_for_one, intensity => 1, period => 5},
        │ │ │ -    ChildSpecs = [#{id => ch3,
        │ │ │ -                    start => {ch3, start_link, []},
        │ │ │ +init(_Args) ->
        │ │ │ +    SupFlags = #{strategy => one_for_one, intensity => 1, period => 5},
        │ │ │ +    ChildSpecs = [#{id => ch3,
        │ │ │ +                    start => {ch3, start_link, []},
        │ │ │                      restart => permanent,
        │ │ │                      shutdown => brutal_kill,
        │ │ │                      type => worker,
        │ │ │ -                    modules => [ch3]}],
        │ │ │ -    {ok, {SupFlags, ChildSpecs}}.

        The SupFlags variable in the return value from init/1 represents the │ │ │ + modules => [ch3]}], │ │ │ + {ok, {SupFlags, ChildSpecs}}.

        The SupFlags variable in the return value from init/1 represents the │ │ │ supervisor flags.

        The ChildSpecs variable in the return value from init/1 is a list of │ │ │ child specifications.

        │ │ │ │ │ │ │ │ │ │ │ │ Supervisor Flags │ │ │

        │ │ │ -

        This is the type definition for the supervisor flags:

        sup_flags() = #{strategy => strategy(),           % optional
        │ │ │ -                intensity => non_neg_integer(),   % optional
        │ │ │ -                period => pos_integer(),          % optional
        │ │ │ -                auto_shutdown => auto_shutdown()} % optional
        │ │ │ -    strategy() = one_for_all
        │ │ │ +

        This is the type definition for the supervisor flags:

        sup_flags() = #{strategy => strategy(),           % optional
        │ │ │ +                intensity => non_neg_integer(),   % optional
        │ │ │ +                period => pos_integer(),          % optional
        │ │ │ +                auto_shutdown => auto_shutdown()} % optional
        │ │ │ +    strategy() = one_for_all
        │ │ │                 | one_for_one
        │ │ │                 | rest_for_one
        │ │ │                 | simple_one_for_one
        │ │ │ -    auto_shutdown() = never
        │ │ │ +    auto_shutdown() = never
        │ │ │                      | any_significant
        │ │ │                      | all_significant

        │ │ │ │ │ │ │ │ │ │ │ │ @@ -408,28 +408,28 @@ │ │ │ exhaust the Maximum Restart Intensity of the │ │ │ parent supervisor.

        │ │ │ │ │ │ │ │ │ │ │ │ Child Specification │ │ │

        │ │ │ -

        The type definition for a child specification is as follows:

        child_spec() = #{id => child_id(),             % mandatory
        │ │ │ -                 start => mfargs(),            % mandatory
        │ │ │ -                 restart => restart(),         % optional
        │ │ │ -                 significant => significant(), % optional
        │ │ │ -                 shutdown => shutdown(),       % optional
        │ │ │ -                 type => worker(),             % optional
        │ │ │ -                 modules => modules()}         % optional
        │ │ │ -    child_id() = term()
        │ │ │ -    mfargs() = {M :: module(), F :: atom(), A :: [term()]}
        │ │ │ -    modules() = [module()] | dynamic
        │ │ │ -    restart() = permanent | transient | temporary
        │ │ │ -    significant() = boolean()
        │ │ │ -    shutdown() = brutal_kill | timeout()
        │ │ │ -    worker() = worker | supervisor
        • id is used to identify the child specification internally by the supervisor.

          The id key is mandatory.

          Note that this identifier occasionally has been called "name". As far as │ │ │ +

          The type definition for a child specification is as follows:

          child_spec() = #{id => child_id(),             % mandatory
          │ │ │ +                 start => mfargs(),            % mandatory
          │ │ │ +                 restart => restart(),         % optional
          │ │ │ +                 significant => significant(), % optional
          │ │ │ +                 shutdown => shutdown(),       % optional
          │ │ │ +                 type => worker(),             % optional
          │ │ │ +                 modules => modules()}         % optional
          │ │ │ +    child_id() = term()
          │ │ │ +    mfargs() = {M :: module(), F :: atom(), A :: [term()]}
          │ │ │ +    modules() = [module()] | dynamic
          │ │ │ +    restart() = permanent | transient | temporary
          │ │ │ +    significant() = boolean()
          │ │ │ +    shutdown() = brutal_kill | timeout()
          │ │ │ +    worker() = worker | supervisor
          • id is used to identify the child specification internally by the supervisor.

            The id key is mandatory.

            Note that this identifier occasionally has been called "name". As far as │ │ │ possible, the terms "identifier" or "id" are now used but in order to keep │ │ │ backwards compatibility, some occurrences of "name" can still be found, for │ │ │ example in error messages.

          • start defines the function call used to start the child process. It is a │ │ │ module-function-arguments tuple used as apply(M, F, A).

            It is to be (or result in) a call to any of the following:

            The start key is mandatory.

          • restart defines when a terminated child process is to be │ │ │ restarted.

            • A permanent child process is always restarted.
            • A temporary child process is never restarted (not even when the supervisor │ │ │ restart strategy is rest_for_one or one_for_all and a sibling death │ │ │ @@ -457,53 +457,53 @@ │ │ │ supervisor, the default value infinity will be used.

            • type specifies whether the child process is a supervisor or a worker.

              The type key is optional. If it is not given, the default value worker │ │ │ will be used.

            • modules has to be a list consisting of a single element. The value │ │ │ of that element depends on the behaviour of the process:

              • If the child process is a gen_event, the element has to be the atom │ │ │ dynamic.
              • Otherwise, the element should be Module, where Module is the │ │ │ name of the callback module.

              This information is used by the release handler during upgrades and │ │ │ downgrades; see Release Handling.

              The modules key is optional. If it is not given, it defaults to [M], where │ │ │ M comes from the child's start {M,F,A}.

            Example: The child specification to start the server ch3 in the previous │ │ │ -example look as follows:

            #{id => ch3,
            │ │ │ -  start => {ch3, start_link, []},
            │ │ │ +example look as follows:

            #{id => ch3,
            │ │ │ +  start => {ch3, start_link, []},
            │ │ │    restart => permanent,
            │ │ │    shutdown => brutal_kill,
            │ │ │    type => worker,
            │ │ │ -  modules => [ch3]}

            or simplified, relying on the default values:

            #{id => ch3,
            │ │ │ +  modules => [ch3]}

            or simplified, relying on the default values:

            #{id => ch3,
            │ │ │    start => {ch3, start_link, []},
            │ │ │    shutdown => brutal_kill}

            Example: A child specification to start the event manager from the chapter about │ │ │ -gen_event:

            #{id => error_man,
            │ │ │ -  start => {gen_event, start_link, [{local, error_man}]},
            │ │ │ -  modules => dynamic}

            Both server and event manager are registered processes which can be expected to │ │ │ +gen_event:

            #{id => error_man,
            │ │ │ +  start => {gen_event, start_link, [{local, error_man}]},
            │ │ │ +  modules => dynamic}

            Both server and event manager are registered processes which can be expected to │ │ │ be always accessible. Thus they are specified to be permanent.

            ch3 does not need to do any cleaning up before termination. Thus, no shutdown │ │ │ time is needed, but brutal_kill is sufficient. error_man can need some time │ │ │ for the event handlers to clean up, thus the shutdown time is set to 5000 ms │ │ │ -(which is the default value).

            Example: A child specification to start another supervisor:

            #{id => sup,
            │ │ │ -  start => {sup, start_link, []},
            │ │ │ +(which is the default value).

            Example: A child specification to start another supervisor:

            #{id => sup,
            │ │ │ +  start => {sup, start_link, []},
            │ │ │    restart => transient,
            │ │ │ -  type => supervisor} % will cause default shutdown=>infinity

            │ │ │ + type => supervisor} % will cause default shutdown=>infinity

            │ │ │ │ │ │ │ │ │ │ │ │ Starting a Supervisor │ │ │

            │ │ │

            In the previous example, the supervisor is started by calling │ │ │ -ch_sup:start_link():

            start_link() ->
            │ │ │ -    supervisor:start_link(ch_sup, []).

            ch_sup:start_link calls function supervisor:start_link/2, which spawns and │ │ │ +ch_sup:start_link():

            start_link() ->
            │ │ │ +    supervisor:start_link(ch_sup, []).

            ch_sup:start_link calls function supervisor:start_link/2, which spawns and │ │ │ links to a new process, a supervisor.

            • The first argument, ch_sup, is the name of the callback module, that is, the │ │ │ module where the init callback function is located.
            • The second argument, [], is a term that is passed as is to the callback │ │ │ function init. Here, init does not need any data and ignores the argument.

            In this case, the supervisor is not registered. Instead its pid must be used. A │ │ │ name can be specified by calling │ │ │ supervisor:start_link({local, Name}, Module, Args) │ │ │ or │ │ │ supervisor:start_link({global, Name}, Module, Args).

            The new supervisor process calls the callback function ch_sup:init([]). init │ │ │ -has to return {ok, {SupFlags, ChildSpecs}}:

            init(_Args) ->
            │ │ │ -    SupFlags = #{},
            │ │ │ -    ChildSpecs = [#{id => ch3,
            │ │ │ -                    start => {ch3, start_link, []},
            │ │ │ -                    shutdown => brutal_kill}],
            │ │ │ -    {ok, {SupFlags, ChildSpecs}}.

            Subsequently, the supervisor starts its child processes according to the child │ │ │ +has to return {ok, {SupFlags, ChildSpecs}}:

            init(_Args) ->
            │ │ │ +    SupFlags = #{},
            │ │ │ +    ChildSpecs = [#{id => ch3,
            │ │ │ +                    start => {ch3, start_link, []},
            │ │ │ +                    shutdown => brutal_kill}],
            │ │ │ +    {ok, {SupFlags, ChildSpecs}}.

            Subsequently, the supervisor starts its child processes according to the child │ │ │ specifications in the start specification. In this case there is a single child │ │ │ process, called ch3.

            supervisor:start_link/3 is synchronous. It does not return until all child │ │ │ processes have been started.

            │ │ │ │ │ │ │ │ │ │ │ │ Adding a Child Process │ │ │ @@ -532,31 +532,31 @@ │ │ │ │ │ │ │ │ │ Simplified one_for_one Supervisors │ │ │

            │ │ │

            A supervisor with restart strategy simple_one_for_one is a simplified │ │ │ one_for_one supervisor, where all child processes are dynamically added │ │ │ instances of the same process.

            The following is an example of a callback module for a simple_one_for_one │ │ │ -supervisor:

            -module(simple_sup).
            │ │ │ --behaviour(supervisor).
            │ │ │ +supervisor:

            -module(simple_sup).
            │ │ │ +-behaviour(supervisor).
            │ │ │  
            │ │ │ --export([start_link/0]).
            │ │ │ --export([init/1]).
            │ │ │ +-export([start_link/0]).
            │ │ │ +-export([init/1]).
            │ │ │  
            │ │ │ -start_link() ->
            │ │ │ -    supervisor:start_link(simple_sup, []).
            │ │ │ +start_link() ->
            │ │ │ +    supervisor:start_link(simple_sup, []).
            │ │ │  
            │ │ │ -init(_Args) ->
            │ │ │ -    SupFlags = #{strategy => simple_one_for_one,
            │ │ │ +init(_Args) ->
            │ │ │ +    SupFlags = #{strategy => simple_one_for_one,
            │ │ │                   intensity => 0,
            │ │ │ -                 period => 1},
            │ │ │ -    ChildSpecs = [#{id => call,
            │ │ │ -                    start => {call, start_link, []},
            │ │ │ -                    shutdown => brutal_kill}],
            │ │ │ -    {ok, {SupFlags, ChildSpecs}}.

            When started, the supervisor does not start any child │ │ │ + period => 1}, │ │ │ + ChildSpecs = [#{id => call, │ │ │ + start => {call, start_link, []}, │ │ │ + shutdown => brutal_kill}], │ │ │ + {ok, {SupFlags, ChildSpecs}}.

            When started, the supervisor does not start any child │ │ │ processes. Instead, all child processes need to be added dynamically by │ │ │ calling supervisor:start_child(Sup, List).

            Sup is the pid, or name, of the supervisor. List is an arbitrary list of │ │ │ terms, which are added to the list of arguments specified in the child │ │ │ specification. If the start function is specified as {M, F, A}, the child │ │ │ process is started by calling apply(M, F, A++List).

            For example, adding a child to simple_sup above:

            supervisor:start_child(Pid, [id1])

            The result is that the child process is started by calling │ │ │ apply(call, start_link, []++[id1]), or actually:

            call:start_link(id1)

            A child under a simple_one_for_one supervisor can be terminated with the │ │ │ following:

            supervisor:terminate_child(Sup, Pid)

            Sup is the pid, or name, of the supervisor and Pid is the pid of the child.

            Because a simple_one_for_one supervisor can have many children, it shuts them │ │ ├── ./usr/share/doc/erlang-doc/html/doc/system/tablesdatabases.html │ │ │ @@ -146,73 +146,73 @@ │ │ │ │ │ │ │ │ │ Deleting an Element │ │ │

        │ │ │

        The delete operation is considered successful if the element was not present │ │ │ in the table. Hence all attempts to check that the element is present in the │ │ │ Ets/Mnesia table before deletion are unnecessary. Here follows an example for │ │ │ -Ets tables:

        DO

        ets:delete(Tab, Key),

        DO NOT

        case ets:lookup(Tab, Key) of
        │ │ │ -    [] ->
        │ │ │ +Ets tables:

        DO

        ets:delete(Tab, Key),

        DO NOT

        case ets:lookup(Tab, Key) of
        │ │ │ +    [] ->
        │ │ │          ok;
        │ │ │ -    [_|_] ->
        │ │ │ -        ets:delete(Tab, Key)
        │ │ │ +    [_|_] ->
        │ │ │ +        ets:delete(Tab, Key)
        │ │ │  end,

        │ │ │ │ │ │ │ │ │ │ │ │ Fetching Data │ │ │

        │ │ │

        Do not fetch data that you already have.

        Consider that you have a module that handles the abstract data type Person. │ │ │ You export the interface function print_person/1, which uses the internal │ │ │ functions print_name/1, print_age/1, and print_occupation/1.

        Note

        If the function print_name/1, and so on, had been interface functions, the │ │ │ situation would have been different, as you do not want the user of the │ │ │ interface to know about the internal data representation.

        DO

        %%% Interface function
        │ │ │ -print_person(PersonId) ->
        │ │ │ +print_person(PersonId) ->
        │ │ │      %% Look up the person in the named table person,
        │ │ │ -    case ets:lookup(person, PersonId) of
        │ │ │ -        [Person] ->
        │ │ │ -            print_name(Person),
        │ │ │ -            print_age(Person),
        │ │ │ -            print_occupation(Person);
        │ │ │ -        [] ->
        │ │ │ -            io:format("No person with ID = ~p~n", [PersonID])
        │ │ │ +    case ets:lookup(person, PersonId) of
        │ │ │ +        [Person] ->
        │ │ │ +            print_name(Person),
        │ │ │ +            print_age(Person),
        │ │ │ +            print_occupation(Person);
        │ │ │ +        [] ->
        │ │ │ +            io:format("No person with ID = ~p~n", [PersonID])
        │ │ │      end.
        │ │ │  
        │ │ │  %%% Internal functions
        │ │ │ -print_name(Person) ->
        │ │ │ -    io:format("No person ~p~n", [Person#person.name]).
        │ │ │ +print_name(Person) ->
        │ │ │ +    io:format("No person ~p~n", [Person#person.name]).
        │ │ │  
        │ │ │ -print_age(Person) ->
        │ │ │ -    io:format("No person ~p~n", [Person#person.age]).
        │ │ │ +print_age(Person) ->
        │ │ │ +    io:format("No person ~p~n", [Person#person.age]).
        │ │ │  
        │ │ │ -print_occupation(Person) ->
        │ │ │ -    io:format("No person ~p~n", [Person#person.occupation]).

        DO NOT

        %%% Interface function
        │ │ │ -print_person(PersonId) ->
        │ │ │ +print_occupation(Person) ->
        │ │ │ +    io:format("No person ~p~n", [Person#person.occupation]).

        DO NOT

        %%% Interface function
        │ │ │ +print_person(PersonId) ->
        │ │ │      %% Look up the person in the named table person,
        │ │ │ -    case ets:lookup(person, PersonId) of
        │ │ │ -        [Person] ->
        │ │ │ -            print_name(PersonID),
        │ │ │ -            print_age(PersonID),
        │ │ │ -            print_occupation(PersonID);
        │ │ │ -        [] ->
        │ │ │ -            io:format("No person with ID = ~p~n", [PersonID])
        │ │ │ +    case ets:lookup(person, PersonId) of
        │ │ │ +        [Person] ->
        │ │ │ +            print_name(PersonID),
        │ │ │ +            print_age(PersonID),
        │ │ │ +            print_occupation(PersonID);
        │ │ │ +        [] ->
        │ │ │ +            io:format("No person with ID = ~p~n", [PersonID])
        │ │ │      end.
        │ │ │  
        │ │ │  %%% Internal functions
        │ │ │ -print_name(PersonID) ->
        │ │ │ -    [Person] = ets:lookup(person, PersonId),
        │ │ │ -    io:format("No person ~p~n", [Person#person.name]).
        │ │ │ -
        │ │ │ -print_age(PersonID) ->
        │ │ │ -    [Person] = ets:lookup(person, PersonId),
        │ │ │ -    io:format("No person ~p~n", [Person#person.age]).
        │ │ │ -
        │ │ │ -print_occupation(PersonID) ->
        │ │ │ -    [Person] = ets:lookup(person, PersonId),
        │ │ │ -    io:format("No person ~p~n", [Person#person.occupation]).

        │ │ │ +print_name(PersonID) -> │ │ │ + [Person] = ets:lookup(person, PersonId), │ │ │ + io:format("No person ~p~n", [Person#person.name]). │ │ │ + │ │ │ +print_age(PersonID) -> │ │ │ + [Person] = ets:lookup(person, PersonId), │ │ │ + io:format("No person ~p~n", [Person#person.age]). │ │ │ + │ │ │ +print_occupation(PersonID) -> │ │ │ + [Person] = ets:lookup(person, PersonId), │ │ │ + io:format("No person ~p~n", [Person#person.occupation]).

        │ │ │ │ │ │ │ │ │ │ │ │ Non-Persistent Database Storage │ │ │

        │ │ │

        For non-persistent database storage, prefer Ets tables over Mnesia │ │ │ local_content tables. Even the Mnesia dirty_write operations carry a fixed │ │ │ @@ -226,38 +226,38 @@ │ │ │ │ │ │

        Assuming an Ets table that uses idno as key and contains the following:

        [#person{idno = 1, name = "Adam",  age = 31, occupation = "mailman"},
        │ │ │   #person{idno = 2, name = "Bryan", age = 31, occupation = "cashier"},
        │ │ │   #person{idno = 3, name = "Bryan", age = 35, occupation = "banker"},
        │ │ │   #person{idno = 4, name = "Carl",  age = 25, occupation = "mailman"}]

        If you must return all data stored in the Ets table, you can use │ │ │ ets:tab2list/1. However, usually you are only interested in a subset of the │ │ │ information in which case ets:tab2list/1 is expensive. If you only want to │ │ │ -extract one field from each record, for example, the age of every person, then:

        DO

        ets:select(Tab, [{#person{idno='_',
        │ │ │ +extract one field from each record, for example, the age of every person, then:

        DO

        ets:select(Tab, [{#person{idno='_',
        │ │ │                            name='_',
        │ │ │                            age='$1',
        │ │ │ -                          occupation = '_'},
        │ │ │ -                [],
        │ │ │ -                ['$1']}]),

        DO NOT

        TabList = ets:tab2list(Tab),
        │ │ │ -lists:map(fun(X) -> X#person.age end, TabList),

        If you are only interested in the age of all persons named "Bryan", then:

        DO

        ets:select(Tab, [{#person{idno='_',
        │ │ │ +                          occupation = '_'},
        │ │ │ +                [],
        │ │ │ +                ['$1']}]),

        DO NOT

        TabList = ets:tab2list(Tab),
        │ │ │ +lists:map(fun(X) -> X#person.age end, TabList),

        If you are only interested in the age of all persons named "Bryan", then:

        DO

        ets:select(Tab, [{#person{idno='_',
        │ │ │                            name="Bryan",
        │ │ │                            age='$1',
        │ │ │ -                          occupation = '_'},
        │ │ │ -                [],
        │ │ │ -                ['$1']}])

        DO NOT

        TabList = ets:tab2list(Tab),
        │ │ │ -lists:foldl(fun(X, Acc) -> case X#person.name of
        │ │ │ +                          occupation = '_'},
        │ │ │ +                [],
        │ │ │ +                ['$1']}])

        DO NOT

        TabList = ets:tab2list(Tab),
        │ │ │ +lists:foldl(fun(X, Acc) -> case X#person.name of
        │ │ │                                  "Bryan" ->
        │ │ │ -                                    [X#person.age|Acc];
        │ │ │ +                                    [X#person.age|Acc];
        │ │ │                                   _ ->
        │ │ │                                       Acc
        │ │ │                             end
        │ │ │ -             end, [], TabList)

        If you need all information stored in the Ets table about persons named "Bryan", │ │ │ -then:

        DO

        ets:select(Tab, [{#person{idno='_',
        │ │ │ +             end, [], TabList)

        If you need all information stored in the Ets table about persons named "Bryan", │ │ │ +then:

        DO

        ets:select(Tab, [{#person{idno='_',
        │ │ │                            name="Bryan",
        │ │ │                            age='_',
        │ │ │ -                          occupation = '_'}, [], ['$_']}]),

        DO NOT

        TabList = ets:tab2list(Tab),
        │ │ │ -lists:filter(fun(X) -> X#person.name == "Bryan" end, TabList),

        │ │ │ + occupation = '_'}, [], ['$_']}]),

        DO NOT

        TabList = ets:tab2list(Tab),
        │ │ │ +lists:filter(fun(X) -> X#person.name == "Bryan" end, TabList),

        │ │ │ │ │ │ │ │ │ │ │ │ ordered_set Tables │ │ │

        │ │ │

        If the data in the table is to be accessed so that the order of the keys in the │ │ │ table is significant, the table type ordered_set can be used instead of the │ │ │ @@ -293,20 +293,20 @@ │ │ │ Clearly, the second table would have to be kept consistent with the master │ │ │ table. Mnesia can do this for you, but a home-brew index table can be very │ │ │ efficient compared to the overhead involved in using Mnesia.

        An index table for the table in the previous examples would have to be a bag (as │ │ │ keys would appear more than once) and can have the following contents:

        [#index_entry{name="Adam", idno=1},
        │ │ │   #index_entry{name="Bryan", idno=2},
        │ │ │   #index_entry{name="Bryan", idno=3},
        │ │ │   #index_entry{name="Carl", idno=4}]

        Given this index table, a lookup of the age fields for all persons named │ │ │ -"Bryan" can be done as follows:

        MatchingIDs = ets:lookup(IndexTable,"Bryan"),
        │ │ │ -lists:map(fun(#index_entry{idno = ID}) ->
        │ │ │ -                 [#person{age = Age}] = ets:lookup(PersonTable, ID),
        │ │ │ +"Bryan" can be done as follows:

        MatchingIDs = ets:lookup(IndexTable,"Bryan"),
        │ │ │ +lists:map(fun(#index_entry{idno = ID}) ->
        │ │ │ +                 [#person{age = Age}] = ets:lookup(PersonTable, ID),
        │ │ │                   Age
        │ │ │            end,
        │ │ │ -          MatchingIDs),

        Notice that this code does not use ets:match/2, but instead uses the │ │ │ + MatchingIDs),

        Notice that this code does not use ets:match/2, but instead uses the │ │ │ ets:lookup/2 call. The lists:map/2 call is only used to traverse the idnos │ │ │ matching the name "Bryan" in the table; thus the number of lookups in the master │ │ │ table is minimized.

        Keeping an index table introduces some overhead when inserting records in the │ │ │ table. The number of operations gained from the table must therefore be compared │ │ │ against the number of operations inserting objects in the table. However, notice │ │ │ that the gain is significant when the key can be used to lookup elements.

        │ │ │ │ │ │ @@ -321,51 +321,51 @@ │ │ │ Secondary Index │ │ │

        │ │ │

        If you frequently do lookups on a field that is not the key of the table, you │ │ │ lose performance using mnesia:select() or │ │ │ mnesia:match_object() as these function traverse │ │ │ the whole table. Instead, you can create a secondary index and use │ │ │ mnesia:index_read/3 to get faster access at the expense of using more │ │ │ -memory.

        Example:

        -record(person, {idno, name, age, occupation}).
        │ │ │ +memory.

        Example:

        -record(person, {idno, name, age, occupation}).
        │ │ │          ...
        │ │ │ -{atomic, ok} =
        │ │ │ -mnesia:create_table(person, [{index,[#person.age]},
        │ │ │ -                              {attributes,
        │ │ │ -                                    record_info(fields, person)}]),
        │ │ │ -{atomic, ok} = mnesia:add_table_index(person, age),
        │ │ │ +{atomic, ok} =
        │ │ │ +mnesia:create_table(person, [{index,[#person.age]},
        │ │ │ +                              {attributes,
        │ │ │ +                                    record_info(fields, person)}]),
        │ │ │ +{atomic, ok} = mnesia:add_table_index(person, age),
        │ │ │  ...
        │ │ │  
        │ │ │  PersonsAge42 =
        │ │ │ -     mnesia:dirty_index_read(person, 42, #person.age),

        │ │ │ + mnesia:dirty_index_read(person, 42, #person.age),

        │ │ │ │ │ │ │ │ │ │ │ │ Transactions │ │ │

        │ │ │

        Using transactions is a way to guarantee that the distributed Mnesia database │ │ │ remains consistent, even when many different processes update it in parallel. │ │ │ However, if you have real-time requirements it is recommended to use dirtry │ │ │ operations instead of transactions. When using dirty operations, you lose the │ │ │ consistency guarantee; this is usually solved by only letting one process update │ │ │ the table. Other processes must send update requests to that process.

        Example:

        ...
        │ │ │  %% Using transaction
        │ │ │  
        │ │ │ -Fun = fun() ->
        │ │ │ -          [mnesia:read({Table, Key}),
        │ │ │ -           mnesia:read({Table2, Key2})]
        │ │ │ +Fun = fun() ->
        │ │ │ +          [mnesia:read({Table, Key}),
        │ │ │ +           mnesia:read({Table2, Key2})]
        │ │ │        end,
        │ │ │  
        │ │ │ -{atomic, [Result1, Result2]}  = mnesia:transaction(Fun),
        │ │ │ +{atomic, [Result1, Result2]}  = mnesia:transaction(Fun),
        │ │ │  ...
        │ │ │  
        │ │ │  %% Same thing using dirty operations
        │ │ │  ...
        │ │ │  
        │ │ │ -Result1 = mnesia:dirty_read({Table, Key}),
        │ │ │ -Result2 = mnesia:dirty_read({Table2, Key2}),
        │ │ │ +
        Result1 = mnesia:dirty_read({Table, Key}), │ │ │ +Result2 = mnesia:dirty_read({Table2, Key2}),
        │ │ │ │ │ │ │ │ │
        │ │ │
        │ │ │ │ │ │

        map/0 type.

        For convenience, the following types are also built-in. They can be thought as │ │ │ predefined aliases for the type unions also shown in the table.

        Built-in typeDefined as
        term/0any/0
        binary/0<<_:_*8>>
        nonempty_binary/0<<_:8, _:_*8>>
        bitstring/0<<_:_*1>>
        nonempty_bitstring/0<<_:1, _:_*1>>
        boolean/0'false' | 'true'
        byte/00..255
        char/00..16#10ffff
        nil/0[]
        number/0integer/0 | float/0
        list/0[any()]
        maybe_improper_list/0maybe_improper_list(any(), any())
        nonempty_list/0nonempty_list(any())
        string/0[char()]
        nonempty_string/0[char(),...]
        iodata/0iolist() | binary()
        iolist/0maybe_improper_list(byte() | binary() | iolist(), binary() | [])
        map/0#{any() => any()}
        function/0fun()
        module/0atom/0
        mfa/0{module(),atom(),arity()}
        arity/00..255
        identifier/0pid() | port() | reference()
        node/0atom/0
        timeout/0'infinity' | non_neg_integer()
        no_return/0none/0

        Table: Built-in types, predefined aliases

        In addition, the following three built-in types exist and can be thought as │ │ │ defined below, though strictly their "type definition" is not valid syntax │ │ │ according to the type language defined above.

        Built-in typeCan be thought defined by the syntax
        non_neg_integer/00..
        pos_integer/01..
        neg_integer/0..-1

        Table: Additional built-in types

        Note

        The following built-in list types also exist, but they are expected to be │ │ │ -rarely used. Hence, they have long names:

        nonempty_maybe_improper_list() :: nonempty_maybe_improper_list(any(), any())
        │ │ │ -nonempty_improper_list(Type1, Type2)
        │ │ │ -nonempty_maybe_improper_list(Type1, Type2)

        where the last two types define the set of Erlang terms one would expect.

        Also for convenience, record notation is allowed to be used. Records are │ │ │ -shorthands for the corresponding tuples:

        Record :: #Erlang_Atom{}
        │ │ │ -        | #Erlang_Atom{Fields}

        Records are extended to possibly contain type information. This is described in │ │ │ +rarely used. Hence, they have long names:

        nonempty_maybe_improper_list() :: nonempty_maybe_improper_list(any(), any())
        │ │ │ +nonempty_improper_list(Type1, Type2)
        │ │ │ +nonempty_maybe_improper_list(Type1, Type2)

        where the last two types define the set of Erlang terms one would expect.

        Also for convenience, record notation is allowed to be used. Records are │ │ │ +shorthands for the corresponding tuples:

        Record :: #Erlang_Atom{}
        │ │ │ +        | #Erlang_Atom{Fields}

        Records are extended to possibly contain type information. This is described in │ │ │ Type Information in Record Declarations.

        │ │ │ │ │ │ │ │ │ │ │ │ Redefining built-in types │ │ │

        │ │ │

        Change

        Starting from Erlang/OTP 26, it is permitted to define a type having the same │ │ │ name as a built-in type.

        It is recommended to avoid deliberately reusing built-in names because it can be │ │ │ confusing. However, when an Erlang/OTP release introduces a new type, code that │ │ │ happened to define its own type having the same name will continue to work.

        As an example, imagine that the Erlang/OTP 42 release introduces a new type │ │ │ -gadget() defined like this:

        -type gadget() :: {'gadget', reference()}.

        Further imagine that some code has its own (different) definition of gadget(), │ │ │ -for example:

        -type gadget() :: #{}.

        Since redefinitions are allowed, the code will still compile (but with a │ │ │ +gadget() defined like this:

        -type gadget() :: {'gadget', reference()}.

        Further imagine that some code has its own (different) definition of gadget(), │ │ │ +for example:

        -type gadget() :: #{}.

        Since redefinitions are allowed, the code will still compile (but with a │ │ │ warning), and Dialyzer will not emit any additional warnings.

        │ │ │ │ │ │ │ │ │ │ │ │ Type Declarations of User-Defined Types │ │ │

        │ │ │

        As seen, the basic syntax of a type is an atom followed by closed parentheses. │ │ │ New types are declared using -type and -opaque attributes as in the │ │ │ -following:

        -type my_struct_type() :: Type.
        │ │ │ --opaque my_opaq_type() :: Type.

        The type name is the atom my_struct_type, followed by parentheses. Type is a │ │ │ +following:

        -type my_struct_type() :: Type.
        │ │ │ +-opaque my_opaq_type() :: Type.

        The type name is the atom my_struct_type, followed by parentheses. Type is a │ │ │ type as defined in the previous section. A current restriction is that Type │ │ │ can contain only predefined types, or user-defined types which are either of the │ │ │ following:

        • Module-local type, that is, with a definition that is present in the code of │ │ │ the module
        • Remote type, that is, type defined in, and exported by, other modules; more │ │ │ about this soon.

        For module-local types, the restriction that their definition exists in the │ │ │ module is enforced by the compiler and results in a compilation error. (A │ │ │ similar restriction currently exists for records.)

        Type declarations can also be parameterized by including type variables between │ │ │ the parentheses. The syntax of type variables is the same as Erlang variables, │ │ │ that is, starts with an upper-case letter. These variables is to │ │ │ -appear on the RHS of the definition. A concrete example follows:

        -type orddict(Key, Val) :: [{Key, Val}].

        A module can export some types to declare that other modules are allowed to │ │ │ -refer to them as remote types. This declaration has the following form:

        -export_type([T1/A1, ..., Tk/Ak]).

        Here the Tis are atoms (the name of the type) and the Ais are their arguments.

        Example:

        -export_type([my_struct_type/0, orddict/2]).

        Assuming that these types are exported from module 'mod', you can refer to │ │ │ -them from other modules using remote type expressions like the following:

        mod:my_struct_type()
        │ │ │ -mod:orddict(atom(), term())

        It is not allowed to refer to types that are not declared as exported.

        Types declared as opaque represent sets of terms whose structure is not │ │ │ +appear on the RHS of the definition. A concrete example follows:

        -type orddict(Key, Val) :: [{Key, Val}].

        A module can export some types to declare that other modules are allowed to │ │ │ +refer to them as remote types. This declaration has the following form:

        -export_type([T1/A1, ..., Tk/Ak]).

        Here the Tis are atoms (the name of the type) and the Ais are their arguments.

        Example:

        -export_type([my_struct_type/0, orddict/2]).

        Assuming that these types are exported from module 'mod', you can refer to │ │ │ +them from other modules using remote type expressions like the following:

        mod:my_struct_type()
        │ │ │ +mod:orddict(atom(), term())

        It is not allowed to refer to types that are not declared as exported.

        Types declared as opaque represent sets of terms whose structure is not │ │ │ supposed to be visible from outside of their defining module. That is, only the │ │ │ module defining them is allowed to depend on their term structure. Consequently, │ │ │ such types do not make much sense as module local - module local types are not │ │ │ accessible by other modules anyway - and is always to be exported.

        Read more on Opaques

        │ │ │ │ │ │ │ │ │ │ │ │ Type Information in Record Declarations │ │ │

        │ │ │

        The types of record fields can be specified in the declaration of the record. │ │ │ -The syntax for this is as follows:

        -record(rec, {field1 :: Type1, field2, field3 :: Type3}).

        For fields without type annotations, their type defaults to any(). That is, the │ │ │ -previous example is a shorthand for the following:

        -record(rec, {field1 :: Type1, field2 :: any(), field3 :: Type3}).

        In the presence of initial values for fields, the type must be declared after │ │ │ -the initialization, as follows:

        -record(rec, {field1 = [] :: Type1, field2, field3 = 42 :: Type3}).

        The initial values for fields are to be compatible with (that is, a member of) │ │ │ +The syntax for this is as follows:

        -record(rec, {field1 :: Type1, field2, field3 :: Type3}).

        For fields without type annotations, their type defaults to any(). That is, the │ │ │ +previous example is a shorthand for the following:

        -record(rec, {field1 :: Type1, field2 :: any(), field3 :: Type3}).

        In the presence of initial values for fields, the type must be declared after │ │ │ +the initialization, as follows:

        -record(rec, {field1 = [] :: Type1, field2, field3 = 42 :: Type3}).

        The initial values for fields are to be compatible with (that is, a member of) │ │ │ the corresponding types. This is checked by the compiler and results in a │ │ │ compilation error if a violation is detected.

        Change

        Before Erlang/OTP 19, for fields without initial values, the singleton type │ │ │ 'undefined' was added to all declared types. In other words, the following │ │ │ -two record declarations had identical effects:

        -record(rec, {f1 = 42 :: integer(),
        │ │ │ -             f2      :: float(),
        │ │ │ -             f3      :: 'a' | 'b'}).
        │ │ │ +two record declarations had identical effects:

        -record(rec, {f1 = 42 :: integer(),
        │ │ │ +             f2      :: float(),
        │ │ │ +             f3      :: 'a' | 'b'}).
        │ │ │  
        │ │ │ --record(rec, {f1 = 42 :: integer(),
        │ │ │ -              f2      :: 'undefined' | float(),
        │ │ │ -              f3      :: 'undefined' | 'a' | 'b'}).

        This is no longer the case. If you require 'undefined' in your record field │ │ │ +-record(rec, {f1 = 42 :: integer(), │ │ │ + f2 :: 'undefined' | float(), │ │ │ + f3 :: 'undefined' | 'a' | 'b'}).

        This is no longer the case. If you require 'undefined' in your record field │ │ │ type, you must explicitly add it to the typespec, as in the 2nd example.

        Any record, containing type information or not, once defined, can be used as a │ │ │ type using the following syntax:

        #rec{}

        In addition, the record fields can be further specified when using a record type │ │ │ by adding type information about the field as follows:

        #rec{some_field :: Type}

        Any unspecified fields are assumed to have the type in the original record │ │ │ declaration.

        Note

        When records are used to create patterns for ETS and Mnesia match functions, │ │ │ -Dialyzer may need some help not to emit bad warnings. For example:

        -type height() :: pos_integer().
        │ │ │ --record(person, {name :: string(), height :: height()}).
        │ │ │ +Dialyzer may need some help not to emit bad warnings. For example:

        -type height() :: pos_integer().
        │ │ │ +-record(person, {name :: string(), height :: height()}).
        │ │ │  
        │ │ │ -lookup(Name, Tab) ->
        │ │ │ -    ets:match_object(Tab, #person{name = Name, _ = '_'}).

        Dialyzer will emit a warning since '_' is not in the type of record field │ │ │ +lookup(Name, Tab) -> │ │ │ + ets:match_object(Tab, #person{name = Name, _ = '_'}).

        Dialyzer will emit a warning since '_' is not in the type of record field │ │ │ height.

        The recommended way of dealing with this is to declare the smallest record │ │ │ field types to accommodate all your needs, and then create refinements as │ │ │ -needed. The modified example:

        -record(person, {name :: string(), height :: height() | '_'}).
        │ │ │ +needed. The modified example:

        -record(person, {name :: string(), height :: height() | '_'}).
        │ │ │  
        │ │ │ --type person() :: #person{height :: height()}.

        In specifications and type declarations the type person() is to be preferred │ │ │ +-type person() :: #person{height :: height()}.

        In specifications and type declarations the type person() is to be preferred │ │ │ before #person{}.

        │ │ │ │ │ │ │ │ │ │ │ │ Specifications for Functions │ │ │

        │ │ │

        A specification (or contract) for a function is given using the -spec │ │ │ attribute. The general format is as follows:

        -spec Function(ArgType1, ..., ArgTypeN) -> ReturnType.

        An implementation of the function with the same name Function must exist in │ │ │ the current module, and the arity of the function must match the number of │ │ │ arguments, otherwise the compilation fails.

        The following longer format with module name is also valid as long as Module │ │ │ is the name of the current module. This can be useful for documentation │ │ │ purposes.

        -spec Module:Function(ArgType1, ..., ArgTypeN) -> ReturnType.

        Also, for documentation purposes, argument names can be given:

        -spec Function(ArgName1 :: Type1, ..., ArgNameN :: TypeN) -> RT.

        A function specification can be overloaded. That is, it can have several types, │ │ │ -separated by a semicolon (;). For example:

        -spec foo(T1, T2) -> T3;
        │ │ │ -         (T4, T5) -> T6.

        A current restriction, which currently results in a warning by Dialyzer, is that │ │ │ +separated by a semicolon (;). For example:

        -spec foo(T1, T2) -> T3;
        │ │ │ +         (T4, T5) -> T6.

        A current restriction, which currently results in a warning by Dialyzer, is that │ │ │ the domains of the argument types cannot overlap. For example, the following │ │ │ -specification results in a warning:

        -spec foo(pos_integer()) -> pos_integer();
        │ │ │ -         (integer()) -> integer().

        Type variables can be used in specifications to specify relations for the input │ │ │ +specification results in a warning:

        -spec foo(pos_integer()) -> pos_integer();
        │ │ │ +         (integer()) -> integer().

        Type variables can be used in specifications to specify relations for the input │ │ │ and output arguments of a function. For example, the following specification │ │ │ defines the type of a polymorphic identity function:

        -spec id(X) -> X.

        Notice that the above specification does not restrict the input and output type │ │ │ in any way. These types can be constrained by guard-like subtype constraints and │ │ │ -provide bounded quantification:

        -spec id(X) -> X when X :: tuple().

        Currently, the :: constraint (read as "is a subtype of") is the only guard │ │ │ +provide bounded quantification:

        -spec id(X) -> X when X :: tuple().

        Currently, the :: constraint (read as "is a subtype of") is the only guard │ │ │ constraint that can be used in the when part of a -spec attribute.

        Note

        The above function specification uses multiple occurrences of the same type │ │ │ variable. That provides more type information than the following function │ │ │ -specification, where the type variables are missing:

        -spec id(tuple()) -> tuple().

        The latter specification says that the function takes some tuple and returns │ │ │ +specification, where the type variables are missing:

        -spec id(tuple()) -> tuple().

        The latter specification says that the function takes some tuple and returns │ │ │ some tuple. The specification with the X type variable specifies that the │ │ │ function takes a tuple and returns the same tuple.

        However, it is up to the tools that process the specifications to choose │ │ │ whether to take this extra information into account or not.

        The scope of a :: constraint is the (...) -> RetType specification after │ │ │ which it appears. To avoid confusion, it is suggested that different variables │ │ │ are used in different constituents of an overloaded contract, as shown in the │ │ │ -following example:

        -spec foo({X, integer()}) -> X when X :: atom();
        │ │ │ -         ([Y]) -> Y when Y :: number().

        Some functions in Erlang are not meant to return; either because they define │ │ │ +following example:

        -spec foo({X, integer()}) -> X when X :: atom();
        │ │ │ +         ([Y]) -> Y when Y :: number().

        Some functions in Erlang are not meant to return; either because they define │ │ │ servers or because they are used to throw exceptions, as in the following │ │ │ -function:

        my_error(Err) -> throw({error, Err}).

        For such functions, it is recommended to use the special no_return/0 type │ │ │ +function:

        my_error(Err) -> throw({error, Err}).

        For such functions, it is recommended to use the special no_return/0 type │ │ │ for their "return", through a contract of the following form:

        -spec my_error(term()) -> no_return().

        Note

        Erlang uses the shorthand version _ as an anonymous type variable equivalent │ │ │ to term/0 or any/0. For example, the following function

        -spec Function(string(), _) -> string().

        is equivalent to:

        -spec Function(string(), any()) -> string().
        │ │ │
        │ │ │ │ │ │
        │ │ │
        │ │ ├── ./usr/share/doc/erlang-doc/html/doc/upcoming_incompatibilities.html │ │ │ @@ -149,45 +149,45 @@ │ │ │ occurrences of maybe without quotes.

        │ │ │ │ │ │ │ │ │ │ │ │ 0.0 and -0.0 will no longer be exactly equal │ │ │

        │ │ │

        Currently, the floating point numbers 0.0 and -0.0 have distinct internal │ │ │ -representations. That can be seen if they are converted to binaries:

        1> <<0.0/float>>.
        │ │ │ -<<0,0,0,0,0,0,0,0>>
        │ │ │ -2> <<-0.0/float>>.
        │ │ │ -<<128,0,0,0,0,0,0,0>>

        However, when they are matched against each other or compared using the =:= │ │ │ +representations. That can be seen if they are converted to binaries:

        1> <<0.0/float>>.
        │ │ │ +<<0,0,0,0,0,0,0,0>>
        │ │ │ +2> <<-0.0/float>>.
        │ │ │ +<<128,0,0,0,0,0,0,0>>

        However, when they are matched against each other or compared using the =:= │ │ │ operator, they are considered to be equal. Thus, 0.0 =:= -0.0 currently │ │ │ returns true.

        In Erlang/OTP 27, 0.0 =:= -0.0 will return false, and matching 0.0 against │ │ │ -0.0 will fail. When used as map keys, 0.0 and -0.0 will be considered to │ │ │ be distinct.

        The == operator will continue to return true for 0.0 == -0.0.

        To help to find code that might need to be revised, in OTP 27 there will be a │ │ │ new compiler warning when matching against 0.0 or comparing to that value │ │ │ using the =:= operator. The warning can be suppressed by matching against │ │ │ +0.0 instead of 0.0.

        We plan to introduce the same warning in OTP 26.1, but by default it will be │ │ │ disabled.

        │ │ │ │ │ │ │ │ │ │ │ │ Singleton type variables will become a compile-time error │ │ │

        │ │ │ -

        Before Erlang/OTP 26, the compiler would silenty accept the following spec:

        -spec f(Opts) -> term() when
        │ │ │ -    Opts :: {ok, Unknown} | {error, Unknown}.
        │ │ │ -f(_) -> error.

        In OTP 26, the compiler emits a warning pointing out that the type variable │ │ │ -Unknown is unbound:

        t.erl:6:18: Warning: type variable 'Unknown' is only used once (is unbound)
        │ │ │ +

        Before Erlang/OTP 26, the compiler would silenty accept the following spec:

        -spec f(Opts) -> term() when
        │ │ │ +    Opts :: {ok, Unknown} | {error, Unknown}.
        │ │ │ +f(_) -> error.

        In OTP 26, the compiler emits a warning pointing out that the type variable │ │ │ +Unknown is unbound:

        t.erl:6:18: Warning: type variable 'Unknown' is only used once (is unbound)
        │ │ │  %    6|     Opts :: {ok, Unknown} | {error, Unknown}.
        │ │ │  %     |                  ^

        In OTP 27, that warning will become an error.

        │ │ │ │ │ │ │ │ │ │ │ │ Escripts will be compiled by default │ │ │

        │ │ │

        Escripts will be compiled by default instead of interpreted. That means that the │ │ │ compiler application must be available.

        The old behavior of interpreting escripts can be restored by adding the │ │ │ -following line to the script file:

        -mode(interpret).

        In OTP 28, support for interpreting an escript will be removed.

        │ │ │ +following line to the script file:

        -mode(interpret).

        In OTP 28, support for interpreting an escript will be removed.

        │ │ │ │ │ │ │ │ │ │ │ │ -code_path_choice will default to strict │ │ │

        │ │ │

        This command line option controls if paths given in the command line, boot │ │ │ scripts, and the code server should be interpreted as is strict or relaxed.

        OTP 26 and earlier defaults to relaxed, which means -pa myapp/ebin would │ │ │ @@ -231,18 +231,18 @@ │ │ │ " │ │ │ String Content │ │ │ " │ │ │ %% │ │ │ %% In OTP 27 it is instead interpreted as a │ │ │ %% Triple-Quoted String equivalent to │ │ │ "String Content"

        """"
        │ │ │ -++ foo() ++
        │ │ │ +++ foo() ++
        │ │ │  """"
        │ │ │  %% Became
        │ │ │ -"" ++ foo() ++ ""
        │ │ │ +"" ++ foo() ++ ""
        │ │ │  %%
        │ │ │  %% In OTP 27 it is instead interpreted as a
        │ │ │  %% Triple-Quoted String (triple-or-more) equivalent to
        │ │ │  "++ foo() ++"

        From Erlang/OTP 26.1 up to 27.0 the compiler issues a warning for a sequence of │ │ │ 3 or more double-quote characters since that is almost certainly a mistake or │ │ │ something like a result of bad automatic code generation. If a users gets that │ │ │ warning, the code should be corrected for example by inserting appropriate │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/alt_dist.html │ │ │ @@ -237,50 +237,50 @@ │ │ │ uds_dist example using a port driver written in C, erl_uds_dist is written │ │ │ entirely in Erlang.

        │ │ │ │ │ │ │ │ │ │ │ │ Exported Callback Functions │ │ │

        │ │ │ -

        The following functions are mandatory:

        • listen(Name) ->
          │ │ │ -  {ok, {Listen, Address, Creation}} | {error, Error}
          │ │ │ -listen(Name,Host) ->
          │ │ │ -  {ok, {Listen, Address, Creation}} | {error, Error}

          listen/2 is called once in order to listen for incoming connection requests. │ │ │ +

          The following functions are mandatory:

          • listen(Name) ->
            │ │ │ +  {ok, {Listen, Address, Creation}} | {error, Error}
            │ │ │ +listen(Name,Host) ->
            │ │ │ +  {ok, {Listen, Address, Creation}} | {error, Error}

            listen/2 is called once in order to listen for incoming connection requests. │ │ │ The call is made when the distribution is brought up. The argument Name is │ │ │ the part of the node name before the @ sign in the full node name. It can be │ │ │ either an atom or a string. The argument Host is the part of the node name │ │ │ after the @ sign in the full node name. It is always a string.

            The return value consists of a Listen handle (which is later passed to the │ │ │ accept/1 callback), Address which is a │ │ │ #net_address{} record with information about the address for the node (the │ │ │ #net_address{} record is defined in kernel/include/net_address.hrl), and │ │ │ Creation which (currently) is an integer 1, 2, or 3.

            If epmd is to be used for node discovery, you typically want │ │ │ to use the erl_epmd module (part of the kernel application) in order to │ │ │ -register the listen port with epmd and retrieve Creation to use.

          • address() ->
            │ │ │ +register the listen port with epmd and retrieve Creation to use.

          • address() ->
            │ │ │    Address

            address/0 is called in order to get the Address part of the │ │ │ listen/2 function without creating a listen socket. │ │ │ -All fields except address have to be set in the returned record

            Example:

            address() ->
            │ │ │ -    {ok, Host} = inet:gethostname(),
            │ │ │ -    #net_address{ host = Host, protocol = tcp, family = inet6 }.
          • accept(Listen) ->
            │ │ │ +All fields except address have to be set in the returned record

            Example:

            address() ->
            │ │ │ +    {ok, Host} = inet:gethostname(),
            │ │ │ +    #net_address{ host = Host, protocol = tcp, family = inet6 }.
          • accept(Listen) ->
            │ │ │    AcceptorPid

            accept/1 should spawn a process that accepts connections. This process │ │ │ should preferably execute on max priority. The process identifier of this │ │ │ process should be returned.

            The Listen argument will be the same as the Listen handle part of the │ │ │ return value of the listen/1 callback above. │ │ │ accept/1 is called only once when the distribution protocol is started.

            The caller of this function is a representative for net_kernel (this may or │ │ │ may not be the process registered as net_kernel) and is in this document │ │ │ identified as Kernel. When a connection has been accepted by the acceptor │ │ │ process, it needs to inform Kernel about the accepted connection. This is │ │ │ -done by passing a message on the form:

            Kernel ! {accept, AcceptorPid, DistController, Family, Proto}

            DistController is either the process or port identifier of the distribution │ │ │ +done by passing a message on the form:

            Kernel ! {accept, AcceptorPid, DistController, Family, Proto}

            DistController is either the process or port identifier of the distribution │ │ │ controller for the connection. The distribution controller should be created │ │ │ by the acceptor processes when a new connection is accepted. Its job is to │ │ │ dispatch traffic on the connection.

            Kernel responds with one of the following messages:

            • {Kernel, controller, SupervisorPid} - The request was accepted and │ │ │ SupervisorPid is the process identifier of the connection supervisor │ │ │ process (which is created in the │ │ │ accept_connection/5 callback).

            • {Kernel, unsupported_protocol} - The request was rejected. This is a │ │ │ fatal error. The acceptor process should terminate.

            When an accept sequence has been completed the acceptor process is expected to │ │ │ -continue accepting further requests.

          • accept_connection(AcceptorPid, DistCtrl, MyNode, Allowed, SetupTime) ->
            │ │ │ +continue accepting further requests.

          • accept_connection(AcceptorPid, DistCtrl, MyNode, Allowed, SetupTime) ->
            │ │ │    ConnectionSupervisorPid

            accept_connection/5 should spawn a process that will perform the Erlang │ │ │ distribution handshake for the connection. If the handshake successfully │ │ │ completes it should continue to function as a connection supervisor. This │ │ │ process should preferably execute on max priority and should be linked to │ │ │ the caller. The dist_util:net_ticker_spawn_options() function can be called │ │ │ to get spawn options suitable for this process which can be passed directly to │ │ │ erlang:spawn_opt/4. dist_util:net_ticker_spawn_options() will by default │ │ │ @@ -294,15 +294,15 @@ │ │ │ dist_util:handshake_other_started(HsData).

          • Allowed - To be passed along to │ │ │ dist_util:handshake_other_started(HsData).

          • SetupTime - Time used for creating a setup timer by a call to │ │ │ dist_util:start_timer(SetupTime). The timer should be passed along to │ │ │ dist_util:handshake_other_started(HsData).

          The created process should provide callbacks and other information needed for │ │ │ the handshake in a #hs_data{} record and call │ │ │ dist_util:handshake_other_started(HsData) with this record.

          dist_util:handshake_other_started(HsData) will perform the handshake and if │ │ │ the handshake successfully completes this process will then continue in a │ │ │ -connection supervisor loop as long as the connection is up.

        • setup(Node, Type, MyNode, LongOrShortNames, SetupTime) ->
          │ │ │ +connection supervisor loop as long as the connection is up.

        • setup(Node, Type, MyNode, LongOrShortNames, SetupTime) ->
          │ │ │    ConnectionSupervisorPid

          setup/5 should spawn a process that connects to Node. When connection has │ │ │ been established it should perform the Erlang distribution handshake for the │ │ │ connection. If the handshake successfully completes it should continue to │ │ │ function as a connection supervisor. This process should preferably execute on │ │ │ max priority and should be linked to the caller. The │ │ │ dist_util:net_ticker_spawn_options() function can be called to get spawn │ │ │ options suitable for this process which can be passed directly to │ │ │ @@ -320,23 +320,23 @@ │ │ │ may not be the process registered as net_kernel) and is in this document │ │ │ identified as Kernel.

          This function should, besides spawning the connection supervisor, also create │ │ │ a distribution controller. The distribution controller is either a process or │ │ │ a port which is responsible for dispatching traffic.

          The created process should provide callbacks and other information needed for │ │ │ the handshake in a #hs_data{} record and call │ │ │ dist_util:handshake_we_started(HsData) with this record.

          dist_util:handshake_we_started(HsData) will perform the handshake and the │ │ │ handshake successfully completes this process will then continue in a │ │ │ -connection supervisor loop as long as the connection is up.

        • close(Listen) ->
          │ │ │ -  void()

          Called in order to close the Listen handle that originally was passed from │ │ │ -the listen/1 callback.

        • select(NodeName) ->
          │ │ │ -  boolean()

          Return true if the host name part of the NodeName is valid for use with │ │ │ -this protocol; otherwise, false.

        There are also two optional functions that may be exported:

        • setopts(Listen, Opts) ->
          │ │ │ -  ok | {error, Error}

          The argument Listen is the handle originally passed from the │ │ │ +connection supervisor loop as long as the connection is up.

        • close(Listen) ->
          │ │ │ +  void()

          Called in order to close the Listen handle that originally was passed from │ │ │ +the listen/1 callback.

        • select(NodeName) ->
          │ │ │ +  boolean()

          Return true if the host name part of the NodeName is valid for use with │ │ │ +this protocol; otherwise, false.

        There are also two optional functions that may be exported:

        • setopts(Listen, Opts) ->
          │ │ │ +  ok | {error, Error}

          The argument Listen is the handle originally passed from the │ │ │ listen/1 callback. The argument Opts is a list of │ │ │ -options to set on future connections.

        • getopts(Listen, Opts) ->
          │ │ │ -  {ok, OptionValues} | {error, Error}

          The argument Listen is the handle originally passed from the │ │ │ +options to set on future connections.

        • getopts(Listen, Opts) ->
          │ │ │ +  {ok, OptionValues} | {error, Error}

          The argument Listen is the handle originally passed from the │ │ │ listen/1 callback. The argument Opts is a list of │ │ │ options to read for future connections.

        │ │ │ │ │ │ │ │ │ │ │ │ The #hs_data{} Record │ │ │

        │ │ │ @@ -350,44 +350,44 @@ │ │ │ accept_connection/5.

      • other_node - Name of the other node. This field │ │ │ is only mandatory when this node initiates the connection. That is, when │ │ │ connection is set up via setup/5.

      • this_node - The node name of this node.

      • socket - The identifier of the distribution │ │ │ controller.

      • timer - The timer created using │ │ │ dist_util:start_timer/1.

      • allowed - Information passed as Allowed to │ │ │ accept_connection/5. This field is only mandatory when the remote node │ │ │ initiated the connection. That is, when the connection is set up via │ │ │ -accept_connection/5.

      • f_send - A fun with the following signature:

        fun (DistCtrlr, Data) -> ok | {error, Error}

        where DistCtrlr is the identifier of the distribution controller and Data │ │ │ -is io data to pass to the other side.

        Only used during handshake phase.

      • f_recv - A fun with the following signature:

        fun (DistCtrlr, Length) -> {ok, Packet} | {error, Reason}

        where DistCtrlr is the identifier of the distribution controller. If │ │ │ +accept_connection/5.

      • f_send - A fun with the following signature:

        fun (DistCtrlr, Data) -> ok | {error, Error}

        where DistCtrlr is the identifier of the distribution controller and Data │ │ │ +is io data to pass to the other side.

        Only used during handshake phase.

      • f_recv - A fun with the following signature:

        fun (DistCtrlr, Length) -> {ok, Packet} | {error, Reason}

        where DistCtrlr is the identifier of the distribution controller. If │ │ │ Length is 0, all available bytes should be returned. If Length > 0, │ │ │ exactly Length bytes should be returned, or an error; possibly discarding │ │ │ less than Length bytes of data when the connection is closed from the other │ │ │ side. It is used for passive receive of data from the other end.

        Only used during handshake phase.

      • f_setopts_pre_nodeup - A fun with the │ │ │ -following signature:

        fun (DistCtrlr) -> ok | {error, Error}

        where DistCtrlr is the identifier of the distribution controller. Called │ │ │ +following signature:

        fun (DistCtrlr) -> ok | {error, Error}

        where DistCtrlr is the identifier of the distribution controller. Called │ │ │ just before the distribution channel is taken up for normal traffic.

        Only used during handshake phase.

      • f_setopts_post_nodeup - A fun with │ │ │ -the following signature:

        fun (DistCtrlr) -> ok | {error, Error}

        where DistCtrlr is the identifier of the distribution controller. Called │ │ │ -just after distribution channel has been taken up for normal traffic.

        Only used during handshake phase.

      • f_getll - A fun with the following signature:

        fun (DistCtrlr) -> ID

        where DistCtrlr is the identifier of the distribution controller and ID is │ │ │ +the following signature:

        fun (DistCtrlr) -> ok | {error, Error}

        where DistCtrlr is the identifier of the distribution controller. Called │ │ │ +just after distribution channel has been taken up for normal traffic.

        Only used during handshake phase.

      • f_getll - A fun with the following signature:

        fun (DistCtrlr) -> ID

        where DistCtrlr is the identifier of the distribution controller and ID is │ │ │ the identifier of the low level entity that handles the connection (often │ │ │ -DistCtrlr itself).

        Only used during handshake phase.

      • f_address - A fun with the following signature:

        fun (DistCtrlr, Node) -> NetAddress

        where DistCtrlr is the identifier of the distribution controller, Node is │ │ │ +DistCtrlr itself).

        Only used during handshake phase.

      • f_address - A fun with the following signature:

        fun (DistCtrlr, Node) -> NetAddress

        where DistCtrlr is the identifier of the distribution controller, Node is │ │ │ the node name of the node on the other end, and NetAddress is a │ │ │ #net_address{} record with information about the address for the Node on │ │ │ the other end of the connection. The #net_address{} record is defined in │ │ │ -kernel/include/net_address.hrl.

        Only used during handshake phase.

      • mf_tick - A fun with the following signature:

        fun (DistCtrlr) -> void()

        where DistCtrlr is the identifier of the distribution controller. This │ │ │ +kernel/include/net_address.hrl.

        Only used during handshake phase.

      • mf_tick - A fun with the following signature:

        fun (DistCtrlr) -> void()

        where DistCtrlr is the identifier of the distribution controller. This │ │ │ function should send information over the connection that is not interpreted │ │ │ by the other end while increasing the statistics of received packets on the │ │ │ other end. This is usually implemented by sending an empty packet.

        Note

        It is of vital importance that this operation does not block the caller for │ │ │ -a long time. This since it is called from the connection supervisor.

        Used when connection is up.

      • mf_getstat - A fun with the following signature:

        fun (DistCtrlr) -> {ok, Received, Sent, PendSend}

        where DistCtrlr is the identifier of the distribution controller, Received │ │ │ +a long time. This since it is called from the connection supervisor.

        Used when connection is up.

      • mf_getstat - A fun with the following signature:

        fun (DistCtrlr) -> {ok, Received, Sent, PendSend}

        where DistCtrlr is the identifier of the distribution controller, Received │ │ │ is received packets, Sent is sent packets, and PendSend is amount of data │ │ │ in queue to be sent (typically in bytes, but dist_util only checks whether │ │ │ the value is non-zero to know there is data in queue) or a boolean/0 │ │ │ indicating whether there are packets in queue to be sent.

        Note

        It is of vital importance that this operation does not block the caller for │ │ │ a long time. This since it is called from the connection supervisor.

        Used when connection is up.

      • request_type - The request Type as passed to │ │ │ setup/5. This is only mandatory when the connection has │ │ │ -been initiated by this node. That is, the connection is set up via setup/5.

      • mf_setopts - A fun with the following signature:

        fun (DistCtrl, Opts) -> ok | {error, Error}

        where DistCtrlr is the identifier of the distribution controller and Opts │ │ │ -is a list of options to set on the connection.

        This function is optional. Used when connection is up.

      • mf_getopts - A fun with the following signature:

        fun (DistCtrl, Opts) -> {ok, OptionValues} | {error, Error}

        where DistCtrlr is the identifier of the distribution controller and Opts │ │ │ +been initiated by this node. That is, the connection is set up via setup/5.

      • mf_setopts - A fun with the following signature:

        fun (DistCtrl, Opts) -> ok | {error, Error}

        where DistCtrlr is the identifier of the distribution controller and Opts │ │ │ +is a list of options to set on the connection.

        This function is optional. Used when connection is up.

      • mf_getopts - A fun with the following signature:

        fun (DistCtrl, Opts) -> {ok, OptionValues} | {error, Error}

        where DistCtrlr is the identifier of the distribution controller and Opts │ │ │ is a list of options to read for the connection.

        This function is optional. Used when connection is up.

      • f_handshake_complete - A fun with the │ │ │ -following signature:

        fun (DistCtrlr, Node, DHandle) -> void()

        where DistCtrlr is the identifier of the distribution controller, Node is │ │ │ +following signature:

        fun (DistCtrlr, Node, DHandle) -> void()

        where DistCtrlr is the identifier of the distribution controller, Node is │ │ │ the node name of the node connected at the other end, and DHandle is a │ │ │ distribution handle needed by a distribution controller process when calling │ │ │ the following BIFs:

        This function is called when the handshake has completed and the distribution │ │ │ channel is up. The distribution controller can begin dispatching traffic over │ │ │ the channel. This function is optional.

        Only used during handshake phase.

      • add_flags - │ │ │ Distribution flags to add to the connection. │ │ │ Currently all (non obsolete) flags will automatically be enabled.

        This flag field is optional.

      • reject_flags - │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/automaticyieldingofccode.html │ │ │ @@ -209,17 +209,17 @@ │ │ │ they have to follow certain restrictions. The convention for making │ │ │ this clear is to have a comment above the function that explains that │ │ │ the function is transformed by YCF (see maps_values_1_helper in │ │ │ erl_map.c for an example). If only the transformed version of the │ │ │ function is used, the convention is to "comment out" the source for the │ │ │ function by surrounding it with the following #ifdef (this way, one │ │ │ will not get warnings about unused functions):

        #ifdef INCLUDE_YCF_TRANSFORMED_ONLY_FUNCTIONS
        │ │ │ -void my_fun() {
        │ │ │ +void my_fun() {
        │ │ │      ...
        │ │ │ -}
        │ │ │ +}
        │ │ │  #endif /* INCLUDE_YCF_TRANSFORMED_ONLY_FUNCTIONS */

        While editing the function one can define │ │ │ INCLUDE_YCF_TRANSFORMED_ONLY_FUNCTIONS so that one can see errors │ │ │ and warnings in the non-transformed source.

        │ │ │ │ │ │ │ │ │ │ │ │ Where to Place YCF Transformed Functions │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/beam_makeops.html │ │ │ @@ -151,17 +151,17 @@ │ │ │ The loader translates generic instructions to specific instructions. │ │ │ In general, for each generic instruction, there exists a family of │ │ │ specific instructions. The OTP 20 release has 389 specific │ │ │ instructions.

      • The implementation of specific instructions for the traditional │ │ │ BEAM interpreter. For the BeamAsm JIT introduced │ │ │ in OTP 24, the implementation of instructions are defined in emitter │ │ │ functions written in C++.

      Generic instructions have typed operands. Here are a few examples of │ │ │ -operands for move/2:

      {move,{atom,id},{x,5}}.
      │ │ │ -{move,{x,3},{x,0}}.
      │ │ │ -{move,{x,2},{y,1}}.

      When those instructions are loaded, the loader rewrites them │ │ │ +operands for move/2:

      {move,{atom,id},{x,5}}.
      │ │ │ +{move,{x,3},{x,0}}.
      │ │ │ +{move,{x,2},{y,1}}.

      When those instructions are loaded, the loader rewrites them │ │ │ to specific instructions:

      move_cx id 5
      │ │ │  move_xx 3 0
      │ │ │  move_xy 2 1

      Corresponding to each generic instruction, there is a family of │ │ │ specific instructions. The types that an instance of a specific │ │ │ instruction can handle are encoded in the instruction names. For │ │ │ example, move_xy takes an X register number as the first operand and │ │ │ a Y register number as the second operand. move_cx takes a tagged │ │ │ @@ -185,17 +185,17 @@ │ │ │ move c x

    Each specific instructions is defined by following the name of the │ │ │ instruction with the types for each operand. An operand type is a │ │ │ single letter. For example, x means an X register, y │ │ │ means a Y register, and c is a "constant" (a tagged term such as │ │ │ an integer, an atom, or a literal).

    Now let's look at the implementation of the move instruction. There │ │ │ are multiple files containing implementations of instructions in the │ │ │ erts/emulator/beam/emu directory. The move instruction is defined │ │ │ -in instrs.tab. It looks like this:

    move(Src, Dst) {
    │ │ │ +in instrs.tab.  It looks like this:

    move(Src, Dst) {
    │ │ │      $Dst = $Src;
    │ │ │ -}

    The implementation for an instruction largely follows the C syntax, │ │ │ +}

    The implementation for an instruction largely follows the C syntax, │ │ │ except that the variables in the function head don't have any types. │ │ │ The $ before an identifier denotes a macro expansion. Thus, │ │ │ $Src will expand to the code to pick up the source operand for │ │ │ the instruction and $Dst to the code for the destination register.

    We will look at the code for each specific instruction in turn. To │ │ │ make the code easier to understand, let's first look at the memory │ │ │ layout for the instruction {move,{atom,id},{x,5}}:

         +--------------------+--------------------+
    │ │ │  I -> |                 40 |       &&lb_move_cx |
    │ │ │ @@ -204,61 +204,61 @@
    │ │ │       +--------------------+--------------------+

    This example and all other examples in the document assumes a 64-bit │ │ │ architecture, and furthermore that pointers to C code fit in 32 bits.

    I in the BEAM virtual machine is the instruction pointer. When BEAM │ │ │ executes an instruction, I points to the first word of the │ │ │ instruction.

    &&lb_move_cx is the address to C code that implements move_cx. It │ │ │ is stored in the lower 32 bits of the word. In the upper 32 bits is │ │ │ the byte offset to the X register; the register number 5 has been │ │ │ multiplied by the word size size 8.

    In the next word the tagged atom id is stored.

    With that background, we can look at the generated code for move_cx │ │ │ -in beam_hot.h:

    OpCase(move_cx):
    │ │ │ -{
    │ │ │ -  BeamInstr next_pf = BeamCodeAddr(I[2]);
    │ │ │ -  xb(BeamExtraData(I[0])) = I[1];
    │ │ │ +in beam_hot.h:

    OpCase(move_cx):
    │ │ │ +{
    │ │ │ +  BeamInstr next_pf = BeamCodeAddr(I[2]);
    │ │ │ +  xb(BeamExtraData(I[0])) = I[1];
    │ │ │    I += 2;
    │ │ │ -  ASSERT(VALID_INSTR(next_pf));
    │ │ │ -  GotoPF(next_pf);
    │ │ │ -}

    We will go through each line in turn.

    • OpCase(move_cx): defines a label for the instruction. The │ │ │ + ASSERT(VALID_INSTR(next_pf)); │ │ │ + GotoPF(next_pf); │ │ │ +}

    We will go through each line in turn.

    • OpCase(move_cx): defines a label for the instruction. The │ │ │ OpCase() macro is defined in beam_emu.c. It will expand this line │ │ │ to lb_move_cx:.

    • BeamInstr next_pf = BeamCodeAddr(I[2]); fetches the pointer to │ │ │ code for the next instruction to be executed. The BeamCodeAddr() │ │ │ macro extracts the pointer from the lower 32 bits of the instruction │ │ │ word.

    • xb(BeamExtraData(I[0])) = I[1]; is the expansion of $Dst = $Src. │ │ │ BeamExtraData() is a macro that will extract the upper 32 bits from │ │ │ the instruction word. In this example, it will return 40 which is the │ │ │ byte offset for X register 5. The xb() macro will cast a byte │ │ │ pointer to an Eterm pointer and dereference it. The I[1] on │ │ │ the right-hand side of the = fetches an Erlang term (the atom id in │ │ │ this case).

    • I += 2 advances the instruction pointer to the next │ │ │ instruction.

    • In a debug-compiled emulator, ASSERT(VALID_INSTR(next_pf)); makes │ │ │ sure that next_pf is a valid instruction (that is, that it points │ │ │ -within the process_main() function in beam_emu.c).

    • GotoPF(next_pf); transfers control to the next instruction.

    Now let's look at the implementation of move_xx:

    OpCase(move_xx):
    │ │ │ -{
    │ │ │ -  Eterm tmp_packed1 = BeamExtraData(I[0]);
    │ │ │ -  BeamInstr next_pf = BeamCodeAddr(I[1]);
    │ │ │ -  xb((tmp_packed1>>BEAM_TIGHT_SHIFT)) = xb(tmp_packed1&BEAM_TIGHT_MASK);
    │ │ │ +within the process_main() function in beam_emu.c).

  • GotoPF(next_pf); transfers control to the next instruction.

  • Now let's look at the implementation of move_xx:

    OpCase(move_xx):
    │ │ │ +{
    │ │ │ +  Eterm tmp_packed1 = BeamExtraData(I[0]);
    │ │ │ +  BeamInstr next_pf = BeamCodeAddr(I[1]);
    │ │ │ +  xb((tmp_packed1>>BEAM_TIGHT_SHIFT)) = xb(tmp_packed1&BEAM_TIGHT_MASK);
    │ │ │    I += 1;
    │ │ │ -  ASSERT(VALID_INSTR(next_pf));
    │ │ │ -  GotoPF(next_pf);
    │ │ │ -}

    We will go through the lines that are new or have changed compared to │ │ │ + ASSERT(VALID_INSTR(next_pf)); │ │ │ + GotoPF(next_pf); │ │ │ +}

    We will go through the lines that are new or have changed compared to │ │ │ move_cx.

    • Eterm tmp_packed1 = BeamExtraData(I[0]); picks up both X register │ │ │ numbers packed into the upper 32 bits of the instruction word.

    • BeamInstr next_pf = BeamCodeAddr(I[1]); pre-fetches the address of │ │ │ the next instruction. Note that because both X registers operands fits │ │ │ into the instruction word, the next instruction is in the very next │ │ │ word.

    • xb((tmp_packed1>>BEAM_TIGHT_SHIFT)) = xb(tmp_packed1&BEAM_TIGHT_MASK); │ │ │ copies the source to the destination. (For a 64-bit architecture, │ │ │ BEAM_TIGHT_SHIFT is 16 and BEAM_TIGHT_MASK is 0xFFFF.)

    • I += 1; advances the instruction pointer to the next instruction.

    move_xy is almost identical to move_xx. The only difference is │ │ │ the use of the yb() macro instead of xb() to reference the │ │ │ -destination register:

    OpCase(move_xy):
    │ │ │ -{
    │ │ │ -  Eterm tmp_packed1 = BeamExtraData(I[0]);
    │ │ │ -  BeamInstr next_pf = BeamCodeAddr(I[1]);
    │ │ │ -  yb((tmp_packed1>>BEAM_TIGHT_SHIFT)) = xb(tmp_packed1&BEAM_TIGHT_MASK);
    │ │ │ +destination register:

    OpCase(move_xy):
    │ │ │ +{
    │ │ │ +  Eterm tmp_packed1 = BeamExtraData(I[0]);
    │ │ │ +  BeamInstr next_pf = BeamCodeAddr(I[1]);
    │ │ │ +  yb((tmp_packed1>>BEAM_TIGHT_SHIFT)) = xb(tmp_packed1&BEAM_TIGHT_MASK);
    │ │ │    I += 1;
    │ │ │ -  ASSERT(VALID_INSTR(next_pf));
    │ │ │ -  GotoPF(next_pf);
    │ │ │ -}

    │ │ │ + ASSERT(VALID_INSTR(next_pf)); │ │ │ + GotoPF(next_pf); │ │ │ +}

    │ │ │ │ │ │ │ │ │ │ │ │ Transformation rules │ │ │

    │ │ │

    Next let's look at how we can do some optimizations using transformation │ │ │ rules. For simple instructions such as move/2, the instruction dispatch │ │ │ @@ -271,21 +271,21 @@ │ │ │ with an uppercase letter just as in Erlang. A pattern variable may be │ │ │ followed = and one or more type letters to constrain the match to │ │ │ one of those types. The variables that are bound on the left-hand side can │ │ │ be used on the right-hand side.

    We will also need to define a specific instruction and an implementation:

    # In ops.tab
    │ │ │  move2 x y x y
    │ │ │  
    │ │ │  // In instrs.tab
    │ │ │ -move2(S1, D1, S2, D2) {
    │ │ │ +move2(S1, D1, S2, D2) {
    │ │ │      Eterm V1, V2;
    │ │ │      V1 = $S1;
    │ │ │      V2 = $S2;
    │ │ │      $D1 = V1;
    │ │ │      $D2 = V2;
    │ │ │ -}

    When the loader has found a match and replaced the matched instructions, │ │ │ +}

    When the loader has found a match and replaced the matched instructions, │ │ │ it will match the new instructions against the transformation rules. │ │ │ Because of that, we can define the rule for a move3/6 instruction │ │ │ as follows:

    move2 X1=x Y1=y X2=x Y2=y | move X3=x Y3=y =>
    │ │ │        move3 X1 Y1 X2 Y2 X3 Y3

    (For readability, a long transformation line can be broken after | │ │ │ and => operators.)

    It would also be possible to define it like this:

    move X1=x Y1=y | move X2=x Y2=y | move X3=x Y3=y =>
    │ │ │       move3 X1 Y1 X2 Y2 X3 Y3

    but in that case it must be defined before the rule for move2/4 │ │ │ because the first matching rule will be applied.

    One must be careful not to create infinite loops. For example, if we │ │ │ @@ -433,29 +433,29 @@ │ │ │ i_bs_get_integer_32 x f? x │ │ │ %endif

    The specific instruction i_bs_get_integer_32 will only be defined │ │ │ on a 64-bit machine.

    The condition can be inverted by using %unless instead of %if:

    %unless NO_FPE_SIGNALS
    │ │ │  fcheckerror p => i_fcheckerror
    │ │ │  i_fcheckerror
    │ │ │  fclearerror
    │ │ │  %endif

    It is also possible to add an %else clause:

    %if ARCH_64
    │ │ │ -BS_SAFE_MUL(A, B, Fail, Dst) {
    │ │ │ -    Uint64 res = ($A) * ($B);
    │ │ │ -    if (res / $B != $A) {
    │ │ │ +BS_SAFE_MUL(A, B, Fail, Dst) {
    │ │ │ +    Uint64 res = ($A) * ($B);
    │ │ │ +    if (res / $B != $A) {
    │ │ │          $Fail;
    │ │ │ -    }
    │ │ │ +    }
    │ │ │      $Dst = res;
    │ │ │ -}
    │ │ │ +}
    │ │ │  %else
    │ │ │ -BS_SAFE_MUL(A, B, Fail, Dst) {
    │ │ │ -    Uint64 res = (Uint64)($A) * (Uint64)($B);
    │ │ │ -    if ((res >> (8*sizeof(Uint))) != 0) {
    │ │ │ +BS_SAFE_MUL(A, B, Fail, Dst) {
    │ │ │ +    Uint64 res = (Uint64)($A) * (Uint64)($B);
    │ │ │ +    if ((res >> (8*sizeof(Uint))) != 0) {
    │ │ │          $Fail;
    │ │ │ -    }
    │ │ │ +    }
    │ │ │      $Dst = res;
    │ │ │ -}
    │ │ │ +}
    │ │ │  %endif

    Symbols that are defined in directives

    The following symbols are always defined.

    • ARCH_64 - is 1 for a 64-bit machine, and 0 otherwise.
    • ARCH_32 - is 1 for 32-bit machine, and 0 otherwise.

    The Makefile for building the emulator currently defines the │ │ │ following symbols by using the -D option on the command line for │ │ │ beam_makeops.

    • USE_VM_PROBES - 1 if the runtime system is compiled to use VM │ │ │ probes (support for dtrace or systemtap), 0 otherwise.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -676,15 +676,15 @@ │ │ │ match both source and destination registers. As an operand in a specific │ │ │ instruction, it must only be used for a destination register.)

  • o - Overflow. An untagged integer that does not fit in a machine word.

  • Predicates

    If the constraints described so far is not enough, additional │ │ │ constraints can be implemented in C and be called as a guard function │ │ │ on the left-hand side of the transformation. If the guard function returns │ │ │ a non-zero value, the matching of the rule will continue, otherwise │ │ │ the match will fail. Such guard functions are hereafter called │ │ │ predicates.

    The most commonly used guard constraints is equal(). It can be used │ │ │ -to remove a redundant move instructio like this:

    move R1 R2 | equal(R1, R2) => _

    or remove a redundant is_eq_exact instruction like this:

    is_eq_exact Lbl Src1 Src2 | equal(Src1, Src2) => _

    At the time of writing, all predicates are defined in files named │ │ │ +to remove a redundant move instructio like this:

    move R1 R2 | equal(R1, R2) => _

    or remove a redundant is_eq_exact instruction like this:

    is_eq_exact Lbl Src1 Src2 | equal(Src1, Src2) => _

    At the time of writing, all predicates are defined in files named │ │ │ predicates.tab in several directories. In predicates.tab directly │ │ │ in $ERL_TOP/erts/emulator/beam, predicates that are used by both the │ │ │ traditinal emulator and the JIT implementations are contained. │ │ │ Predicates only used by the emulator can be found in │ │ │ emu/predicates.tab.

    │ │ │ │ │ │ │ │ │ @@ -692,41 +692,41 @@ │ │ │ A very brief note on implementation of predicates │ │ │

    │ │ │

    It is outside the scope for this document to describe in detail how │ │ │ predicates are implemented because it requires knowledge of the │ │ │ internal loader data structures, but here is quick look at the │ │ │ implementation of a simple predicate called literal_is_map().

    Here is first an example how it is used:

    ismap Fail Lit=q | literal_is_map(Lit) =>

    If the Lit operand is a literal, then the literal_is_map() │ │ │ predicate is called to determine whether it is a map literal. │ │ │ -If it is, the instruction is not needed and can be removed.

    literal_is_map() is implemented like this (in emu/predicates.tab):

    pred.literal_is_map(Lit) {
    │ │ │ +If it is, the instruction is not needed and can be removed.

    literal_is_map() is implemented like this (in emu/predicates.tab):

    pred.literal_is_map(Lit) {
    │ │ │      Eterm term;
    │ │ │  
    │ │ │ -    ASSERT(Lit.type == TAG_q);
    │ │ │ -    term = beamfile_get_literal(&S->beam, Lit.val);
    │ │ │ -    return is_map(term);
    │ │ │ -}

    The pred. prefix tells beam_makeops that this function is a │ │ │ + ASSERT(Lit.type == TAG_q); │ │ │ + term = beamfile_get_literal(&S->beam, Lit.val); │ │ │ + return is_map(term); │ │ │ +}

    The pred. prefix tells beam_makeops that this function is a │ │ │ predicate. Without the prefix, it would have been interpreted as the │ │ │ implementation of an instruction (described in Defining the │ │ │ implementation).

    Predicate functions have a magic variabled called S, which is a │ │ │ pointer to a state struct. In the example, │ │ │ beamfile_get_literal(&S->beam, Lit.val); is used to retrieve the actual term │ │ │ for the literal.

    At the time of writing, the expanded C code generated by │ │ │ -beam_makeops looks like this:

    static int literal_is_map(LoaderState* S, BeamOpArg Lit) {
    │ │ │ +beam_makeops looks like this:

    static int literal_is_map(LoaderState* S, BeamOpArg Lit) {
    │ │ │    Eterm term;
    │ │ │  
    │ │ │ -  ASSERT(Lit.type == TAG_q);
    │ │ │ -  term = S->literals[Lit.val].term;
    │ │ │ -  return is_map(term);;
    │ │ │ -}

    Handling instructions with variable number of operands

    Some instructions, such as select_val/3, essentially has a variable │ │ │ + ASSERT(Lit.type == TAG_q); │ │ │ + term = S->literals[Lit.val].term; │ │ │ + return is_map(term);; │ │ │ +}

    Handling instructions with variable number of operands

    Some instructions, such as select_val/3, essentially has a variable │ │ │ number of operands. Such instructions have a {list,[...]} operand │ │ │ -as their last operand in the BEAM assembly code. For example:

    {select_val,{x,0},
    │ │ │ -            {f,1},
    │ │ │ -            {list,[{atom,b},{f,4},{atom,a},{f,5}]}}.

    The loader will convert a {list,[...]} operand to an u operand whose │ │ │ +as their last operand in the BEAM assembly code. For example:

    {select_val,{x,0},
    │ │ │ +            {f,1},
    │ │ │ +            {list,[{atom,b},{f,4},{atom,a},{f,5}]}}.

    The loader will convert a {list,[...]} operand to an u operand whose │ │ │ value is the number of elements in the list, followed by each element in │ │ │ the list. The instruction above would be translated to the following │ │ │ -generic instruction:

    {select_val,{x,0},{f,1},{u,4},{atom,b},{f,4},{atom,a},{f,5}}

    To match a variable number of arguments we need to use the special │ │ │ +generic instruction:

    {select_val,{x,0},{f,1},{u,4},{atom,b},{f,4},{atom,a},{f,5}}

    To match a variable number of arguments we need to use the special │ │ │ operand type * like this:

    select_val Src=aiq Fail=f Size=u List=* =>
    │ │ │      i_const_select_val Src Fail Size List

    This transformation renames a select_val/3 instruction │ │ │ with a constant source operand to i_const_select_val/3.

    Constructing new instructions on the right-hand side

    The most common operand on the right-hand side is a variable that was │ │ │ bound while matching the pattern on the left-hand side. For example:

    trim N Remaining => i_trim N

    An operand can also be a type letter to construct an operand of that │ │ │ type. Each type has a default value. For example, the type x has │ │ │ the default value 1023, which is the highest X register. That makes │ │ │ x on the right-hand side a convenient shortcut for a temporary X │ │ │ @@ -746,53 +746,53 @@ │ │ │ transformation rule.

    • u - Construct an untagged integer. The default value is 0.

    • x - X register. The default value is 1023. That makes x convenient to │ │ │ use as a temporary X register.

    • y - Y register. The default value is 0.

    • l - Floating point register number. The default value is 0.

    • i - Tagged literal integer. The default value is 0.

    • a - Tagged atom. The default value is the empty atom (am_Empty).

    • p - Zero failure label.

    • n - NIL ([], the empty list).

    Function call on the right-hand side

    Transformations that are not possible to describe with the rule │ │ │ language as described here can be implemented as a generator function │ │ │ in C and called from the right-hand side of a transformation. The left-hand │ │ │ side of the transformation will perform the match and bind operands to │ │ │ variables. The variables can then be passed to a generator function │ │ │ on the right-hand side. For example:

    bif2 Fail=j u$bif:erlang:element/2 Index=s Tuple=xy Dst=d =>
    │ │ │ -    element(Jump, Index, Tuple, Dst)

    This transformation rule matches a call to the BIF element/2. │ │ │ + element(Jump, Index, Tuple, Dst)

    This transformation rule matches a call to the BIF element/2. │ │ │ The operands will be captured and the generator function element() will │ │ │ be called.

    The element() generator will produce one of two instructions │ │ │ depending on Index. If Index is an integer in the range from 1 up │ │ │ to the maximum tuple size, the instruction i_fast_element/2 will be │ │ │ produced, otherwise the instruction i_element/4 will be produced. │ │ │ The corresponding specific instructions are:

    i_fast_element xy j? I d
    │ │ │  i_element xy j? s d

    The i_fast_element/2 instruction is faster because the tuple is │ │ │ already an untagged integer. It also knows that the index is at least │ │ │ 1, so it does not have to test for that. The i_element/4 │ │ │ instruction will have to fetch the index from a register, test that it │ │ │ is an integer, and untag the integer.

    At the time of writing, all generators functions were defined in files │ │ │ named generators.tab in several directories (in the same directories │ │ │ as the predicates.tab files).

    It is outside the scope of this document to describe in detail how │ │ │ generator functions are written, but here is the implementation of │ │ │ -element():

    gen.element(Fail, Index, Tuple, Dst) {
    │ │ │ +element():

    gen.element(Fail, Index, Tuple, Dst) {
    │ │ │      BeamOp* op;
    │ │ │  
    │ │ │ -    $NewBeamOp(S, op);
    │ │ │ +    $NewBeamOp(S, op);
    │ │ │  
    │ │ │ -    if (Index.type == TAG_i && Index.val > 0 &&
    │ │ │ +    if (Index.type == TAG_i && Index.val > 0 &&
    │ │ │          Index.val <= ERTS_MAX_TUPLE_SIZE &&
    │ │ │ -        (Tuple.type == TAG_x || Tuple.type == TAG_y)) {
    │ │ │ -        $BeamOpNameArity(op, i_fast_element, 4);
    │ │ │ -        op->a[0] = Tuple;
    │ │ │ -        op->a[1] = Fail;
    │ │ │ -        op->a[2].type = TAG_u;
    │ │ │ -        op->a[2].val = Index.val;
    │ │ │ -        op->a[3] = Dst;
    │ │ │ -    } else {
    │ │ │ -        $BeamOpNameArity(op, i_element, 4);
    │ │ │ -        op->a[0] = Tuple;
    │ │ │ -        op->a[1] = Fail;
    │ │ │ -        op->a[2] = Index;
    │ │ │ -        op->a[3] = Dst;
    │ │ │ -    }
    │ │ │ +        (Tuple.type == TAG_x || Tuple.type == TAG_y)) {
    │ │ │ +        $BeamOpNameArity(op, i_fast_element, 4);
    │ │ │ +        op->a[0] = Tuple;
    │ │ │ +        op->a[1] = Fail;
    │ │ │ +        op->a[2].type = TAG_u;
    │ │ │ +        op->a[2].val = Index.val;
    │ │ │ +        op->a[3] = Dst;
    │ │ │ +    } else {
    │ │ │ +        $BeamOpNameArity(op, i_element, 4);
    │ │ │ +        op->a[0] = Tuple;
    │ │ │ +        op->a[1] = Fail;
    │ │ │ +        op->a[2] = Index;
    │ │ │ +        op->a[3] = Dst;
    │ │ │ +    }
    │ │ │  
    │ │ │      return op;
    │ │ │ -}

    The gen. prefix tells beam_makeops that this function is a │ │ │ +}

    The gen. prefix tells beam_makeops that this function is a │ │ │ generator. Without the prefix, it would have been interpreted as the │ │ │ implementation of an instruction (described in Defining the │ │ │ implementation).

    Generator functions have a magic variabled called S, which is a │ │ │ pointer to a state struct. In the example, S is used in the invocation │ │ │ of the NewBeamOp macro.

    │ │ │ │ │ │ │ │ │ @@ -814,473 +814,473 @@ │ │ │ msg_instrs.tab │ │ │ select_instrs.tab │ │ │ trace_instrs.tab

    There is also a file that only contains macro definitions:

    macros.tab

    The syntax of each file is similar to C code. In fact, most of │ │ │ the contents is C code, interspersed with macro invocations.

    To allow Emacs to auto-indent the code, each file starts with the │ │ │ following line:

    // -*- c -*-

    To avoid messing up the indentation, all comments are written │ │ │ as C++ style comments (//) instead of #. Note that a comment │ │ │ must start at the beginning of a line.

    The meat of an instruction definition file are macro definitions. │ │ │ -We have seen this macro definition before:

    move(Src, Dst) {
    │ │ │ +We have seen this macro definition before:

    move(Src, Dst) {
    │ │ │      $Dst = $Src;
    │ │ │ -}

    A macro definitions must start at the beginning of the line (no spaces │ │ │ +}

    A macro definitions must start at the beginning of the line (no spaces │ │ │ allowed), the opening curly bracket must be on the same line, and the │ │ │ finishing curly bracket must be at the beginning of a line. It is │ │ │ recommended that the macro body is properly indented.

    As a convention, the macro arguments in the head all start with an │ │ │ uppercase letter. In the body, the macro arguments can be expanded │ │ │ by preceding them with $.

    A macro definition whose name and arity matches a family of │ │ │ specific instructions is assumed to be the implementation of that │ │ │ instruction.

    A macro can also be invoked from within another macro. For example, │ │ │ move_deallocate_return/2 avoids repeating code by invoking │ │ │ -$deallocate_return() as a macro:

    move_deallocate_return(Src, Deallocate) {
    │ │ │ -    x(0) = $Src;
    │ │ │ -    $deallocate_return($Deallocate);
    │ │ │ -}

    Here is the definition of deallocate_return/1:

    deallocate_return(Deallocate) {
    │ │ │ +$deallocate_return() as a macro:

    move_deallocate_return(Src, Deallocate) {
    │ │ │ +    x(0) = $Src;
    │ │ │ +    $deallocate_return($Deallocate);
    │ │ │ +}

    Here is the definition of deallocate_return/1:

    deallocate_return(Deallocate) {
    │ │ │      //| -no_next
    │ │ │      int words_to_pop = $Deallocate;
    │ │ │ -    SET_I((BeamInstr *) cp_val(*E));
    │ │ │ -    E = ADD_BYTE_OFFSET(E, words_to_pop);
    │ │ │ -    CHECK_TERM(x(0));
    │ │ │ +    SET_I((BeamInstr *) cp_val(*E));
    │ │ │ +    E = ADD_BYTE_OFFSET(E, words_to_pop);
    │ │ │ +    CHECK_TERM(x(0));
    │ │ │      DispatchReturn;
    │ │ │ -}

    The expanded code for move_deallocate_return will look this:

    OpCase(move_deallocate_return_cQ):
    │ │ │ -{
    │ │ │ -  x(0) = I[1];
    │ │ │ -  do {
    │ │ │ -    int words_to_pop = Qb(BeamExtraData(I[0]));
    │ │ │ -    SET_I((BeamInstr *) cp_val(*E));
    │ │ │ -    E = ADD_BYTE_OFFSET(E, words_to_pop);
    │ │ │ -    CHECK_TERM(x(0));
    │ │ │ +}

    The expanded code for move_deallocate_return will look this:

    OpCase(move_deallocate_return_cQ):
    │ │ │ +{
    │ │ │ +  x(0) = I[1];
    │ │ │ +  do {
    │ │ │ +    int words_to_pop = Qb(BeamExtraData(I[0]));
    │ │ │ +    SET_I((BeamInstr *) cp_val(*E));
    │ │ │ +    E = ADD_BYTE_OFFSET(E, words_to_pop);
    │ │ │ +    CHECK_TERM(x(0));
    │ │ │      DispatchReturn;
    │ │ │ -  } while (0);
    │ │ │ -}

    When expanding macros, beam_makeops wraps the expansion in a │ │ │ + } while (0); │ │ │ +}

    When expanding macros, beam_makeops wraps the expansion in a │ │ │ do/while wrapper unless beam_makeops can clearly see that no │ │ │ wrapper is needed. In this case, the wrapper is needed.

    Note that arguments for macros cannot be complex expressions, because │ │ │ the arguments are split on ,. For example, the following would │ │ │ not work because beam_makeops would split the expression into │ │ │ -two arguments:

    $deallocate_return(get_deallocation(y, $Deallocate));

    Code generation directives

    Within macro definitions, // comments are in general not treated │ │ │ +two arguments:

    $deallocate_return(get_deallocation(y, $Deallocate));

    Code generation directives

    Within macro definitions, // comments are in general not treated │ │ │ specially. They will be copied to the file with the generated code │ │ │ along with the rest of code in the body.

    However, there is an exception. Within a macro definition, a line that │ │ │ starts with whitespace followed by //| is treated specially. The │ │ │ rest of the line is assumed to contain directives to control code │ │ │ generation.

    Currently, two code generation directives are recognized:

    The -no_prefetch directive

    To see what -no_prefetch does, let's first look at the default code │ │ │ -generation. Here is the code generated for move_cx:

    OpCase(move_cx):
    │ │ │ -{
    │ │ │ -  BeamInstr next_pf = BeamCodeAddr(I[2]);
    │ │ │ -  xb(BeamExtraData(I[0])) = I[1];
    │ │ │ +generation.  Here is the code generated for move_cx:

    OpCase(move_cx):
    │ │ │ +{
    │ │ │ +  BeamInstr next_pf = BeamCodeAddr(I[2]);
    │ │ │ +  xb(BeamExtraData(I[0])) = I[1];
    │ │ │    I += 2;
    │ │ │ -  ASSERT(VALID_INSTR(next_pf));
    │ │ │ -  GotoPF(next_pf);
    │ │ │ -}

    Note that the very first thing done is to fetch the address to the │ │ │ + ASSERT(VALID_INSTR(next_pf)); │ │ │ + GotoPF(next_pf); │ │ │ +}

    Note that the very first thing done is to fetch the address to the │ │ │ next instruction. The reason is that it usually improves performance.

    Just as a demonstration, we can add a -no_prefetch directive to │ │ │ -the move/2 instruction:

    move(Src, Dst) {
    │ │ │ +the move/2 instruction:

    move(Src, Dst) {
    │ │ │      //| -no_prefetch
    │ │ │      $Dst = $Src;
    │ │ │ -}

    We can see that the prefetch is no longer done:

    OpCase(move_cx):
    │ │ │ -{
    │ │ │ -  xb(BeamExtraData(I[0])) = I[1];
    │ │ │ +}

    We can see that the prefetch is no longer done:

    OpCase(move_cx):
    │ │ │ +{
    │ │ │ +  xb(BeamExtraData(I[0])) = I[1];
    │ │ │    I += 2;
    │ │ │ -  ASSERT(VALID_INSTR(*I));
    │ │ │ -  Goto(*I);
    │ │ │ -}

    When would we want to turn off the prefetch in practice?

    In instructions that will not always execute the next instruction. │ │ │ -For example:

    is_atom(Fail, Src) {
    │ │ │ -    if (is_not_atom($Src)) {
    │ │ │ -        $FAIL($Fail);
    │ │ │ -    }
    │ │ │ -}
    │ │ │ +  ASSERT(VALID_INSTR(*I));
    │ │ │ +  Goto(*I);
    │ │ │ +}

    When would we want to turn off the prefetch in practice?

    In instructions that will not always execute the next instruction. │ │ │ +For example:

    is_atom(Fail, Src) {
    │ │ │ +    if (is_not_atom($Src)) {
    │ │ │ +        $FAIL($Fail);
    │ │ │ +    }
    │ │ │ +}
    │ │ │  
    │ │ │  // From macros.tab
    │ │ │ -FAIL(Fail) {
    │ │ │ +FAIL(Fail) {
    │ │ │      //| -no_prefetch
    │ │ │ -    $SET_I_REL($Fail);
    │ │ │ -    Goto(*I);
    │ │ │ -}

    is_atom/2 may either execute the next instruction (if the second │ │ │ -operand is an atom) or branch to the failure label.

    The generated code looks like this:

    OpCase(is_atom_fx):
    │ │ │ -{
    │ │ │ -  if (is_not_atom(xb(I[1]))) {
    │ │ │ -    ASSERT(VALID_INSTR(*(I + (fb(BeamExtraData(I[0]))) + 0)));
    │ │ │ -    I += fb(BeamExtraData(I[0])) + 0;;
    │ │ │ -    Goto(*I);;
    │ │ │ -  }
    │ │ │ +    $SET_I_REL($Fail);
    │ │ │ +    Goto(*I);
    │ │ │ +}

    is_atom/2 may either execute the next instruction (if the second │ │ │ +operand is an atom) or branch to the failure label.

    The generated code looks like this:

    OpCase(is_atom_fx):
    │ │ │ +{
    │ │ │ +  if (is_not_atom(xb(I[1]))) {
    │ │ │ +    ASSERT(VALID_INSTR(*(I + (fb(BeamExtraData(I[0]))) + 0)));
    │ │ │ +    I += fb(BeamExtraData(I[0])) + 0;;
    │ │ │ +    Goto(*I);;
    │ │ │ +  }
    │ │ │    I += 2;
    │ │ │ -  ASSERT(VALID_INSTR(*I));
    │ │ │ -  Goto(*I);
    │ │ │ -}
    The -no_next directive

    Next we will look at when the -no_next directive can be used. Here │ │ │ -is the jump/1 instruction:

    jump(Fail) {
    │ │ │ -    $JUMP($Fail);
    │ │ │ -}
    │ │ │ +  ASSERT(VALID_INSTR(*I));
    │ │ │ +  Goto(*I);
    │ │ │ +}
    The -no_next directive

    Next we will look at when the -no_next directive can be used. Here │ │ │ +is the jump/1 instruction:

    jump(Fail) {
    │ │ │ +    $JUMP($Fail);
    │ │ │ +}
    │ │ │  
    │ │ │  // From macros.tab
    │ │ │ -JUMP(Fail) {
    │ │ │ +JUMP(Fail) {
    │ │ │      //| -no_next
    │ │ │ -    $SET_I_REL($Fail);
    │ │ │ -    Goto(*I);
    │ │ │ -}

    The generated code looks like this:

    OpCase(jump_f):
    │ │ │ -{
    │ │ │ -  ASSERT(VALID_INSTR(*(I + (fb(BeamExtraData(I[0]))) + 0)));
    │ │ │ -  I += fb(BeamExtraData(I[0])) + 0;;
    │ │ │ -  Goto(*I);;
    │ │ │ -}

    If we remove the -no_next directive, the code would look like this:

    OpCase(jump_f):
    │ │ │ -{
    │ │ │ -  BeamInstr next_pf = BeamCodeAddr(I[1]);
    │ │ │ -  ASSERT(VALID_INSTR(*(I + (fb(BeamExtraData(I[0]))) + 0)));
    │ │ │ -  I += fb(BeamExtraData(I[0])) + 0;;
    │ │ │ -  Goto(*I);;
    │ │ │ +    $SET_I_REL($Fail);
    │ │ │ +    Goto(*I);
    │ │ │ +}

    The generated code looks like this:

    OpCase(jump_f):
    │ │ │ +{
    │ │ │ +  ASSERT(VALID_INSTR(*(I + (fb(BeamExtraData(I[0]))) + 0)));
    │ │ │ +  I += fb(BeamExtraData(I[0])) + 0;;
    │ │ │ +  Goto(*I);;
    │ │ │ +}

    If we remove the -no_next directive, the code would look like this:

    OpCase(jump_f):
    │ │ │ +{
    │ │ │ +  BeamInstr next_pf = BeamCodeAddr(I[1]);
    │ │ │ +  ASSERT(VALID_INSTR(*(I + (fb(BeamExtraData(I[0]))) + 0)));
    │ │ │ +  I += fb(BeamExtraData(I[0])) + 0;;
    │ │ │ +  Goto(*I);;
    │ │ │    I += 1;
    │ │ │ -  ASSERT(VALID_INSTR(next_pf));
    │ │ │ -  GotoPF(next_pf);
    │ │ │ -}

    In the end, the C compiler will probably optimize this code to the │ │ │ + ASSERT(VALID_INSTR(next_pf)); │ │ │ + GotoPF(next_pf); │ │ │ +}

    In the end, the C compiler will probably optimize this code to the │ │ │ same native code as the first version, but the first version is certainly │ │ │ much easier to read for human readers.

    Macros in the macros.tab file

    The file macros.tab contains many useful macros. When implementing │ │ │ new instructions it is good practice to look through macros.tab to │ │ │ see if any of existing macros can be used rather than re-inventing │ │ │ the wheel.

    We will describe a few of the most useful macros here.

    The GC_REGEXP definition

    The following line defines a regular expression that will recognize │ │ │ a call to a function that does a garbage collection:

     GC_REGEXP=erts_garbage_collect|erts_gc|GcBifFunction;

    The purpose is that beam_makeops can verify that an instruction │ │ │ that does a garbage collection and has an d operand uses the │ │ │ $REFRESH_GEN_DEST() macro.

    If you need to define a new function that does garbage collection, │ │ │ you should give it the prefix erts_gc_. If that is not possible │ │ │ you should update the regular expression so that it will match your │ │ │ -new function.

    FAIL(Fail)

    Branch to $Fail. Will suppress prefetch (-no_prefetch). Typical use:

    is_nonempty_list(Fail, Src) {
    │ │ │ -    if (is_not_list($Src)) {
    │ │ │ -        $FAIL($Fail);
    │ │ │ -    }
    │ │ │ -}
    JUMP(Fail)

    Branch to $Fail. Suppresses generation of dispatch of the next │ │ │ -instruction (-no_next). Typical use:

    jump(Fail) {
    │ │ │ -    $JUMP($Fail);
    │ │ │ -}
    GC_TEST(NeedStack, NeedHeap, Live)

    $GC_TEST(NeedStack, NeedHeap, Live) tests that given amount of │ │ │ +new function.

    FAIL(Fail)

    Branch to $Fail. Will suppress prefetch (-no_prefetch). Typical use:

    is_nonempty_list(Fail, Src) {
    │ │ │ +    if (is_not_list($Src)) {
    │ │ │ +        $FAIL($Fail);
    │ │ │ +    }
    │ │ │ +}
    JUMP(Fail)

    Branch to $Fail. Suppresses generation of dispatch of the next │ │ │ +instruction (-no_next). Typical use:

    jump(Fail) {
    │ │ │ +    $JUMP($Fail);
    │ │ │ +}
    GC_TEST(NeedStack, NeedHeap, Live)

    $GC_TEST(NeedStack, NeedHeap, Live) tests that given amount of │ │ │ stack space and heap space is available. If not it will do a │ │ │ -garbage collection. Typical use:

    test_heap(Nh, Live) {
    │ │ │ -    $GC_TEST(0, $Nh, $Live);
    │ │ │ -}
    AH(NeedStack, NeedHeap, Live)

    AH(NeedStack, NeedHeap, Live) allocates a stack frame and │ │ │ +garbage collection. Typical use:

    test_heap(Nh, Live) {
    │ │ │ +    $GC_TEST(0, $Nh, $Live);
    │ │ │ +}
    AH(NeedStack, NeedHeap, Live)

    AH(NeedStack, NeedHeap, Live) allocates a stack frame and │ │ │ optionally additional heap space.

    Pre-defined macros and variables

    beam_makeops defines several built-in macros and pre-bound variables.

    The NEXT_INSTRUCTION pre-bound variable

    The NEXT_INSTRUCTION is a pre-bound variable that is available in │ │ │ -all instructions. It expands to the address of the next instruction.

    Here is an example:

    i_call(CallDest) {
    │ │ │ +all instructions.  It expands to the address of the next instruction.

    Here is an example:

    i_call(CallDest) {
    │ │ │      //| -no_next
    │ │ │ -    $SAVE_CONTINUATION_POINTER($NEXT_INSTRUCTION);
    │ │ │ -    $DISPATCH_REL($CallDest);
    │ │ │ -}

    When calling a function, the return address is first stored in E[0] │ │ │ + $SAVE_CONTINUATION_POINTER($NEXT_INSTRUCTION); │ │ │ + $DISPATCH_REL($CallDest); │ │ │ +}

    When calling a function, the return address is first stored in E[0] │ │ │ (using the $SAVE_CONTINUATION_POINTER() macro), and then control is │ │ │ -transferred to the callee. Here is the generated code:

    OpCase(i_call_f):
    │ │ │ -{
    │ │ │ -    ASSERT(VALID_INSTR(*(I+2)));
    │ │ │ -    *E = (BeamInstr) (I+2);;
    │ │ │ +transferred to the callee.  Here is the generated code:

    OpCase(i_call_f):
    │ │ │ +{
    │ │ │ +    ASSERT(VALID_INSTR(*(I+2)));
    │ │ │ +    *E = (BeamInstr) (I+2);;
    │ │ │  
    │ │ │      /* ... dispatch code intentionally left out ... */
    │ │ │ -}

    We can see that that $NEXT_INSTRUCTION has been expanded to I+2. │ │ │ +}

    We can see that that $NEXT_INSTRUCTION has been expanded to I+2. │ │ │ That makes sense since the size of the i_call_f/1 instruction is │ │ │ two words.

    The IP_ADJUSTMENT pre-bound variable

    $IP_ADJUSTMENT is usually 0. In a few combined instructions │ │ │ (described below) it can be non-zero. It is used like this │ │ │ -in macros.tab:

    SET_I_REL(Offset) {
    │ │ │ -    ASSERT(VALID_INSTR(*(I + ($Offset) + $IP_ADJUSTMENT)));
    │ │ │ +in macros.tab:

    SET_I_REL(Offset) {
    │ │ │ +    ASSERT(VALID_INSTR(*(I + ($Offset) + $IP_ADJUSTMENT)));
    │ │ │      I += $Offset + $IP_ADJUSTMENT;
    │ │ │ -}

    Avoid using IP_ADJUSTMENT directly. Use SET_I_REL() or │ │ │ +}

    Avoid using IP_ADJUSTMENT directly. Use SET_I_REL() or │ │ │ one of the macros that invoke such as FAIL() or JUMP() │ │ │ defined in macros.tab.

    Pre-defined macro functions

    The IF() macro

    $IF(Expr, IfTrue, IfFalse) evaluates Expr, which must be a valid │ │ │ Perl expression (which for simple numeric expressions have the same │ │ │ syntax as C). If Expr evaluates to 0, the entire IF() expression will be │ │ │ replaced with IfFalse, otherwise it will be replaced with IfTrue.

    See the description of OPERAND_POSITION() for an example.

    The OPERAND_POSITION() macro

    $OPERAND_POSITION(Expr) returns the position for Expr, if │ │ │ Expr is an operand that is not packed. The first operand is │ │ │ -at position 1.

    Returns 0 otherwise.

    This macro could be used like this in order to share code:

    FAIL(Fail) {
    │ │ │ +at position 1.

    Returns 0 otherwise.

    This macro could be used like this in order to share code:

    FAIL(Fail) {
    │ │ │      //| -no_prefetch
    │ │ │ -    $IF($OPERAND_POSITION($Fail) == 1 && $IP_ADJUSTMENT == 0,
    │ │ │ +    $IF($OPERAND_POSITION($Fail) == 1 && $IP_ADJUSTMENT == 0,
    │ │ │          goto common_jump,
    │ │ │ -        $DO_JUMP($Fail));
    │ │ │ -}
    │ │ │ +        $DO_JUMP($Fail));
    │ │ │ +}
    │ │ │  
    │ │ │ -DO_JUMP(Fail) {
    │ │ │ -    $SET_I_REL($Fail);
    │ │ │ -    Goto(*I));
    │ │ │ -}
    │ │ │ +DO_JUMP(Fail) {
    │ │ │ +    $SET_I_REL($Fail);
    │ │ │ +    Goto(*I));
    │ │ │ +}
    │ │ │  
    │ │ │  // In beam_emu.c:
    │ │ │  common_jump:
    │ │ │ -   I += I[1];
    │ │ │ -   Goto(*I));

    The $REFRESH_GEN_DEST() macro

    When a specific instruction has a d operand, early during execution │ │ │ + I += I[1]; │ │ │ + Goto(*I));

    The $REFRESH_GEN_DEST() macro

    When a specific instruction has a d operand, early during execution │ │ │ of the instruction, a pointer will be initialized to point to the X or │ │ │ Y register in question.

    If there is a garbage collection before the result is stored, │ │ │ the stack will move and if the d operand referred to a Y │ │ │ register, the pointer will no longer be valid. (Y registers are │ │ │ stored on the stack.)

    In those circumstances, $REFRESH_GEN_DEST() must be invoked │ │ │ to set up the pointer again. beam_makeops will notice │ │ │ if there is a call to a function that does a garbage collection and │ │ │ $REFRESH_GEN_DEST() is not called.

    Here is a complete example. The new_map instruction is defined │ │ │ -like this:

    new_map d t I

    It is implemented like this:

    new_map(Dst, Live, N) {
    │ │ │ +like this:

    new_map d t I

    It is implemented like this:

    new_map(Dst, Live, N) {
    │ │ │      Eterm res;
    │ │ │  
    │ │ │      HEAVY_SWAPOUT;
    │ │ │ -    res = erts_gc_new_map(c_p, reg, $Live, $N, $NEXT_INSTRUCTION);
    │ │ │ +    res = erts_gc_new_map(c_p, reg, $Live, $N, $NEXT_INSTRUCTION);
    │ │ │      HEAVY_SWAPIN;
    │ │ │ -    $REFRESH_GEN_DEST();
    │ │ │ +    $REFRESH_GEN_DEST();
    │ │ │      $Dst = res;
    │ │ │ -    $NEXT($NEXT_INSTRUCTION+$N);
    │ │ │ -}

    If we have forgotten the $REFRESH_GEN_DEST() there would be a message │ │ │ -similar to this:

    pointer to destination register is invalid after GC -- use $REFRESH_GEN_DEST()
    │ │ │ -... from the body of new_map at beam/map_instrs.tab(30)

    Variable number of operands

    Here follows an example of how to handle an instruction with a variable number │ │ │ + $NEXT($NEXT_INSTRUCTION+$N); │ │ │ +}

    If we have forgotten the $REFRESH_GEN_DEST() there would be a message │ │ │ +similar to this:

    pointer to destination register is invalid after GC -- use $REFRESH_GEN_DEST()
    │ │ │ +... from the body of new_map at beam/map_instrs.tab(30)

    Variable number of operands

    Here follows an example of how to handle an instruction with a variable number │ │ │ of operands for the interpreter. Here is the instruction definition in emu/ops.tab:

    put_tuple2 xy I *

    For the interpreter, the * is optional, because it does not effect code generation │ │ │ in any way. However, it is recommended to include it to make it clear for human readers │ │ │ that there is a variable number of operands.

    Use the $NEXT_INSTRUCTION macro to obtain a pointer to the first of the variable │ │ │ -operands.

    Here is the implementation:

    put_tuple2(Dst, Arity) {
    │ │ │ +operands.

    Here is the implementation:

    put_tuple2(Dst, Arity) {
    │ │ │  Eterm* hp = HTOP;
    │ │ │  Eterm arity = $Arity;
    │ │ │ -Eterm* dst_ptr = &($Dst);
    │ │ │ +Eterm* dst_ptr = &($Dst);
    │ │ │  
    │ │ │  //| -no_next
    │ │ │ -ASSERT(arity != 0);
    │ │ │ -*hp++ = make_arityval(arity);
    │ │ │ +ASSERT(arity != 0);
    │ │ │ +*hp++ = make_arityval(arity);
    │ │ │  
    │ │ │  /*
    │ │ │   * The $NEXT_INSTRUCTION macro points just beyond the fixed
    │ │ │   * operands. In this case it points to the descriptor of
    │ │ │   * the first element to be put into the tuple.
    │ │ │   */
    │ │ │  I = $NEXT_INSTRUCTION;
    │ │ │ -do {
    │ │ │ +do {
    │ │ │      Eterm term = *I++;
    │ │ │ -    switch (loader_tag(term)) {
    │ │ │ +    switch (loader_tag(term)) {
    │ │ │      case LOADER_X_REG:
    │ │ │ -    *hp++ = x(loader_x_reg_index(term));
    │ │ │ +    *hp++ = x(loader_x_reg_index(term));
    │ │ │      break;
    │ │ │      case LOADER_Y_REG:
    │ │ │ -    *hp++ = y(loader_y_reg_index(term));
    │ │ │ +    *hp++ = y(loader_y_reg_index(term));
    │ │ │      break;
    │ │ │      default:
    │ │ │      *hp++ = term;
    │ │ │      break;
    │ │ │ -    }
    │ │ │ -} while (--arity != 0);
    │ │ │ -*dst_ptr = make_tuple(HTOP);
    │ │ │ +    }
    │ │ │ +} while (--arity != 0);
    │ │ │ +*dst_ptr = make_tuple(HTOP);
    │ │ │  HTOP = hp;
    │ │ │ -ASSERT(VALID_INSTR(* (Eterm *)I));
    │ │ │ -Goto(*I);
    │ │ │ -}

    Combined instructions

    Problem: For frequently executed instructions we want to use │ │ │ +ASSERT(VALID_INSTR(* (Eterm *)I)); │ │ │ +Goto(*I); │ │ │ +}

    Combined instructions

    Problem: For frequently executed instructions we want to use │ │ │ "fast" operands types such as x and y, as opposed to s or S. │ │ │ To avoid an explosion in code size, we want to share most of the │ │ │ implementation between the instructions. Here are the specific │ │ │ instructions for i_increment/5:

    i_increment r W t d
    │ │ │  i_increment x W t d
    │ │ │ -i_increment y W t d

    The i_increment instruction is implemented like this:

    i_increment(Source, IncrementVal, Live, Dst) {
    │ │ │ +i_increment y W t d

    The i_increment instruction is implemented like this:

    i_increment(Source, IncrementVal, Live, Dst) {
    │ │ │      Eterm increment_reg_source = $Source;
    │ │ │      Eterm increment_val = $IncrementVal;
    │ │ │      Uint live;
    │ │ │      Eterm result;
    │ │ │  
    │ │ │ -    if (ERTS_LIKELY(is_small(increment_reg_val))) {
    │ │ │ -        Sint i = signed_val(increment_reg_val) + increment_val;
    │ │ │ -        if (ERTS_LIKELY(IS_SSMALL(i))) {
    │ │ │ -            $Dst = make_small(i);
    │ │ │ -            $NEXT0();
    │ │ │ -        }
    │ │ │ -    }
    │ │ │ +    if (ERTS_LIKELY(is_small(increment_reg_val))) {
    │ │ │ +        Sint i = signed_val(increment_reg_val) + increment_val;
    │ │ │ +        if (ERTS_LIKELY(IS_SSMALL(i))) {
    │ │ │ +            $Dst = make_small(i);
    │ │ │ +            $NEXT0();
    │ │ │ +        }
    │ │ │ +    }
    │ │ │      live = $Live;
    │ │ │      HEAVY_SWAPOUT;
    │ │ │ -    reg[live] = increment_reg_val;
    │ │ │ -    reg[live+1] = make_small(increment_val);
    │ │ │ -    result = erts_gc_mixed_plus(c_p, reg, live);
    │ │ │ +    reg[live] = increment_reg_val;
    │ │ │ +    reg[live+1] = make_small(increment_val);
    │ │ │ +    result = erts_gc_mixed_plus(c_p, reg, live);
    │ │ │      HEAVY_SWAPIN;
    │ │ │ -    ERTS_HOLE_CHECK(c_p);
    │ │ │ -    if (ERTS_LIKELY(is_value(result))) {
    │ │ │ -        $REFRESH_GEN_DEST();
    │ │ │ +    ERTS_HOLE_CHECK(c_p);
    │ │ │ +    if (ERTS_LIKELY(is_value(result))) {
    │ │ │ +        $REFRESH_GEN_DEST();
    │ │ │          $Dst = result;
    │ │ │ -        $NEXT0();
    │ │ │ -    }
    │ │ │ -    ASSERT(c_p->freason != BADMATCH || is_value(c_p->fvalue));
    │ │ │ +        $NEXT0();
    │ │ │ +    }
    │ │ │ +    ASSERT(c_p->freason != BADMATCH || is_value(c_p->fvalue));
    │ │ │      goto find_func_info;
    │ │ │ -}

    There will be three almost identical copies of the code. Given the │ │ │ +}

    There will be three almost identical copies of the code. Given the │ │ │ size of the code, that could be too high cost to pay.

    To avoid the three copies of the code, we could use only one specific │ │ │ instruction:

    i_increment S W t d

    (The same implementation as above will work.)

    That reduces the code size, but is slower because S means that │ │ │ there will be extra code to test whether the operand refers to an X │ │ │ register or a Y register.

    Solution: We can use "combined instructions". Combined │ │ │ instructions are combined from instruction fragments. The │ │ │ bulk of the code can be shared.

    Here we will show how i_increment can be implemented as a combined │ │ │ instruction. We will show each individual fragment first, and then │ │ │ show how to connect them together. First we will need a variable that │ │ │ -we can store the value fetched from the register in:

    increment.head() {
    │ │ │ +we can store the value fetched from the register in:

    increment.head() {
    │ │ │      Eterm increment_reg_val;
    │ │ │ -}

    The name increment is the name of the group that the fragment │ │ │ +}

    The name increment is the name of the group that the fragment │ │ │ belongs to. Note that it does not need to have the same │ │ │ name as the instruction. The group name is followed by . and │ │ │ the name of the fragment. The name head is pre-defined. │ │ │ The code in it will be placed at the beginning of a block, so │ │ │ that all fragments in the group can access it.

    Next we define the fragment that will pick up the value from the │ │ │ -register from the first operand:

    increment.fetch(Src) {
    │ │ │ +register from the first operand:

    increment.fetch(Src) {
    │ │ │      increment_reg_val = $Src;
    │ │ │ -}

    We call this fragment fetch. This fragment will be duplicated three │ │ │ -times, one for each value of the first operand (r, x, and y).

    Next we define the main part of the code that do the actual incrementing.

    increment.execute(IncrementVal, Live, Dst) {
    │ │ │ +}

    We call this fragment fetch. This fragment will be duplicated three │ │ │ +times, one for each value of the first operand (r, x, and y).

    Next we define the main part of the code that do the actual incrementing.

    increment.execute(IncrementVal, Live, Dst) {
    │ │ │      Eterm increment_val = $IncrementVal;
    │ │ │      Uint live;
    │ │ │      Eterm result;
    │ │ │  
    │ │ │ -    if (ERTS_LIKELY(is_small(increment_reg_val))) {
    │ │ │ -        Sint i = signed_val(increment_reg_val) + increment_val;
    │ │ │ -        if (ERTS_LIKELY(IS_SSMALL(i))) {
    │ │ │ -            $Dst = make_small(i);
    │ │ │ -            $NEXT0();
    │ │ │ -        }
    │ │ │ -    }
    │ │ │ +    if (ERTS_LIKELY(is_small(increment_reg_val))) {
    │ │ │ +        Sint i = signed_val(increment_reg_val) + increment_val;
    │ │ │ +        if (ERTS_LIKELY(IS_SSMALL(i))) {
    │ │ │ +            $Dst = make_small(i);
    │ │ │ +            $NEXT0();
    │ │ │ +        }
    │ │ │ +    }
    │ │ │      live = $Live;
    │ │ │      HEAVY_SWAPOUT;
    │ │ │ -    reg[live] = increment_reg_val;
    │ │ │ -    reg[live+1] = make_small(increment_val);
    │ │ │ -    result = erts_gc_mixed_plus(c_p, reg, live);
    │ │ │ +    reg[live] = increment_reg_val;
    │ │ │ +    reg[live+1] = make_small(increment_val);
    │ │ │ +    result = erts_gc_mixed_plus(c_p, reg, live);
    │ │ │      HEAVY_SWAPIN;
    │ │ │ -    ERTS_HOLE_CHECK(c_p);
    │ │ │ -    if (ERTS_LIKELY(is_value(result))) {
    │ │ │ -        $REFRESH_GEN_DEST();
    │ │ │ +    ERTS_HOLE_CHECK(c_p);
    │ │ │ +    if (ERTS_LIKELY(is_value(result))) {
    │ │ │ +        $REFRESH_GEN_DEST();
    │ │ │          $Dst = result;
    │ │ │ -        $NEXT0();
    │ │ │ -    }
    │ │ │ -    ASSERT(c_p->freason != BADMATCH || is_value(c_p->fvalue));
    │ │ │ +        $NEXT0();
    │ │ │ +    }
    │ │ │ +    ASSERT(c_p->freason != BADMATCH || is_value(c_p->fvalue));
    │ │ │      goto find_func_info;
    │ │ │ -}

    We call this fragment execute. It will handle the three remaining │ │ │ +}

    We call this fragment execute. It will handle the three remaining │ │ │ operands (W t d). There will only be one copy of this fragment.

    Now that we have defined the fragments, we need to inform │ │ │ beam_makeops how they should be connected:

    i_increment := increment.fetch.execute;

    To the left of the := is the name of the specific instruction that │ │ │ should be implemented by the fragments, in this case i_increment. │ │ │ To the right of := is the name of the group with the fragments, │ │ │ followed by a .. Then the name of the fragments in the group are │ │ │ listed in the order they should be executed. Note that the head │ │ │ fragment is not listed.

    The line ends in ; (to avoid messing up the indentation in Emacs).

    (Note that in practice the := line is usually placed before the │ │ │ -fragments.)

    The generated code looks like this:

    {
    │ │ │ +fragments.)

    The generated code looks like this:

    {
    │ │ │    Eterm increment_reg_val;
    │ │ │ -  OpCase(i_increment_rWtd):
    │ │ │ -  {
    │ │ │ -    increment_reg_val = r(0);
    │ │ │ -  }
    │ │ │ +  OpCase(i_increment_rWtd):
    │ │ │ +  {
    │ │ │ +    increment_reg_val = r(0);
    │ │ │ +  }
    │ │ │    goto increment__execute;
    │ │ │  
    │ │ │ -  OpCase(i_increment_xWtd):
    │ │ │ -  {
    │ │ │ -    increment_reg_val = xb(BeamExtraData(I[0]));
    │ │ │ -  }
    │ │ │ +  OpCase(i_increment_xWtd):
    │ │ │ +  {
    │ │ │ +    increment_reg_val = xb(BeamExtraData(I[0]));
    │ │ │ +  }
    │ │ │    goto increment__execute;
    │ │ │  
    │ │ │ -  OpCase(i_increment_yWtd):
    │ │ │ -  {
    │ │ │ -    increment_reg_val = yb(BeamExtraData(I[0]));
    │ │ │ -  }
    │ │ │ +  OpCase(i_increment_yWtd):
    │ │ │ +  {
    │ │ │ +    increment_reg_val = yb(BeamExtraData(I[0]));
    │ │ │ +  }
    │ │ │    goto increment__execute;
    │ │ │  
    │ │ │    increment__execute:
    │ │ │ -  {
    │ │ │ -    // Here follows the code from increment.execute()
    │ │ │ +  {
    │ │ │ +    // Here follows the code from increment.execute()
    │ │ │      .
    │ │ │      .
    │ │ │      .
    │ │ │ -}
    Some notes about combined instructions

    The operands that are different must be at │ │ │ +}

    Some notes about combined instructions

    The operands that are different must be at │ │ │ the beginning of the instruction. All operands in the last │ │ │ fragment must have the same operands in all variants of │ │ │ the specific instruction.

    As an example, the following specific instructions cannot be │ │ │ implemented as a combined instruction:

    i_times j? t x x d
    │ │ │  i_times j? t x y d
    │ │ │  i_times j? t s s d

    We would have to change the order of the operands so that the │ │ │ two operands that are different are placed first:

    i_times x x j? t d
    │ │ │  i_times x y j? t d
    │ │ │  i_times s s j? t d

    We can then define:

    i_times := times.fetch.execute;
    │ │ │  
    │ │ │ -times.head {
    │ │ │ +times.head {
    │ │ │      Eterm op1, op2;
    │ │ │ -}
    │ │ │ +}
    │ │ │  
    │ │ │ -times.fetch(Src1, Src2) {
    │ │ │ +times.fetch(Src1, Src2) {
    │ │ │      op1 = $Src1;
    │ │ │      op2 = $Src2;
    │ │ │ -}
    │ │ │ +}
    │ │ │  
    │ │ │ -times.execute(Fail, Live, Dst) {
    │ │ │ +times.execute(Fail, Live, Dst) {
    │ │ │      // Multiply op1 and op2.
    │ │ │      .
    │ │ │      .
    │ │ │      .
    │ │ │ -}

    Several instructions can share a group. As an example, the following │ │ │ +}

    Several instructions can share a group. As an example, the following │ │ │ instructions have different names, but in the end they all create a │ │ │ binary. The last two operands are common for all of them:

    i_bs_init_fail       xy j? t? x
    │ │ │  i_bs_init_fail_heap s I j? t? x
    │ │ │  i_bs_init                W t? x
    │ │ │  i_bs_init_heap         W I t? x

    The instructions are defined like this (formatted with extra │ │ │ spaces for clarity):

    i_bs_init_fail_heap := bs_init . fail_heap . verify . execute;
    │ │ │  i_bs_init_fail      := bs_init . fail      . verify . execute;
    │ │ │  i_bs_init           := bs_init .           .  plain . execute;
    │ │ │  i_bs_init_heap      := bs_init .               heap . execute;

    Note that the first two instruction have three fragments, while the │ │ │ -other two only have two fragments. Here are the fragments:

    bs_init_bits.head() {
    │ │ │ +other two only have two fragments.  Here are the fragments:

    bs_init_bits.head() {
    │ │ │      Eterm num_bits_term;
    │ │ │      Uint num_bits;
    │ │ │      Uint alloc;
    │ │ │ -}
    │ │ │ +}
    │ │ │  
    │ │ │ -bs_init_bits.plain(NumBits) {
    │ │ │ +bs_init_bits.plain(NumBits) {
    │ │ │      num_bits = $NumBits;
    │ │ │      alloc = 0;
    │ │ │ -}
    │ │ │ +}
    │ │ │  
    │ │ │ -bs_init_bits.heap(NumBits, Alloc) {
    │ │ │ +bs_init_bits.heap(NumBits, Alloc) {
    │ │ │      num_bits = $NumBits;
    │ │ │      alloc = $Alloc;
    │ │ │ -}
    │ │ │ +}
    │ │ │  
    │ │ │ -bs_init_bits.fail(NumBitsTerm) {
    │ │ │ +bs_init_bits.fail(NumBitsTerm) {
    │ │ │      num_bits_term = $NumBitsTerm;
    │ │ │      alloc = 0;
    │ │ │ -}
    │ │ │ +}
    │ │ │  
    │ │ │ -bs_init_bits.fail_heap(NumBitsTerm, Alloc) {
    │ │ │ +bs_init_bits.fail_heap(NumBitsTerm, Alloc) {
    │ │ │      num_bits_term = $NumBitsTerm;
    │ │ │      alloc = $Alloc;
    │ │ │ -}
    │ │ │ +}
    │ │ │  
    │ │ │ -bs_init_bits.verify(Fail) {
    │ │ │ +bs_init_bits.verify(Fail) {
    │ │ │      // Verify the num_bits_term, fail using $FAIL
    │ │ │      // if there is a problem.
    │ │ │  .
    │ │ │  .
    │ │ │  .
    │ │ │ -}
    │ │ │ +}
    │ │ │  
    │ │ │ -bs_init_bits.execute(Live, Dst) {
    │ │ │ +bs_init_bits.execute(Live, Dst) {
    │ │ │     // Long complicated code to a create a binary.
    │ │ │     .
    │ │ │     .
    │ │ │     .
    │ │ │ -}

    The full definitions of those instructions can be found in bs_instrs.tab. │ │ │ +}

    The full definitions of those instructions can be found in bs_instrs.tab. │ │ │ The generated code can be found in beam_warm.h.

    │ │ │ │ │ │ │ │ │ │ │ │ Code generation for BeamAsm │ │ │

    │ │ │

    For the BeamAsm runtime system, the implementation of each instruction is defined │ │ │ by emitter functions written in C++ that emit the assembly code for each instruction. │ │ │ There is one emitter function for each family of specific instructions.

    Take for example the move instruction. In beam/asm/ops.tab there is a │ │ │ -single specific instruction for move defined like this:

    move s d

    The implementation is found in beam/asm/instr_common.cpp:

    void BeamModuleAssembler::emit_move(const ArgVal &Src, const ArgVal &Dst) {
    │ │ │ -    mov_arg(Dst, Src);
    │ │ │ -}

    The mov_arg() helper function will handle all combinations of source and destination │ │ │ -operands. For example, the instruction {move,{x,1},{y,1}} will be translated like this:

    mov rdi, qword [rbx+8]
    │ │ │ -mov qword [rsp+8], rdi

    while {move,{integer,42},{x,0}} will be translated like this:

    mov qword [rbx], 687

    It is possible to define more than one specific instruction, but there will still be │ │ │ +single specific instruction for move defined like this:

    move s d

    The implementation is found in beam/asm/instr_common.cpp:

    void BeamModuleAssembler::emit_move(const ArgVal &Src, const ArgVal &Dst) {
    │ │ │ +    mov_arg(Dst, Src);
    │ │ │ +}

    The mov_arg() helper function will handle all combinations of source and destination │ │ │ +operands. For example, the instruction {move,{x,1},{y,1}} will be translated like this:

    mov rdi, qword [rbx+8]
    │ │ │ +mov qword [rsp+8], rdi

    while {move,{integer,42},{x,0}} will be translated like this:

    mov qword [rbx], 687

    It is possible to define more than one specific instruction, but there will still be │ │ │ only one emitter function. For example:

    fload S l
    │ │ │  fload q l

    By defining fload like this, the source operand must be a X register, Y register, or │ │ │ a literal. If not, the loading will be aborted. If the instruction instead had been │ │ │ defined like this:

    fload s l

    attempting to load an invalid instruction such as {fload,{atom,clearly_bad},{fr,0}} │ │ │ would cause a crash (either at load time or when the instruction was executed).

    Regardless on how many specific instructions there are in the family, │ │ │ -only a single emit_fload() function is allowed:

    void BeamModuleAssembler::emit_fload(const ArgVal &Src, const ArgVal &Dst) {
    │ │ │ +only a single emit_fload() function is allowed:

    void BeamModuleAssembler::emit_fload(const ArgVal &Src, const ArgVal &Dst) {
    │ │ │      .
    │ │ │      .
    │ │ │      .
    │ │ │ -}

    Handling a variable number of operands

    Here follows an example of how an instruction with a variable number │ │ │ +}

    Handling a variable number of operands

    Here follows an example of how an instruction with a variable number │ │ │ of operands could be handled. One such instructions is │ │ │ -select_val/3. Here is an example how it can look like in BEAM code:

    {select_val,{x,0},
    │ │ │ -            {f,1},
    │ │ │ -            {list,[{atom,b},{f,4},{atom,a},{f,5}]}}.

    The loader will convert a {list,[...]} operand to an u operand whose │ │ │ +select_val/3. Here is an example how it can look like in BEAM code:

    {select_val,{x,0},
    │ │ │ +            {f,1},
    │ │ │ +            {list,[{atom,b},{f,4},{atom,a},{f,5}]}}.

    The loader will convert a {list,[...]} operand to an u operand whose │ │ │ value is the number of elements in the list, followed by each element in │ │ │ the list. The instruction above would be translated to the following │ │ │ -instruction:

    {select_val,{x,0},{f,1},{u,4},{atom,b},{f,4},{atom,a},{f,5}}

    A definition of a specific instruction for that instruction would look │ │ │ +instruction:

    {select_val,{x,0},{f,1},{u,4},{atom,b},{f,4},{atom,a},{f,5}}

    A definition of a specific instruction for that instruction would look │ │ │ like this:

    select_val s f I *

    The * as the last operand will make sure that the variable operands │ │ │ are passed in as a Span of ArgVal (will be std::span in C++20 onwards). │ │ │ -Here is the emitter function:

    void BeamModuleAssembler::emit_select_val(const ArgVal &Src,
    │ │ │ +Here is the emitter function:

    void BeamModuleAssembler::emit_select_val(const ArgVal &Src,
    │ │ │                                            const ArgVal &Fail,
    │ │ │                                            const ArgVal &Size,
    │ │ │ -                                          const Span<ArgVal> &args) {
    │ │ │ -    ASSERT(Size.getValue() == args.size());
    │ │ │ +                                          const Span<ArgVal> &args) {
    │ │ │ +    ASSERT(Size.getValue() == args.size());
    │ │ │         .
    │ │ │         .
    │ │ │         .
    │ │ │ -}
    │ │ │ +
    }
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │

    beam_makeops. The transformations │ │ │ used in BeamAsm are much simpler than the interpreter's, as most of the │ │ │ transformations for the interpreter are done only to eliminate the instruction │ │ │ dispatch overhead.

    Then each instruction is encoded using the C++ functions in the │ │ │ -jit/$ARCH/instr_*.cpp files. For example:

    void BeamModuleAssembler::emit_is_nonempty_list(const ArgVal &Fail, const ArgVal &Src) {
    │ │ │ -  a.test(getArgRef(Src), imm(_TAG_PRIMARY_MASK - TAG_PRIMARY_LIST));
    │ │ │ -  a.jne(labels[Fail.getLabel()]);
    │ │ │ -}

    asmjit provides a fairly straightforward │ │ │ +jit/$ARCH/instr_*.cpp files. For example:

    void BeamModuleAssembler::emit_is_nonempty_list(const ArgVal &Fail, const ArgVal &Src) {
    │ │ │ +  a.test(getArgRef(Src), imm(_TAG_PRIMARY_MASK - TAG_PRIMARY_LIST));
    │ │ │ +  a.jne(labels[Fail.getLabel()]);
    │ │ │ +}

    asmjit provides a fairly straightforward │ │ │ mapping from a C++ function call to the x86 assembly instruction. The above │ │ │ instruction tests if the value in the Src register is a non-empty list and if │ │ │ it is not then it jumps to the fail label.

    For comparison, the interpreter has 8 combinations and specializations of │ │ │ this implementation to minimize the instruction dispatch overhead for │ │ │ common patterns.

    The original register allocation done by the Erlang compiler is used to manage the │ │ │ liveness of values and the physical registers are statically allocated to keep │ │ │ the necessary process state. At the moment this is the static register │ │ │ -allocation on x86-64:

    rbx: ErtsSchedulerRegisters struct (contains x/float registers and some metadata)
    │ │ │ +allocation on x86-64:

    rbx: ErtsSchedulerRegisters struct (contains x/float registers and some metadata)
    │ │ │  rbp: Current frame pointer when `perf` support is enabled, otherwise this
    │ │ │       is an optional save slot for the Erlang stack pointer when executing C
    │ │ │       code.
    │ │ │  r12: Active code index
    │ │ │  r13: Current running process
    │ │ │  r14: Remaining reductions
    │ │ │  r15: Erlang heap pointer

    Note that all of these are callee save registers under the System V and Windows │ │ │ @@ -183,21 +183,21 @@ │ │ │ shared and only the arguments to the instructions vary. Using as little memory as │ │ │ possible has many advantages; less memory is used, loading time decreases, │ │ │ higher cache hit-rate.

    In BeamAsm we need to achieve something similar since the load-time of a module │ │ │ scales almost linearly with the amount of memory it uses. Early BeamAsm prototypes │ │ │ used about double the amount of memory for code as the interpreter, while current │ │ │ versions use about 10% more. How was this achieved?

    In BeamAsm we heavily use shared code fragments to try to emit as much code as │ │ │ possible as global shared fragments instead of duplicating the code unnecessarily. │ │ │ -For instance, the return instruction looks something like this:

    Label yield = a.newLabel();
    │ │ │ +For instance, the return instruction looks something like this:

    Label yield = a.newLabel();
    │ │ │  
    │ │ │  /* Decrement reduction counter */
    │ │ │ -a.dec(FCALLS);
    │ │ │ +a.dec(FCALLS);
    │ │ │  /* If FCALLS < 0, jump to the yield-on-return fragment */
    │ │ │ -a.jl(resolve_fragment(ga->get_dispatch_return()));
    │ │ │ -a.ret();

    The code above is not exactly what is emitted, but close enough. The thing to note │ │ │ +a.jl(resolve_fragment(ga->get_dispatch_return())); │ │ │ +a.ret();

    The code above is not exactly what is emitted, but close enough. The thing to note │ │ │ is that the code for doing the context switch is never emitted. Instead, we jump │ │ │ to a global fragment that all return instructions share. This greatly reduces │ │ │ the amount of code that has to be emitted for each module.

    │ │ │ │ │ │ │ │ │ │ │ │ Running Erlang code │ │ │ @@ -239,43 +239,43 @@ │ │ │ │ │ │ │ │ │ │ │ │ Running C code │ │ │

    │ │ │

    As Erlang stacks can be very small, we have to switch over to a different stack │ │ │ when we need to execute C code (which may expect a much larger stack). This is │ │ │ -done through emit_enter_runtime and emit_leave_runtime, for example:

    mov_arg(ARG4, NumFree);
    │ │ │ +done through emit_enter_runtime and emit_leave_runtime, for example:

    mov_arg(ARG4, NumFree);
    │ │ │  
    │ │ │  /* Move to the C stack and swap out our current reductions, stack-, and
    │ │ │   * heap pointer to the process structure. */
    │ │ │ -emit_enter_runtime<Update::eReductions | Update::eStack | Update::eHeap>();
    │ │ │ +emit_enter_runtime<Update::eReductions | Update::eStack | Update::eHeap>();
    │ │ │  
    │ │ │ -a.mov(ARG1, c_p);
    │ │ │ -load_x_reg_array(ARG2);
    │ │ │ -make_move_patch(ARG3, lambdas[Fun.getValue()].patches);
    │ │ │ +a.mov(ARG1, c_p);
    │ │ │ +load_x_reg_array(ARG2);
    │ │ │ +make_move_patch(ARG3, lambdas[Fun.getValue()].patches);
    │ │ │  
    │ │ │  /* Call `new_fun`, asserting that we're on the C stack. */
    │ │ │ -runtime_call<4>(new_fun);
    │ │ │ +runtime_call<4>(new_fun);
    │ │ │  
    │ │ │  /* Move back to the C stack, and read the updated values from the process
    │ │ │   * structure */
    │ │ │ -emit_leave_runtime<Update::eReductions | Update::eStack | Update::eHeap>();
    │ │ │ +emit_leave_runtime<Update::eReductions | Update::eStack | Update::eHeap>();
    │ │ │  
    │ │ │ -a.mov(getXRef(0), RET);

    All combinations of the Update constants are legal, but the ones given to │ │ │ +a.mov(getXRef(0), RET);

    All combinations of the Update constants are legal, but the ones given to │ │ │ emit_leave_runtime must be the same as those given to emit_enter_runtime.

    │ │ │ │ │ │ │ │ │ │ │ │ Tracing and NIF Loading │ │ │

    │ │ │

    To make tracing and NIF loading work there needs to be a way to intercept │ │ │ any function call. In the interpreter, this is done by rewriting the loaded │ │ │ BEAM code, but this is more complicated in BeamAsm as we want to have a fast │ │ │ and compact way to do this. This is solved by emitting the code below at the │ │ │ -start of each function (x86 variant below):

      0x0: short jmp 6 (address 0x8)
    │ │ │ +start of each function (x86 variant below):

      0x0: short jmp 6 (address 0x8)
    │ │ │    0x2: nop
    │ │ │    0x3: relative near call to shared breakpoint fragment
    │ │ │    0x8: actual code for function

    When code starts to execute it will simply see the short jmp 6 instruction │ │ │ which skips the prologue and starts to execute the code directly.

    When we want to enable a certain breakpoint we set the jmp target to be 1, │ │ │ which means it will land on the call to the shared breakpoint fragment. This │ │ │ fragment checks the current breakpoint_flag stored in the ErtsCodeInfo of │ │ │ this function, and then calls erts_call_nif_early and │ │ │ @@ -289,31 +289,31 @@ │ │ │ Updating code │ │ │ │ │ │

    Because many environments enforce W^X it's not always possible to write │ │ │ directly to the code pages. Because of this we map code twice: once with an │ │ │ executable page and once with a writable page. Since they're backed by the │ │ │ same memory, writes to the writable page appear magically in the executable │ │ │ one.

    The erts_writable_code_ptr function can be used to get writable pointers │ │ │ -given a module instance, provided that it has been unsealed first:

    for (i = 0; i < n; i++) {
    │ │ │ +given a module instance, provided that it has been unsealed first:

    for (i = 0; i < n; i++) {
    │ │ │      const ErtsCodeInfo* ci_exec;
    │ │ │      ErtsCodeInfo* ci_rw;
    │ │ │      void *w_ptr;
    │ │ │  
    │ │ │ -    erts_unseal_module(&modp->curr);
    │ │ │ +    erts_unseal_module(&modp->curr);
    │ │ │  
    │ │ │ -    ci_exec = code_hdr->functions[i];
    │ │ │ -    w_ptr = erts_writable_code_ptr(&modp->curr, ci_exec);
    │ │ │ -    ci_rw = (ErtsCodeInfo*)w_ptr;
    │ │ │ +    ci_exec = code_hdr->functions[i];
    │ │ │ +    w_ptr = erts_writable_code_ptr(&modp->curr, ci_exec);
    │ │ │ +    ci_rw = (ErtsCodeInfo*)w_ptr;
    │ │ │  
    │ │ │ -    uninstall_breakpoint(ci_rw, ci_exec);
    │ │ │ -    consolidate_bp_data(modp, ci_rw, 1);
    │ │ │ -    ASSERT(ci_rw->gen_bp == NULL);
    │ │ │ +    uninstall_breakpoint(ci_rw, ci_exec);
    │ │ │ +    consolidate_bp_data(modp, ci_rw, 1);
    │ │ │ +    ASSERT(ci_rw->gen_bp == NULL);
    │ │ │  
    │ │ │ -    erts_seal_module(&modp->curr);
    │ │ │ -}

    Without the module instance there's no reliable way to figure out the writable │ │ │ + erts_seal_module(&modp->curr); │ │ │ +}

    Without the module instance there's no reliable way to figure out the writable │ │ │ address of a code page, and we rely on address space layout randomization │ │ │ (ASLR) to make it difficult to guess. On some platforms, security is further │ │ │ enhanced by protecting the writable area from writes until the module has been │ │ │ unsealed by erts_unseal_module.

    │ │ │ │ │ │ │ │ │ │ │ │ @@ -393,15 +393,15 @@ │ │ │ perf script > out.perf │ │ │ ## run stackcollapse │ │ │ stackcollapse-perf.pl out.perf > out.folded │ │ │ ## Create the svg │ │ │ flamegraph.pl out.folded > out.svg

    We get a graph that would look something like this:

    Linux Perf FlameGraph: dialyzer PLT build

    You can view a larger version here. It contains │ │ │ the same information, but it is easier to share with others as it does │ │ │ not need the symbols in the executable.

    Using the same data we can also produce a graph where the scheduler profile data │ │ │ -has been merged by using sed:

    ## Strip [0-9]+_ and/or _[0-9]+ from all scheduler names
    │ │ │ +has been merged by using sed:

    ## Strip [0-9]+_ and/or _[0-9]+ from all scheduler names
    │ │ │  ## scheduler names changed in OTP26, hence two expressions
    │ │ │  sed -e 's/^[0-9]\+_//' -e 's/^erts_\([^_]\+\)_[0-9]\+/erts_\1/' out.folded > out.folded_sched
    │ │ │  ## Create the svg
    │ │ │  flamegraph.pl out.folded_sched > out_sched.svg

    Linux Perf FlameGraph: dialyzer PLT build

    You can view a larger version here. │ │ │ There are many different transformations that you can do to make the graph show │ │ │ you what you want.

    │ │ │ │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/codeloading.html │ │ │ @@ -163,16 +163,16 @@ │ │ │ only be done by one loader process at a time. A second loader process │ │ │ trying to enter finishing phase will be suspended until the first │ │ │ loader is done. This will only block the process, the scheduler is │ │ │ free to schedule other work while the second loader is waiting. (See │ │ │ erts_try_seize_code_load_permission and │ │ │ erts_release_code_load_permission).

    The ability to prepare several modules in parallel is not currently │ │ │ used as almost all code loading is serialized by the code_server │ │ │ -process. The BIF interface is however prepared for this.

      erlang:prepare_loading(Module, Code) -> LoaderState
    │ │ │ -  erlang:finish_loading([LoaderState])

    The idea is that prepare_loading could be called in parallel for │ │ │ +process. The BIF interface is however prepared for this.

      erlang:prepare_loading(Module, Code) -> LoaderState
    │ │ │ +  erlang:finish_loading([LoaderState])

    The idea is that prepare_loading could be called in parallel for │ │ │ different modules and returns a "magic binary" containing the internal │ │ │ state of each prepared module. Function finish_loading could take a │ │ │ list of such states and do the finishing of all of them in one go.

    Currently we use the legacy BIF erlang:load_module which is now │ │ │ implemented in Erlang by calling the above two functions in │ │ │ sequence. Function finish_loading is limited to only accepts a list │ │ │ with one module state as we do not yet use the multi module loading │ │ │ feature.

    │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/crash_dump.html │ │ │ @@ -401,21 +401,21 @@ │ │ │ put/2 and get/1 thing) is non-empty.

    The raw memory information can be decoded by the Crashdump Viewer tool. You can │ │ │ then see the stack dump, the message queue (if any), and the dictionary (if │ │ │ any).

    The stack dump is a dump of the Erlang process stack. Most of the live data │ │ │ (that is, variables currently in use) are placed on the stack; thus this can be │ │ │ interesting. One has to "guess" what is what, but as the information is │ │ │ symbolic, thorough reading of this information can be useful. As an example, we │ │ │ can find the state variable of the Erlang primitive loader online (5) and │ │ │ -(6) in the following example:

    (1)  3cac44   Return addr 0x13BF58 (<terminate process normally>)
    │ │ │ -(2)  y(0)     ["/view/siri_r10_dev/clearcase/otp/erts/lib/kernel/ebin",
    │ │ │ -(3)            "/view/siri_r10_dev/clearcase/otp/erts/lib/stdlib/ebin"]
    │ │ │ -(4)  y(1)     <0.1.0>
    │ │ │ -(5)  y(2)     {state,[],none,#Fun<erl_prim_loader.6.7085890>,undefined,#Fun<erl_prim_loader.7.9000327>,
    │ │ │ -(6)            #Fun<erl_prim_loader.8.116480692>,#Port<0.2>,infinity,#Fun<erl_prim_loader.9.10708760>}
    │ │ │ -(7)  y(3)     infinity

    When interpreting the data for a process, it is helpful to know that anonymous │ │ │ +(6) in the following example:

    (1)  3cac44   Return addr 0x13BF58 (<terminate process normally>)
    │ │ │ +(2)  y(0)     ["/view/siri_r10_dev/clearcase/otp/erts/lib/kernel/ebin",
    │ │ │ +(3)            "/view/siri_r10_dev/clearcase/otp/erts/lib/stdlib/ebin"]
    │ │ │ +(4)  y(1)     <0.1.0>
    │ │ │ +(5)  y(2)     {state,[],none,#Fun<erl_prim_loader.6.7085890>,undefined,#Fun<erl_prim_loader.7.9000327>,
    │ │ │ +(6)            #Fun<erl_prim_loader.8.116480692>,#Port<0.2>,infinity,#Fun<erl_prim_loader.9.10708760>}
    │ │ │ +(7)  y(3)     infinity

    When interpreting the data for a process, it is helpful to know that anonymous │ │ │ function objects (funs) are given the following:

    • A name constructed from the name of the function in which they are created
    • A number (starting with 0) indicating the number of that fun within that │ │ │ function

    │ │ │ │ │ │ │ │ │ │ │ │ Atoms │ │ │

    │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/driver.html │ │ │ @@ -364,41 +364,41 @@ │ │ │

    Before a driver can be called from Erlang, it must be loaded and opened. Loading │ │ │ is done using the erl_ddll module (the erl_ddll driver that loads dynamic │ │ │ driver is actually a driver itself). If loading is successful, the port can be │ │ │ opened with open_port/2. The port name must match the name of │ │ │ the shared library and the name in the driver entry structure.

    When the port has been opened, the driver can be called. In the pg_sync │ │ │ example, we do not have any data from the port, only the return value from the │ │ │ port_control/3.

    The following code is the Erlang part of the synchronous postgres driver, │ │ │ -pg_sync.erl:

    -module(pg_sync).
    │ │ │ +pg_sync.erl:

    -module(pg_sync).
    │ │ │  
    │ │ │ --define(DRV_CONNECT, 1).
    │ │ │ --define(DRV_DISCONNECT, 2).
    │ │ │ --define(DRV_SELECT, 3).
    │ │ │ +-define(DRV_CONNECT, 1).
    │ │ │ +-define(DRV_DISCONNECT, 2).
    │ │ │ +-define(DRV_SELECT, 3).
    │ │ │  
    │ │ │ --export([connect/1, disconnect/1, select/2]).
    │ │ │ +-export([connect/1, disconnect/1, select/2]).
    │ │ │  
    │ │ │ -connect(ConnectStr) ->
    │ │ │ -    case erl_ddll:load_driver(".", "pg_sync") of
    │ │ │ +connect(ConnectStr) ->
    │ │ │ +    case erl_ddll:load_driver(".", "pg_sync") of
    │ │ │          ok -> ok;
    │ │ │ -        {error, already_loaded} -> ok;
    │ │ │ -        E -> exit({error, E})
    │ │ │ +        {error, already_loaded} -> ok;
    │ │ │ +        E -> exit({error, E})
    │ │ │      end,
    │ │ │ -    Port = open_port({spawn, ?MODULE}, []),
    │ │ │ -    case binary_to_term(port_control(Port, ?DRV_CONNECT, ConnectStr)) of
    │ │ │ -        ok -> {ok, Port};
    │ │ │ +    Port = open_port({spawn, ?MODULE}, []),
    │ │ │ +    case binary_to_term(port_control(Port, ?DRV_CONNECT, ConnectStr)) of
    │ │ │ +        ok -> {ok, Port};
    │ │ │          Error -> Error
    │ │ │      end.
    │ │ │  
    │ │ │ -disconnect(Port) ->
    │ │ │ -    R = binary_to_term(port_control(Port, ?DRV_DISCONNECT, "")),
    │ │ │ -    port_close(Port),
    │ │ │ +disconnect(Port) ->
    │ │ │ +    R = binary_to_term(port_control(Port, ?DRV_DISCONNECT, "")),
    │ │ │ +    port_close(Port),
    │ │ │      R.
    │ │ │  
    │ │ │ -select(Port, Query) ->
    │ │ │ -    binary_to_term(port_control(Port, ?DRV_SELECT, Query)).

    The API is simple:

    • connect/1 loads the driver, opens it, and logs on to the database, returning │ │ │ +select(Port, Query) -> │ │ │ + binary_to_term(port_control(Port, ?DRV_SELECT, Query)).

    The API is simple:

    • connect/1 loads the driver, opens it, and logs on to the database, returning │ │ │ the Erlang port if successful.
    • select/2 sends a query to the driver and returns the result.
    • disconnect/1 closes the database connection and the driver. (However, it │ │ │ does not unload it.)

    The connection string is to be a connection string for postgres.

    The driver is loaded with erl_ddll:load_driver/2. If this is successful, or if │ │ │ it is already loaded, it is opened. This will call the start function in the │ │ │ driver.

    We use the port_control/3 function for all calls into the │ │ │ driver. The result from the driver is returned immediately and converted to │ │ │ terms by calling binary_to_term/1. (We trust that the │ │ │ terms returned from the driver are well-formed, otherwise the binary_to_term/1 │ │ │ @@ -536,51 +536,51 @@ │ │ │ successful, or error if it is not. If the connection is not yet established, we │ │ │ simply return; ready_io is called again.

    If we have a result from a connect, indicated by having data in the x buffer, │ │ │ we no longer need to select on output (ready_output), so we remove this by │ │ │ calling driver_select.

    If we are not connecting, we wait for results from a PQsendQuery, so we get │ │ │ the result and return it. The encoding is done with the same functions as in the │ │ │ earlier example.

    Error handling is to be added here, for example, checking that the socket is │ │ │ still open, but this is only a simple example.

    The Erlang part of the asynchronous driver consists of the sample file │ │ │ -pg_async.erl.

    -module(pg_async).
    │ │ │ +pg_async.erl.

    -module(pg_async).
    │ │ │  
    │ │ │ --define(DRV_CONNECT, $C).
    │ │ │ --define(DRV_DISCONNECT, $D).
    │ │ │ --define(DRV_SELECT, $S).
    │ │ │ +-define(DRV_CONNECT, $C).
    │ │ │ +-define(DRV_DISCONNECT, $D).
    │ │ │ +-define(DRV_SELECT, $S).
    │ │ │  
    │ │ │ --export([connect/1, disconnect/1, select/2]).
    │ │ │ +-export([connect/1, disconnect/1, select/2]).
    │ │ │  
    │ │ │ -connect(ConnectStr) ->
    │ │ │ -    case erl_ddll:load_driver(".", "pg_async") of
    │ │ │ +connect(ConnectStr) ->
    │ │ │ +    case erl_ddll:load_driver(".", "pg_async") of
    │ │ │          ok -> ok;
    │ │ │ -        {error, already_loaded} -> ok;
    │ │ │ -        _ -> exit({error, could_not_load_driver})
    │ │ │ +        {error, already_loaded} -> ok;
    │ │ │ +        _ -> exit({error, could_not_load_driver})
    │ │ │      end,
    │ │ │ -    Port = open_port({spawn, ?MODULE}, [binary]),
    │ │ │ -    port_control(Port, ?DRV_CONNECT, ConnectStr),
    │ │ │ -    case return_port_data(Port) of
    │ │ │ +    Port = open_port({spawn, ?MODULE}, [binary]),
    │ │ │ +    port_control(Port, ?DRV_CONNECT, ConnectStr),
    │ │ │ +    case return_port_data(Port) of
    │ │ │          ok ->
    │ │ │ -            {ok, Port};
    │ │ │ +            {ok, Port};
    │ │ │          Error ->
    │ │ │              Error
    │ │ │      end.
    │ │ │  
    │ │ │ -disconnect(Port) ->
    │ │ │ -    port_control(Port, ?DRV_DISCONNECT, ""),
    │ │ │ -    R = return_port_data(Port),
    │ │ │ -    port_close(Port),
    │ │ │ +disconnect(Port) ->
    │ │ │ +    port_control(Port, ?DRV_DISCONNECT, ""),
    │ │ │ +    R = return_port_data(Port),
    │ │ │ +    port_close(Port),
    │ │ │      R.
    │ │ │  
    │ │ │ -select(Port, Query) ->
    │ │ │ -    port_control(Port, ?DRV_SELECT, Query),
    │ │ │ -    return_port_data(Port).
    │ │ │ +select(Port, Query) ->
    │ │ │ +    port_control(Port, ?DRV_SELECT, Query),
    │ │ │ +    return_port_data(Port).
    │ │ │  
    │ │ │ -return_port_data(Port) ->
    │ │ │ +return_port_data(Port) ->
    │ │ │      receive
    │ │ │ -        {Port, {data, Data}} ->
    │ │ │ -            binary_to_term(Data)
    │ │ │ +        {Port, {data, Data}} ->
    │ │ │ +            binary_to_term(Data)
    │ │ │      end.

    The Erlang code is slightly different, as we do not return the result │ │ │ synchronously from port_control/3, instead we get it from driver_output as │ │ │ data in the message queue. The function return_port_data above receives data │ │ │ from the port. As the data is in binary format, we use │ │ │ binary_to_term/1 to convert it to an Erlang term. Notice │ │ │ that the driver is opened in binary mode (open_port/2 is │ │ │ called with option [binary]). This means that data sent from the driver to the │ │ │ @@ -677,59 +677,59 @@ │ │ │ *rp++ = ERL_DRV_LIST; │ │ │ *rp++ = n+1; │ │ │ driver_output_term(port, result, result_n); │ │ │ delete[] result; │ │ │ delete d; │ │ │ }

    This driver is called like the others from Erlang. However, as we use │ │ │ driver_output_term, there is no need to call binary_to_term/1. The Erlang code │ │ │ -is in the sample file next_perm.erl.

    The input is changed into a list of integers and sent to the driver.

    -module(next_perm).
    │ │ │ +is in the sample file next_perm.erl.

    The input is changed into a list of integers and sent to the driver.

    -module(next_perm).
    │ │ │  
    │ │ │ --export([next_perm/1, prev_perm/1, load/0, all_perm/1]).
    │ │ │ +-export([next_perm/1, prev_perm/1, load/0, all_perm/1]).
    │ │ │  
    │ │ │ -load() ->
    │ │ │ -    case whereis(next_perm) of
    │ │ │ +load() ->
    │ │ │ +    case whereis(next_perm) of
    │ │ │          undefined ->
    │ │ │ -            case erl_ddll:load_driver(".", "next_perm") of
    │ │ │ +            case erl_ddll:load_driver(".", "next_perm") of
    │ │ │                  ok -> ok;
    │ │ │ -                {error, already_loaded} -> ok;
    │ │ │ -                E -> exit(E)
    │ │ │ +                {error, already_loaded} -> ok;
    │ │ │ +                E -> exit(E)
    │ │ │              end,
    │ │ │ -            Port = open_port({spawn, "next_perm"}, []),
    │ │ │ -            register(next_perm, Port);
    │ │ │ +            Port = open_port({spawn, "next_perm"}, []),
    │ │ │ +            register(next_perm, Port);
    │ │ │          _ ->
    │ │ │              ok
    │ │ │      end.
    │ │ │  
    │ │ │ -list_to_integer_binaries(L) ->
    │ │ │ -    [<<I:32/integer-native>> || I <- L].
    │ │ │ +list_to_integer_binaries(L) ->
    │ │ │ +    [<<I:32/integer-native>> || I <- L].
    │ │ │  
    │ │ │ -next_perm(L) ->
    │ │ │ -    next_perm(L, 1).
    │ │ │ +next_perm(L) ->
    │ │ │ +    next_perm(L, 1).
    │ │ │  
    │ │ │ -prev_perm(L) ->
    │ │ │ -    next_perm(L, 2).
    │ │ │ +prev_perm(L) ->
    │ │ │ +    next_perm(L, 2).
    │ │ │  
    │ │ │ -next_perm(L, Nxt) ->
    │ │ │ -    load(),
    │ │ │ -    B = list_to_integer_binaries(L),
    │ │ │ -    port_control(next_perm, Nxt, B),
    │ │ │ +next_perm(L, Nxt) ->
    │ │ │ +    load(),
    │ │ │ +    B = list_to_integer_binaries(L),
    │ │ │ +    port_control(next_perm, Nxt, B),
    │ │ │      receive
    │ │ │          Result ->
    │ │ │              Result
    │ │ │      end.
    │ │ │  
    │ │ │ -all_perm(L) ->
    │ │ │ -    New = prev_perm(L),
    │ │ │ -    all_perm(New, L, [New]).
    │ │ │ +all_perm(L) ->
    │ │ │ +    New = prev_perm(L),
    │ │ │ +    all_perm(New, L, [New]).
    │ │ │  
    │ │ │ -all_perm(L, L, Acc) ->
    │ │ │ +all_perm(L, L, Acc) ->
    │ │ │      Acc;
    │ │ │ -all_perm(L, Orig, Acc) ->
    │ │ │ -    New = prev_perm(L),
    │ │ │ -    all_perm(New, Orig, [New | Acc]).
    │ │ │ +
    all_perm(L, Orig, Acc) -> │ │ │ + New = prev_perm(L), │ │ │ + all_perm(New, Orig, [New | Acc]).
    │ │ │

    │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │ init.

    The init process itself interprets some of these flags, the init flags. It │ │ │ also stores any remaining flags, the user flags. The latter can be retrieved │ │ │ by calling init:get_argument/1.

    A small number of "-" flags exist, which now actually are emulator flags, see │ │ │ the description below.

  • Plain arguments are not interpreted in any way. They are also stored by the │ │ │ init process and can be retrieved by calling init:get_plain_arguments/0. │ │ │ Plain arguments can occur before the first flag, or after a -- flag. Also, │ │ │ the -extra flag causes everything that follows to become plain arguments.

  • Examples:

    % erl +W w -sname arnie +R 9 -s my_init -extra +bertie
    │ │ │ -(arnie@host)1> init:get_argument(sname).
    │ │ │ -{ok,[["arnie"]]}
    │ │ │ -(arnie@host)2> init:get_plain_arguments().
    │ │ │ -["+bertie"]

    Here +W w and +R 9 are emulator flags. -s my_init is an init flag, │ │ │ +(arnie@host)1> init:get_argument(sname). │ │ │ +{ok,[["arnie"]]} │ │ │ +(arnie@host)2> init:get_plain_arguments(). │ │ │ +["+bertie"]

    Here +W w and +R 9 are emulator flags. -s my_init is an init flag, │ │ │ interpreted by init. -sname arnie is a user flag, stored by init. It is │ │ │ read by Kernel and causes the Erlang runtime system to become distributed. │ │ │ Finally, everything after -extra (that is, +bertie) is considered as plain │ │ │ arguments.

    % erl -myflag 1
    │ │ │ -1> init:get_argument(myflag).
    │ │ │ -{ok,[["1"]]}
    │ │ │ -2> init:get_plain_arguments().
    │ │ │ -[]

    Here the user flag -myflag 1 is passed to and stored by the init process. It │ │ │ +1> init:get_argument(myflag). │ │ │ +{ok,[["1"]]} │ │ │ +2> init:get_plain_arguments(). │ │ │ +[]

    Here the user flag -myflag 1 is passed to and stored by the init process. It │ │ │ is a user-defined flag, presumably used by some user-defined application.

    │ │ │ │ │ │ │ │ │ │ │ │ Flags │ │ │

    │ │ │

    In the following list, init flags are marked "(init flag)". Unless otherwise │ │ │ @@ -700,15 +700,15 @@ │ │ │ processes) into a smaller set of schedulers when schedulers frequently run │ │ │ out of work. When disabled, the frequency with which schedulers run out of │ │ │ work is not taken into account by the load balancing logic.

    +scl false is similar to +sub true, but +sub true │ │ │ also balances scheduler utilization between schedulers.

  • +sct CpuTopology - Sets a user-defined CPU topology. │ │ │ The user-defined CPU topology overrides │ │ │ any automatically detected CPU topology. The CPU topology is used when │ │ │ binding schedulers to logical processors. This option must be before │ │ │ -+sbt on the command-line.

    <Id> = integer(); when 0 =< <Id> =< 65535
    │ │ │ ++sbt on the command-line.

    <Id> = integer(); when 0 =< <Id> =< 65535
    │ │ │  <IdRange> = <Id>-<Id>
    │ │ │  <IdOrIdRange> = <Id> | <IdRange>
    │ │ │  <IdList> = <IdOrIdRange>,<IdOrIdRange> | <IdOrIdRange>
    │ │ │  <LogicalIds> = L<IdList>
    │ │ │  <ThreadIds> = T<IdList> | t<IdList>
    │ │ │  <CoreIds> = C<IdList> | c<IdList>
    │ │ │  <ProcessorIds> = P<IdList> | p<IdList>
    │ │ │ @@ -733,30 +733,30 @@
    │ │ │  node.
  • <LogicalIds><ThreadIds><CoreIds><NodeIds><ProcessorIds>, that is, thread │ │ │ is part of a core that is part of a NUMA node, which is part of a │ │ │ processor.
  • A CPU topology can consist of both processor external, and processor │ │ │ internal NUMA nodes as long as each logical processor belongs to only one │ │ │ NUMA node. If <ProcessorIds> is omitted, its default position is before │ │ │ <NodeIds>. That is, the default is processor external NUMA nodes.

    If a list of identifiers is used in an <IdDefs>:

    • <LogicalIds> must be a list of identifiers.
    • At least one other identifier type besides <LogicalIds> must also have a │ │ │ list of identifiers.
    • All lists of identifiers must produce the same number of identifiers.

    A simple example. A single quad core processor can be described as follows:

    % erl +sct L0-3c0-3
    │ │ │ -1> erlang:system_info(cpu_topology).
    │ │ │ -[{processor,[{core,{logical,0}},
    │ │ │ -             {core,{logical,1}},
    │ │ │ -             {core,{logical,2}},
    │ │ │ -             {core,{logical,3}}]}]

    A more complicated example with two quad core processors, each processor in │ │ │ +1> erlang:system_info(cpu_topology). │ │ │ +[{processor,[{core,{logical,0}}, │ │ │ + {core,{logical,1}}, │ │ │ + {core,{logical,2}}, │ │ │ + {core,{logical,3}}]}]

    A more complicated example with two quad core processors, each processor in │ │ │ its own NUMA node. The ordering of logical processors is a bit weird. This │ │ │ to give a better example of identifier lists:

    % erl +sct L0-1,3-2c0-3p0N0:L7,4,6-5c0-3p1N1
    │ │ │ -1> erlang:system_info(cpu_topology).
    │ │ │ -[{node,[{processor,[{core,{logical,0}},
    │ │ │ -                    {core,{logical,1}},
    │ │ │ -                    {core,{logical,3}},
    │ │ │ -                    {core,{logical,2}}]}]},
    │ │ │ - {node,[{processor,[{core,{logical,7}},
    │ │ │ -                    {core,{logical,4}},
    │ │ │ -                    {core,{logical,6}},
    │ │ │ -                    {core,{logical,5}}]}]}]

    As long as real identifiers are correct, it is OK to pass a CPU topology │ │ │ +1> erlang:system_info(cpu_topology). │ │ │ +[{node,[{processor,[{core,{logical,0}}, │ │ │ + {core,{logical,1}}, │ │ │ + {core,{logical,3}}, │ │ │ + {core,{logical,2}}]}]}, │ │ │ + {node,[{processor,[{core,{logical,7}}, │ │ │ + {core,{logical,4}}, │ │ │ + {core,{logical,6}}, │ │ │ + {core,{logical,5}}]}]}]

    As long as real identifiers are correct, it is OK to pass a CPU topology │ │ │ that is not a correct description of the CPU topology. When used with care │ │ │ this can be very useful. This to trick the emulator to bind its schedulers │ │ │ as you want. For example, if you want to run multiple Erlang runtime systems │ │ │ on the same machine, you want to reduce the number of schedulers used and │ │ │ manipulate the CPU topology so that they bind to different logical CPUs. An │ │ │ example, with two Erlang runtime systems on a quad core machine:

    % erl +sct L0-3c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname one
    │ │ │  % erl +sct L3-0c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname two

    In this example, each runtime system have two schedulers each online, and │ │ │ @@ -923,18 +923,18 @@ │ │ │ │ │ │

    The standard Erlang/OTP system can be reconfigured to change the default │ │ │ behavior on startup.

    • The .erlang startup file - When Erlang/OTP is started, the system │ │ │ searches for a file named .erlang in the │ │ │ user's home directory and then │ │ │ filename:basedir(user_config, "erlang").

      If an .erlang file is found, it is assumed to contain valid Erlang │ │ │ expressions. These expressions are evaluated as if they were input to the │ │ │ -shell.

      A typical .erlang file contains a set of search paths, for example:

      io:format("executing user profile in $HOME/.erlang\n",[]).
      │ │ │ -code:add_path("/home/calvin/test/ebin").
      │ │ │ -code:add_path("/home/hobbes/bigappl-1.2/ebin").
      │ │ │ -io:format(".erlang rc finished\n",[]).
    • user_default and shell_default - Functions in the shell that are not │ │ │ +shell.

      A typical .erlang file contains a set of search paths, for example:

      io:format("executing user profile in $HOME/.erlang\n",[]).
      │ │ │ +code:add_path("/home/calvin/test/ebin").
      │ │ │ +code:add_path("/home/hobbes/bigappl-1.2/ebin").
      │ │ │ +io:format(".erlang rc finished\n",[]).
    • user_default and shell_default - Functions in the shell that are not │ │ │ prefixed by a module name are assumed to be functional objects (funs), │ │ │ built-in functions (BIFs), or belong to the module user_default or │ │ │ shell_default.

      To include private shell commands, define them in a module user_default and │ │ │ add the following argument as the first line in the .erlang file:

      code:load_abs("..../user_default").
    • erl - If the contents of .erlang are changed and a private version of │ │ │ user_default is defined, the Erlang/OTP environment can be customized. More │ │ │ powerful changes can be made by supplying command-line arguments in the │ │ │ startup script erl. For more information, see init.

    │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/erl_dist_protocol.html │ │ │ @@ -252,32 +252,32 @@ │ │ │ --- │ │ │ sequenceDiagram │ │ │ participant client as Client (or Node) │ │ │ participant EPMD │ │ │ │ │ │ client ->> EPMD: NAMES_REQ │ │ │ EPMD -->> client: NAMES_RESP

    1
    110

    Table: NAMES_REQ (110)

    The response for a NAMES_REQ is as follows:

    4
    EPMDPortNoNodeInfo*

    Table: NAMES_RESP

    NodeInfo is a string written for each active node. When all NodeInfo has │ │ │ -been written the connection is closed by the EPMD.

    NodeInfo is, as expressed in Erlang:

    io:format("name ~ts at port ~p~n", [NodeName, Port]).

    │ │ │ +been written the connection is closed by the EPMD.

    NodeInfo is, as expressed in Erlang:

    io:format("name ~ts at port ~p~n", [NodeName, Port]).

    │ │ │ │ │ │ │ │ │ │ │ │ Dump All Data from EPMD │ │ │

    │ │ │

    This request is not really used, it is to be regarded as a debug feature.

    ---
    │ │ │  title: Dump All Data from EPMD
    │ │ │  ---
    │ │ │  sequenceDiagram
    │ │ │      participant client as Client (or Node)
    │ │ │      participant EPMD
    │ │ │      
    │ │ │      client ->> EPMD: DUMP_REQ
    │ │ │      EPMD -->> client: DUMP_RESP
    1
    100

    Table: DUMP_REQ

    The response for a DUMP_REQ is as follows:

    4
    EPMDPortNoNodeInfo*

    Table: DUMP_RESP

    NodeInfo is a string written for each node kept in the EPMD. When all │ │ │ -NodeInfo has been written the connection is closed by the EPMD.

    NodeInfo is, as expressed in Erlang:

    io:format("active name     ~ts at port ~p, fd = ~p~n",
    │ │ │ -          [NodeName, Port, Fd]).

    or

    io:format("old/unused name ~ts at port ~p, fd = ~p ~n",
    │ │ │ -          [NodeName, Port, Fd]).

    │ │ │ +NodeInfo has been written the connection is closed by the EPMD.

    NodeInfo is, as expressed in Erlang:

    io:format("active name     ~ts at port ~p, fd = ~p~n",
    │ │ │ +          [NodeName, Port, Fd]).

    or

    io:format("old/unused name ~ts at port ~p, fd = ~p ~n",
    │ │ │ +          [NodeName, Port, Fd]).

    │ │ │ │ │ │ │ │ │ │ │ │ Kill EPMD │ │ │

    │ │ │

    This request kills the running EPMD. It is almost never used.

    ---
    │ │ │  title: Kill EPMD
    │ │ │ @@ -407,54 +407,54 @@
    │ │ │  received from A is correct and generates a digest from the challenge
    │ │ │  received from A. The digest is then sent to A. The message is as follows:

    116
    'a'Digest

    Table: The challenge_ack message

    Digest is the digest calculated by B for A's challenge.

  • 7) check - A checks the digest from B and the connection is up.

  • │ │ │ │ │ │ │ │ │ │ │ │ Semigraphic View │ │ │

    │ │ │ -
    A (initiator)                                      B (acceptor)
    │ │ │ +
    A (initiator)                                      B (acceptor)
    │ │ │  
    │ │ │  TCP connect ------------------------------------>
    │ │ │                                                     TCP accept
    │ │ │  
    │ │ │  send_name -------------------------------------->
    │ │ │                                                     recv_name
    │ │ │  
    │ │ │    <---------------------------------------------- send_status
    │ │ │  recv_status
    │ │ │ -(if status was 'alive'
    │ │ │ +(if status was 'alive'
    │ │ │   send_status - - - - - - - - - - - - - - - - - ->
    │ │ │ -                                                   recv_status)
    │ │ │ +                                                   recv_status)
    │ │ │  
    │ │ │ -                          (ChB)                      ChB = gen_challenge()
    │ │ │ +                          (ChB)                      ChB = gen_challenge()
    │ │ │    <---------------------------------------------- send_challenge
    │ │ │  recv_challenge
    │ │ │  
    │ │ │ -(if old send_name
    │ │ │ +(if old send_name
    │ │ │   send_complement - - - - - - - - - - - - - - - ->
    │ │ │ -                                                   recv_complement)
    │ │ │ +                                                   recv_complement)
    │ │ │  
    │ │ │ -ChA = gen_challenge(),
    │ │ │ -OCA = out_cookie(B),
    │ │ │ -DiA = gen_digest(ChB, OCA)
    │ │ │ -                          (ChA, DiA)
    │ │ │ +ChA = gen_challenge(),
    │ │ │ +OCA = out_cookie(B),
    │ │ │ +DiA = gen_digest(ChB, OCA)
    │ │ │ +                          (ChA, DiA)
    │ │ │  send_challenge_reply --------------------------->
    │ │ │                                                     recv_challenge_reply
    │ │ │ -                                                   ICB = in_cookie(A),
    │ │ │ +                                                   ICB = in_cookie(A),
    │ │ │                                                     check:
    │ │ │ -                                                   DiA == gen_digest (ChB, ICB)?
    │ │ │ +                                                   DiA == gen_digest (ChB, ICB)?
    │ │ │                                                     - if OK:
    │ │ │ -                                                    OCB = out_cookie(A),
    │ │ │ -                                                    DiB = gen_digest (ChA, OCB)
    │ │ │ -                          (DiB)
    │ │ │ +                                                    OCB = out_cookie(A),
    │ │ │ +                                                    DiB = gen_digest (ChA, OCB)
    │ │ │ +                          (DiB)
    │ │ │    <----------------------------------------------- send_challenge_ack
    │ │ │  recv_challenge_ack                                  DONE
    │ │ │ -ICA = in_cookie(B),                                - else:
    │ │ │ +ICA = in_cookie(B),                                - else:
    │ │ │  check:                                              CLOSE
    │ │ │ -DiB == gen_digest(ChA, ICA)?
    │ │ │ +DiB == gen_digest(ChA, ICA)?
    │ │ │  - if OK:
    │ │ │   DONE
    │ │ │  - else:
    │ │ │   CLOSE

    │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/erl_ext_dist.html │ │ │ @@ -436,15 +436,15 @@ │ │ │ │ │ │ SMALL_BIG_EXT │ │ │

    │ │ │
    111n
    110nSignd(0) ... d(n-1)

    Bignums are stored in unary form with a Sign byte, that is, 0 if the bignum is │ │ │ positive and 1 if it is negative. The digits are stored with the least │ │ │ significant byte stored first. To calculate the integer, the following formula │ │ │ can be used:

    B = 256
    │ │ │ -(d0*B^0 + d1*B^1 + d2*B^2 + ... d(N-1)*B^(n-1))

    │ │ │ +(d0*B^0 + d1*B^1 + d2*B^2 + ... d(N-1)*B^(n-1))

    │ │ │ │ │ │ │ │ │ │ │ │ LARGE_BIG_EXT │ │ │

    │ │ │
    141n
    111nSignd(0) ... d(n-1)

    Same as SMALL_BIG_EXT except that the length │ │ │ field is an unsigned 4 byte integer.

    │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/erl_nif.html │ │ │ @@ -161,27 +161,27 @@ │ │ │ } │ │ │ │ │ │ static ErlNifFunc nif_funcs[] = │ │ │ { │ │ │ {"hello", 0, hello} │ │ │ }; │ │ │ │ │ │ -ERL_NIF_INIT(niftest,nif_funcs,NULL,NULL,NULL,NULL)

    The Erlang module can look as follows:

    -module(niftest).
    │ │ │ +ERL_NIF_INIT(niftest,nif_funcs,NULL,NULL,NULL,NULL)

    The Erlang module can look as follows:

    -module(niftest).
    │ │ │  
    │ │ │ --export([init/0, hello/0]).
    │ │ │ +-export([init/0, hello/0]).
    │ │ │  
    │ │ │ --nifs([hello/0]).
    │ │ │ +-nifs([hello/0]).
    │ │ │  
    │ │ │ --on_load(init/0).
    │ │ │ +-on_load(init/0).
    │ │ │  
    │ │ │ -init() ->
    │ │ │ -      erlang:load_nif("./niftest", 0).
    │ │ │ +init() ->
    │ │ │ +      erlang:load_nif("./niftest", 0).
    │ │ │  
    │ │ │ -hello() ->
    │ │ │ -      erlang:nif_error("NIF library not loaded").

    Compile and test can look as follows (on Linux):

    $> gcc -fPIC -shared -o niftest.so niftest.c -I $ERL_ROOT/usr/include/
    │ │ │ +hello() ->
    │ │ │ +      erlang:nif_error("NIF library not loaded").

    Compile and test can look as follows (on Linux):

    $> gcc -fPIC -shared -o niftest.so niftest.c -I $ERL_ROOT/usr/include/
    │ │ │  $> erl
    │ │ │  
    │ │ │  1> c(niftest).
    │ │ │  {ok,niftest}
    │ │ │  2> niftest:hello().
    │ │ │  "Hello world!"

    In the example above the on_load │ │ │ directive is used get function init called automatically when the module is │ │ ├── ./usr/share/doc/erlang-doc/html/erts-15.2.7.4/doc/html/erl_prim_loader.html │ │ │ @@ -398,15 +398,15 @@ │ │ │ when Filename :: string(), FileInfo :: file:file_info().

    │ │ │ │ │ │ │ │ │ │ │ │

    Retrieves information about a file.

    Returns {ok, FileInfo} if successful, otherwise error. FileInfo is a │ │ │ record file_info, defined in the Kernel include file │ │ │ file.hrl. Include the following directive in the module from which the │ │ │ -function is called:

    -include_lib("kernel/include/file.hrl").

    For more information about the record see file:read_file_info/2.

    Filename can also be a file in an archive, for example, │ │ │ +function is called:

    -include_lib("kernel/include/file.hrl").

    For more information about the record see file:read_file_info/2.

    Filename can also be a file in an archive, for example, │ │ │ $OTPROOT/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia. For information │ │ │ about archive files, see code.

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Combines two previously computed adler32 checksums.

    This computation requires the size of the data object for the second checksum │ │ │ -to be known.

    The following code:

    Y = erlang:adler32(Data1),
    │ │ │ -Z = erlang:adler32(Y,Data2).

    assigns the same value to Z as this:

    X = erlang:adler32(Data1),
    │ │ │ -Y = erlang:adler32(Data2),
    │ │ │ -Z = erlang:adler32_combine(X,Y,iolist_size(Data2)).
    │ │ │ +to be known.

    The following code:

    Y = erlang:adler32(Data1),
    │ │ │ +Z = erlang:adler32(Y,Data2).

    assigns the same value to Z as this:

    X = erlang:adler32(Data1),
    │ │ │ +Y = erlang:adler32(Data2),
    │ │ │ +Z = erlang:adler32_combine(X,Y,iolist_size(Data2)).
    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -6934,16 +6934,16 @@ │ │ │ │ │ │ │ │ │

    Continues computing the crc32 checksum by combining the previous checksum, │ │ │ -OldCrc, with the checksum of Data.

    The following code:

    X = erlang:crc32(Data1),
    │ │ │ -Y = erlang:crc32(X,Data2).

    assigns the same value to Y as this:

    Y = erlang:crc32([Data1,Data2]).
    │ │ │ +OldCrc, with the checksum of Data.

    The following code:

    X = erlang:crc32(Data1),
    │ │ │ +Y = erlang:crc32(X,Data2).

    assigns the same value to Y as this:

    Y = erlang:crc32([Data1,Data2]).
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Combines two previously computed crc32 checksums.

    This computation requires the size of the data object for the second checksum │ │ │ -to be known.

    The following code:

    Y = erlang:crc32(Data1),
    │ │ │ -Z = erlang:crc32(Y,Data2).

    assigns the same value to Z as this:

    X = erlang:crc32(Data1),
    │ │ │ -Y = erlang:crc32(Data2),
    │ │ │ -Z = erlang:crc32_combine(X,Y,iolist_size(Data2)).
    │ │ │ +to be known.

    The following code:

    Y = erlang:crc32(Data1),
    │ │ │ +Z = erlang:crc32(Y,Data2).

    assigns the same value to Z as this:

    X = erlang:crc32(Data1),
    │ │ │ +Y = erlang:crc32(Data2),
    │ │ │ +Z = erlang:crc32_combine(X,Y,iolist_size(Data2)).
    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -8129,19 +8129,19 @@ │ │ │ the Info map in the returned result will contain the key node_type │ │ │ associated with the value NodeTypeInfo. Currently the following node types │ │ │ exist:

    Example:

    (a@localhost)1> nodes([this, connected], #{connection_id=>true, node_type=>true}).
    │ │ │ -[{c@localhost,#{connection_id => 13892108,node_type => hidden}},
    │ │ │ - {b@localhost,#{connection_id => 3067553,node_type => visible}},
    │ │ │ - {a@localhost,#{connection_id => undefined,node_type => this}}]
    │ │ │ -(a@localhost)2>
    │ │ │ +process.

    Example:

    (a@localhost)1> nodes([this, connected], #{connection_id=>true, node_type=>true}).
    │ │ │ +[{c@localhost,#{connection_id => 13892108,node_type => hidden}},
    │ │ │ + {b@localhost,#{connection_id => 3067553,node_type => visible}},
    │ │ │ + {a@localhost,#{connection_id => undefined,node_type => this}}]
    │ │ │ +(a@localhost)2>
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -8237,17 +8237,17 @@ │ │ │ │ │ │
    -spec abs(Float) -> float() when Float :: float();
    │ │ │           (Int) -> non_neg_integer() when Int :: integer().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns an integer or float that is the arithmetical absolute value of Float │ │ │ -or Int.

    For example:

    > abs(-3.33).
    │ │ │ +or Int.

    For example:

    > abs(-3.33).
    │ │ │  3.33
    │ │ │ -> abs(-3).
    │ │ │ +> abs(-3).
    │ │ │  3
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns a new tuple that has one element more than Tuple1, and contains the │ │ │ elements in Tuple1 followed by Term as the last element.

    Semantically equivalent to │ │ │ list_to_tuple(tuple_to_list(Tuple1) ++ [Term]), but much │ │ │ -faster.

    For example:

    > erlang:append_element({one, two}, three).
    │ │ │ -{one,two,three}
    │ │ │ +faster.

    For example:

    > erlang:append_element({one, two}, three).
    │ │ │ +{one,two,three}
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns a binary corresponding to the text representation of Atom.

    If Encoding is latin1, one byte exists for each character in the text │ │ │ representation. If Encoding is utf8 or unicode, the characters are encoded │ │ │ using UTF-8 where characters may require multiple bytes.

    Change

    As from Erlang/OTP 20, atoms can contain any Unicode character and │ │ │ atom_to_binary(Atom, latin1) may fail if the text │ │ │ -representation for Atom contains a Unicode character > 255.

    Example:

    > atom_to_binary('Erlang', latin1).
    │ │ │ -<<"Erlang">>
    │ │ │ +representation for Atom contains a Unicode character > 255.

    Example:

    > atom_to_binary('Erlang', latin1).
    │ │ │ +<<"Erlang">>
    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -8363,17 +8363,17 @@ │ │ │
    │ │ │ │ │ │
    -spec atom_to_list(Atom) -> string() when Atom :: atom().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns a list of unicode code points corresponding to the text representation │ │ │ -of Atom.

    For example:

    > atom_to_list('Erlang').
    │ │ │ -"Erlang"
    > atom_to_list('你好').
    │ │ │ -[20320,22909]

    See unicode for how to convert the resulting list to different formats.

    │ │ │ +of Atom.

    For example:

    > atom_to_list('Erlang').
    │ │ │ +"Erlang"
    > atom_to_list('你好').
    │ │ │ +[20320,22909]

    See unicode for how to convert the resulting list to different formats.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -8400,19 +8400,19 @@ │ │ │
    -spec binary_part(Subject, PosLen) -> binary()
    │ │ │                       when
    │ │ │                           Subject :: binary(),
    │ │ │                           PosLen :: {Start :: non_neg_integer(), Length :: integer()}.
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Extracts the part of the binary described by PosLen.

    Negative length can be used to extract bytes at the end of a binary.

    For example:

    1> Bin = <<1,2,3,4,5,6,7,8,9,10>>.
    │ │ │ -2> binary_part(Bin,{byte_size(Bin), -5}).
    │ │ │ -<<6,7,8,9,10>>

    Failure: badarg if PosLen in any way references outside the binary.

    Start is zero-based, that is:

    1> Bin = <<1,2,3>>
    │ │ │ -2> binary_part(Bin,{0,2}).
    │ │ │ -<<1,2>>

    For details about the PosLen semantics, see binary.

    │ │ │ +

    Extracts the part of the binary described by PosLen.

    Negative length can be used to extract bytes at the end of a binary.

    For example:

    1> Bin = <<1,2,3,4,5,6,7,8,9,10>>.
    │ │ │ +2> binary_part(Bin,{byte_size(Bin), -5}).
    │ │ │ +<<6,7,8,9,10>>

    Failure: badarg if PosLen in any way references outside the binary.

    Start is zero-based, that is:

    1> Bin = <<1,2,3>>
    │ │ │ +2> binary_part(Bin,{0,2}).
    │ │ │ +<<1,2>>

    For details about the PosLen semantics, see binary.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │

    Note

    The number of characters that are permitted in an atom name is limited. The │ │ │ default limits can be found in the │ │ │ Efficiency Guide (section System Limits).

    Note

    There is configurable limit on how many atoms that can exist and atoms are not │ │ │ garbage collected. Therefore, it is recommended to consider whether │ │ │ binary_to_existing_atom/2 is a better option │ │ │ than binary_to_atom/2. The default limits can be found │ │ │ -in Efficiency Guide (section System Limits).

    Examples:

    > binary_to_atom(<<"Erlang">>, latin1).
    │ │ │ -'Erlang'
    > binary_to_atom(<<1024/utf8>>, utf8).
    │ │ │ +in Efficiency Guide (section System Limits).

    Examples:

    > binary_to_atom(<<"Erlang">>, latin1).
    │ │ │ +'Erlang'
    > binary_to_atom(<<1024/utf8>>, utf8).
    │ │ │  'Ѐ'
    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -8613,15 +8613,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec binary_to_float(Binary) -> float() when Binary :: binary().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns the float whose text representation is Binary.

    For example:

    > binary_to_float(<<"2.2017764e+0">>).
    │ │ │ +

    Returns the float whose text representation is Binary.

    For example:

    > binary_to_float(<<"2.2017764e+0">>).
    │ │ │  2.2017764

    The float string format is the same as the format for │ │ │ Erlang float literals except for that underscores │ │ │ are not permitted.

    Failure: badarg if Binary contains a bad representation of a float.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -8646,15 +8646,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec binary_to_integer(Binary) -> integer() when Binary :: binary().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns an integer whose text representation is Binary.

    For example:

    > binary_to_integer(<<"123">>).
    │ │ │ +

    Returns an integer whose text representation is Binary.

    For example:

    > binary_to_integer(<<"123">>).
    │ │ │  123

    binary_to_integer/1 accepts the same string formats │ │ │ as list_to_integer/1.

    Failure: badarg if Binary contains a bad representation of an integer.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -8678,15 +8678,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec binary_to_integer(Binary, Base) -> integer() when Binary :: binary(), Base :: 2..36.
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns an integer whose text representation in base Base is Binary.

    For example:

    > binary_to_integer(<<"3FF">>, 16).
    │ │ │ +

    Returns an integer whose text representation in base Base is Binary.

    For example:

    > binary_to_integer(<<"3FF">>, 16).
    │ │ │  1023

    binary_to_integer/2 accepts the same string formats │ │ │ as list_to_integer/2.

    Failure: badarg if Binary contains a bad representation of an integer.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -8771,17 +8771,17 @@ │ │ │ │ │ │
    -spec binary_to_term(Binary) -> term() when Binary :: ext_binary().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns an Erlang term that is the result of decoding binary object Binary, │ │ │ which must be encoded according to the │ │ │ -Erlang external term format.

    > Bin = term_to_binary(hello).
    │ │ │ -<<131,100,0,5,104,101,108,108,111>>
    │ │ │ -> hello = binary_to_term(Bin).
    │ │ │ +Erlang external term format.

    > Bin = term_to_binary(hello).
    │ │ │ +<<131,100,0,5,104,101,108,108,111>>
    │ │ │ +> hello = binary_to_term(Bin).
    │ │ │  hello

    Warning

    When decoding binaries from untrusted sources, the untrusted source may submit │ │ │ data in a way to create resources, such as atoms and remote references, that │ │ │ cannot be garbage collected and lead to Denial of Service attack. In such │ │ │ cases, consider using binary_to_term/2 with the safe │ │ │ option.

    See also term_to_binary/1 and binary_to_term/2.

    │ │ │
    │ │ │ │ │ │ @@ -8820,30 +8820,30 @@ │ │ │

    Equivalent to binary_to_term(Binary), but can be configured to │ │ │ fit special purposes.

    The allowed options are:

    • safe - Use this option when receiving binaries from an untrusted source.

      When enabled, it prevents decoding data that can be used to attack the Erlang │ │ │ runtime. In the event of receiving unsafe data, decoding fails with a badarg │ │ │ error.

      This prevents creation of new atoms directly, creation of new atoms indirectly │ │ │ (as they are embedded in certain structures, such as process identifiers, │ │ │ refs, and funs), and creation of new external function references. None of │ │ │ those resources are garbage collected, so unchecked creation of them can │ │ │ -exhaust available memory.

      > binary_to_term(<<131,100,0,5,"hello">>, [safe]).
      │ │ │ +exhaust available memory.

      > binary_to_term(<<131,100,0,5,"hello">>, [safe]).
      │ │ │  ** exception error: bad argument
      │ │ │  > hello.
      │ │ │  hello
      │ │ │ -> binary_to_term(<<131,100,0,5,"hello">>, [safe]).
      │ │ │ +> binary_to_term(<<131,100,0,5,"hello">>, [safe]).
      │ │ │  hello

      Warning

      The safe option ensures the data is safely processed by the Erlang runtime │ │ │ but it does not guarantee the data is safe to your application. You must │ │ │ always validate data from untrusted sources. If the binary is stored or │ │ │ transits through untrusted sources, you should also consider │ │ │ cryptographically signing it.

    • used - Changes the return value to {Term, Used} where Used is the │ │ │ -number of bytes actually read from Binary.

      > Input = <<131,100,0,5,"hello","world">>.
      │ │ │ -<<131,100,0,5,104,101,108,108,111,119,111,114,108,100>>
      │ │ │ -> {Term, Used} = binary_to_term(Input, [used]).
      │ │ │ -{hello, 9}
      │ │ │ -> split_binary(Input, Used).
      │ │ │ -{<<131,100,0,5,104,101,108,108,111>>, <<"world">>}

    Failure: badarg if safe is specified and unsafe data is decoded.

    See also term_to_binary/1, binary_to_term/1, and list_to_existing_atom/1.

    │ │ │ +number of bytes actually read from Binary.

    > Input = <<131,100,0,5,"hello","world">>.
    │ │ │ +<<131,100,0,5,104,101,108,108,111,119,111,114,108,100>>
    │ │ │ +> {Term, Used} = binary_to_term(Input, [used]).
    │ │ │ +{hello, 9}
    │ │ │ +> split_binary(Input, Used).
    │ │ │ +{<<131,100,0,5,104,101,108,108,111>>, <<"world">>}

    Failure: badarg if safe is specified and unsafe data is decoded.

    See also term_to_binary/1, binary_to_term/1, and list_to_existing_atom/1.

    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -8865,17 +8865,17 @@ │ │ │ │ │ │ │ │ │ │ │ │ -

    Returns an integer that is the size in bits of Bitstring.

    For example:

    > bit_size(<<433:16,3:3>>).
    │ │ │ +

    Returns an integer that is the size in bits of Bitstring.

    For example:

    > bit_size(<<433:16,3:3>>).
    │ │ │  19
    │ │ │ -> bit_size(<<1,2,3>>).
    │ │ │ +> bit_size(<<1,2,3>>).
    │ │ │  24
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -8897,17 +8897,17 @@ │ │ │ │ │ │ │ │ │

    Returns a list of integers corresponding to the bytes of Bitstring.

    If the number of bits in the binary is not divisible by 8, the last element of │ │ │ -the list is a bitstring containing the remaining 1-7 bits.

    For example:

    > bitstring_to_list(<<433:16>>).
    │ │ │ -[1,177]
    > bitstring_to_list(<<433:16,3:3>>).
    │ │ │ -[1,177,<<3:3>>]
    │ │ │ +the list is a bitstring containing the remaining 1-7 bits.

    For example:

    > bitstring_to_list(<<433:16>>).
    │ │ │ +[1,177]
    > bitstring_to_list(<<433:16,3:3>>).
    │ │ │ +[1,177,<<3:3>>]
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns an integer that is the number of bytes needed to contain Bitstring. │ │ │ That is, if the number of bits in Bitstring is not divisible by 8, the │ │ │ -resulting number of bytes is rounded up.

    For example:

    > byte_size(<<433:16,3:3>>).
    │ │ │ +resulting number of bytes is rounded up.

    For example:

    > byte_size(<<433:16,3:3>>).
    │ │ │  3
    │ │ │ -> byte_size(<<1,2,3>>).
    │ │ │ +> byte_size(<<1,2,3>>).
    │ │ │  3
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -8966,15 +8966,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec ceil(Number) -> integer() when Number :: number().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns the smallest integer not less than Number.

    For example:

    > ceil(5.5).
    │ │ │ +

    Returns the smallest integer not less than Number.

    For example:

    > ceil(5.5).
    │ │ │  6
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9074,18 +9074,18 @@ │ │ │ RFC2732 .

    Options:

    • {packet_size, integer() >= 0} - Sets the maximum allowed size of the │ │ │ packet body. If the packet header indicates that the length of the packet is │ │ │ longer than the maximum allowed length, the packet is considered invalid. │ │ │ Defaults to 0, which means no size limit.

    • {line_length, integer() >= 0} - For packet type line, lines longer │ │ │ than the indicated length are truncated.

      Option line_length also applies to http* packet types as an alias for │ │ │ option packet_size if packet_size itself is not set. This use is only │ │ │ intended for backward compatibility.

    • {line_delimiter, 0 =< byte() =< 255} - For packet type line, sets the │ │ │ -delimiting byte. Default is the latin-1 character $\n.

    Examples:

    > erlang:decode_packet(1,<<3,"abcd">>,[]).
    │ │ │ -{ok,<<"abc">>,<<"d">>}
    │ │ │ -> erlang:decode_packet(1,<<5,"abcd">>,[]).
    │ │ │ -{more,6}
    │ │ │ +delimiting byte. Default is the latin-1 character $\n.

    Examples:

    > erlang:decode_packet(1,<<3,"abcd">>,[]).
    │ │ │ +{ok,<<"abc">>,<<"d">>}
    │ │ │ +> erlang:decode_packet(1,<<5,"abcd">>,[]).
    │ │ │ +{more,6}
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -9106,16 +9106,16 @@ │ │ │ │ │ │ │ │ │ -

    Returns a new tuple with element at Index removed from tuple Tuple1.

    For example:

    > erlang:delete_element(2, {one, two, three}).
    │ │ │ -{one,three}
    │ │ │ +

    Returns a new tuple with element at Index removed from tuple Tuple1.

    For example:

    > erlang:delete_element(2, {one, two, three}).
    │ │ │ +{one,three}
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -9165,15 +9165,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec element(N, Tuple) -> term() when N :: pos_integer(), Tuple :: tuple().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns the Nth element (numbering from 1) of Tuple.

    For example:

    > element(2, {a, b, c}).
    │ │ │ +

    Returns the Nth element (numbering from 1) of Tuple.

    For example:

    > element(2, {a, b, c}).
    │ │ │  b
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9195,18 +9195,18 @@ │ │ │ │ │ │ │ │ │

    Calculates, without doing the encoding, the maximum byte size for a term encoded │ │ │ -in the Erlang external term format.

    The following condition applies always:

    > Size1 = byte_size(term_to_binary(Term)),
    │ │ │ -> Size2 = erlang:external_size(Term),
    │ │ │ +in the Erlang external term format.

    The following condition applies always:

    > Size1 = byte_size(term_to_binary(Term)),
    │ │ │ +> Size2 = erlang:external_size(Term),
    │ │ │  > true = Size1 =< Size2.
    │ │ │ -true

    This is equivalent to a call to:

    erlang:external_size(Term, [])
    │ │ │ +
    true

    This is equivalent to a call to:

    erlang:external_size(Term, [])
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Calculates, without doing the encoding, the maximum byte size for a term encoded │ │ │ -in the Erlang external term format.

    The following condition applies always:

    > Size1 = byte_size(term_to_binary(Term, Options)),
    │ │ │ -> Size2 = erlang:external_size(Term, Options),
    │ │ │ +in the Erlang external term format.

    The following condition applies always:

    > Size1 = byte_size(term_to_binary(Term, Options)),
    │ │ │ +> Size2 = erlang:external_size(Term, Options),
    │ │ │  > true = Size1 =< Size2.
    │ │ │  true

    Option {minor_version, Version} specifies how floats are encoded. For a │ │ │ detailed description, see term_to_binary/2.

    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9269,15 +9269,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec float(Number) -> float() when Number :: number().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns a float by converting Number to a float.

    For example:

    > float(55).
    │ │ │ +

    Returns a float by converting Number to a float.

    For example:

    > float(55).
    │ │ │  55.0

    Note

    If used on the top level in a guard, it tests whether the argument is a │ │ │ floating point number; for clarity, use is_float/1 instead.

    When float/1 is used in an expression in a guard, such as │ │ │ 'float(A) == 4.0', it converts a number as described earlier.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9340,26 +9340,26 @@ │ │ │ {decimals, Decimals :: 0..253} | │ │ │ {scientific, Decimals :: 0..249} | │ │ │ compact | short.
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns a binary corresponding to the text representation of Float using fixed │ │ │ -decimal point formatting.

    Options behaves in the same way as float_to_list/2.

    For example:

    > float_to_binary(7.12, [{decimals, 4}]).
    │ │ │ -<<"7.1200">>
    │ │ │ -> float_to_binary(7.12, [{decimals, 4}, compact]).
    │ │ │ -<<"7.12">>
    │ │ │ -> float_to_binary(7.12, [{scientific, 3}]).
    │ │ │ -<<"7.120e+00">>
    │ │ │ -> float_to_binary(7.12, [short]).
    │ │ │ -<<"7.12">>
    │ │ │ -> float_to_binary(0.1+0.2, [short]).
    │ │ │ -<<"0.30000000000000004">>
    │ │ │ -> float_to_binary(0.1+0.2)
    │ │ │ -<<"3.00000000000000044409e-01">>
    │ │ │ +decimal point formatting.

    Options behaves in the same way as float_to_list/2.

    For example:

    > float_to_binary(7.12, [{decimals, 4}]).
    │ │ │ +<<"7.1200">>
    │ │ │ +> float_to_binary(7.12, [{decimals, 4}, compact]).
    │ │ │ +<<"7.12">>
    │ │ │ +> float_to_binary(7.12, [{scientific, 3}]).
    │ │ │ +<<"7.120e+00">>
    │ │ │ +> float_to_binary(7.12, [short]).
    │ │ │ +<<"7.12">>
    │ │ │ +> float_to_binary(0.1+0.2, [short]).
    │ │ │ +<<"0.30000000000000004">>
    │ │ │ +> float_to_binary(0.1+0.2)
    │ │ │ +<<"3.00000000000000044409e-01">>
    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -9427,25 +9427,25 @@ │ │ │ are truncated. This option is only meaningful together with option decimals.
  • If option scientific is specified, the float is formatted using scientific │ │ │ notation with Decimals digits of precision.
  • If option short is specified, the float is formatted with the smallest │ │ │ number of digits that still guarantees that │ │ │ F =:= list_to_float(float_to_list(F, [short])). When the float is inside the │ │ │ range (-2⁵³, 2⁵³), the notation that yields the smallest number of characters │ │ │ is used (scientific notation or normal decimal notation). Floats outside the │ │ │ range (-2⁵³, 2⁵³) are always formatted using scientific notation to avoid │ │ │ -confusing results when doing arithmetic operations.
  • If Options is [], the function behaves as float_to_list/1.
  • Examples:

    > float_to_list(7.12, [{decimals, 4}]).
    │ │ │ +confusing results when doing arithmetic operations.
  • If Options is [], the function behaves as float_to_list/1.
  • Examples:

    > float_to_list(7.12, [{decimals, 4}]).
    │ │ │  "7.1200"
    │ │ │ -> float_to_list(7.12, [{decimals, 4}, compact]).
    │ │ │ +> float_to_list(7.12, [{decimals, 4}, compact]).
    │ │ │  "7.12"
    │ │ │ -> float_to_list(7.12, [{scientific, 3}]).
    │ │ │ +> float_to_list(7.12, [{scientific, 3}]).
    │ │ │  "7.120e+00"
    │ │ │ -> float_to_list(7.12, [short]).
    │ │ │ +> float_to_list(7.12, [short]).
    │ │ │  "7.12"
    │ │ │ -> float_to_list(0.1+0.2, [short]).
    │ │ │ +> float_to_list(0.1+0.2, [short]).
    │ │ │  "0.30000000000000004"
    │ │ │ -> float_to_list(0.1+0.2)
    │ │ │ +> float_to_list(0.1+0.2)
    │ │ │  "3.00000000000000044409e-01"

    In the last example, float_to_list(0.1+0.2) evaluates to │ │ │ "3.00000000000000044409e-01". The reason for this is explained in │ │ │ Representation of Floating Point Numbers.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9472,15 +9472,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec floor(Number) -> integer() when Number :: number().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns the largest integer not greater than Number.

    For example:

    > floor(-10.5).
    │ │ │ +

    Returns the largest integer not greater than Number.

    For example:

    > floor(-10.5).
    │ │ │  -11
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9600,25 +9600,25 @@ │ │ │ named module, index and uniq in the result of │ │ │ erlang:fun_info(Fun).

  • uncompiled code - All funs created from fun expressions in uncompiled code │ │ │ with the same arity are mapped to the same list by │ │ │ fun_to_list/1.

  • Note

    Generally, one can not use fun_to_list/1 to check if two │ │ │ funs are equal as fun_to_list/1 does not take the fun's │ │ │ environment into account. See erlang:fun_info/1 for how to │ │ │ get the environment of a fun.

    Change

    The output of fun_to_list/1 can differ between Erlang │ │ │ -implementations and may change in future versions.

    Examples:

    -module(test).
    │ │ │ --export([add/1, add2/0, fun_tuple/0]).
    │ │ │ -add(A) -> fun(B) -> A + B end.
    │ │ │ -add2() -> fun add/1.
    │ │ │ -fun_tuple() -> {fun() -> 1 end, fun() -> 1 end}.
    > {fun test:add/1, test:add2()}.
    │ │ │ -{fun test:add/1,#Fun<test.1.107738983>}

    Explanation: fun test:add/1 is upgradable but test:add2() is not upgradable.

    > {test:add(1), test:add(42)}.
    │ │ │ -{#Fun<test.0.107738983>,#Fun<test.0.107738983>}

    Explanation: test:add(1) and test:add(42) has the same string representation │ │ │ -as the environment is not taken into account.

    >test:fun_tuple().
    │ │ │ -{#Fun<test.2.107738983>,#Fun<test.3.107738983>}

    Explanation: The string representations differ because the funs come from │ │ │ -different fun expressions.

    > {fun() -> 1 end, fun() -> 1 end}. >
    │ │ │ -{#Fun<erl_eval.45.97283095>,#Fun<erl_eval.45.97283095>}

    Explanation: All funs created from fun expressions of this form in uncompiled │ │ │ +implementations and may change in future versions.

    Examples:

    -module(test).
    │ │ │ +-export([add/1, add2/0, fun_tuple/0]).
    │ │ │ +add(A) -> fun(B) -> A + B end.
    │ │ │ +add2() -> fun add/1.
    │ │ │ +fun_tuple() -> {fun() -> 1 end, fun() -> 1 end}.
    > {fun test:add/1, test:add2()}.
    │ │ │ +{fun test:add/1,#Fun<test.1.107738983>}

    Explanation: fun test:add/1 is upgradable but test:add2() is not upgradable.

    > {test:add(1), test:add(42)}.
    │ │ │ +{#Fun<test.0.107738983>,#Fun<test.0.107738983>}

    Explanation: test:add(1) and test:add(42) has the same string representation │ │ │ +as the environment is not taken into account.

    >test:fun_tuple().
    │ │ │ +{#Fun<test.2.107738983>,#Fun<test.3.107738983>}

    Explanation: The string representations differ because the funs come from │ │ │ +different fun expressions.

    > {fun() -> 1 end, fun() -> 1 end}. >
    │ │ │ +{#Fun<erl_eval.45.97283095>,#Fun<erl_eval.45.97283095>}

    Explanation: All funs created from fun expressions of this form in uncompiled │ │ │ code with the same arity are mapped to the same list by │ │ │ fun_to_list/1.

    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -9642,16 +9642,16 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec hd(List) -> Head when List :: nonempty_maybe_improper_list(), Head :: term().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns the head of List, that is, the first element.

    It works with improper lists.

    Examples:

    > hd([1,2,3,4,5]).
    │ │ │ -1
    > hd([first, second, third, so_on | improper_end]).
    │ │ │ +

    Returns the head of List, that is, the first element.

    It works with improper lists.

    Examples:

    > hd([1,2,3,4,5]).
    │ │ │ +1
    > hd([first, second, third, so_on | improper_end]).
    │ │ │  first

    Failure: badarg if List is an empty list [].

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns a new tuple with element Term inserted at position Index in tuple │ │ │ Tuple1. All elements from position Index and upwards are pushed one step │ │ │ -higher in the new tuple Tuple2.

    For example:

    > erlang:insert_element(2, {one, two, three}, new).
    │ │ │ -{one,new,two,three}
    │ │ │ +higher in the new tuple Tuple2.

    For example:

    > erlang:insert_element(2, {one, two, three}, new).
    │ │ │ +{one,new,two,three}
    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -9707,16 +9707,16 @@ │ │ │ │ │ │ │ │ │ │ │ │ -

    Returns a binary corresponding to the text representation of Integer.

    For example:

    > integer_to_binary(77).
    │ │ │ -<<"77">>
    │ │ │ +

    Returns a binary corresponding to the text representation of Integer.

    For example:

    > integer_to_binary(77).
    │ │ │ +<<"77">>
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -9739,16 +9739,16 @@ │ │ │
    │ │ │ │ │ │
    -spec integer_to_binary(Integer, Base) -> binary() when Integer :: integer(), Base :: 2..36.
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns a binary corresponding to the text representation of Integer in base │ │ │ -Base.

    For example:

    > integer_to_binary(1023, 16).
    │ │ │ -<<"3FF">>
    │ │ │ +Base.

    For example:

    > integer_to_binary(1023, 16).
    │ │ │ +<<"3FF">>
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -9768,15 +9768,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ -

    Returns a string corresponding to the text representation of Integer.

    For example:

    > integer_to_list(77).
    │ │ │ +

    Returns a string corresponding to the text representation of Integer.

    For example:

    > integer_to_list(77).
    │ │ │  "77"
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9798,15 +9798,15 @@ │ │ │
    │ │ │ │ │ │
    -spec integer_to_list(Integer, Base) -> string() when Integer :: integer(), Base :: 2..36.
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns a string corresponding to the text representation of Integer in base │ │ │ -Base.

    For example:

    > integer_to_list(1023, 16).
    │ │ │ +Base.

    For example:

    > integer_to_list(1023, 16).
    │ │ │  "3FF"
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9828,15 +9828,15 @@ │ │ │ │ │ │ │ │ │

    Returns an integer, that is the size in bytes, of the binary that would be the │ │ │ -result of iolist_to_binary(Item).

    For example:

    > iolist_size([1,2|<<3,4>>]).
    │ │ │ +result of iolist_to_binary(Item).

    For example:

    > iolist_size([1,2|<<3,4>>]).
    │ │ │  4
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -9858,22 +9858,22 @@ │ │ │
    │ │ │ │ │ │
    -spec iolist_to_binary(IoListOrBinary) -> binary() when IoListOrBinary :: iolist() | binary().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns a binary that is made from the integers and binaries in │ │ │ -IoListOrBinary.

    For example:

    > Bin1 = <<1,2,3>>.
    │ │ │ -<<1,2,3>>
    │ │ │ -> Bin2 = <<4,5>>.
    │ │ │ -<<4,5>>
    │ │ │ -> Bin3 = <<6>>.
    │ │ │ -<<6>>
    │ │ │ -> iolist_to_binary([Bin1,1,[2,3,Bin2],4|Bin3]).
    │ │ │ -<<1,2,3,1,2,3,4,5,4,6>>
    │ │ │ +IoListOrBinary.

    For example:

    > Bin1 = <<1,2,3>>.
    │ │ │ +<<1,2,3>>
    │ │ │ +> Bin2 = <<4,5>>.
    │ │ │ +<<4,5>>
    │ │ │ +> Bin3 = <<6>>.
    │ │ │ +<<6>>
    │ │ │ +> iolist_to_binary([Bin1,1,[2,3,Bin2],4|Bin3]).
    │ │ │ +<<1,2,3,1,2,3,4,5,4,6>>
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -9899,31 +9899,31 @@ │ │ │ │ │ │

    Returns an iovec that is made from the integers and binaries in │ │ │ IoListOrBinary. This function is useful when you want to flatten an iolist but │ │ │ you do not need a single binary. This can be useful for passing the data to nif │ │ │ functions such as enif_inspect_iovec or do │ │ │ more efficient message passing. The advantage of using this function over │ │ │ iolist_to_binary/1 is that it does not have to copy │ │ │ -off-heap binaries.

    For example:

    > Bin1 = <<1,2,3>>.
    │ │ │ -<<1,2,3>>
    │ │ │ -> Bin2 = <<4,5>>.
    │ │ │ -<<4,5>>
    │ │ │ -> Bin3 = <<6>>.
    │ │ │ -<<6>>
    │ │ │ +off-heap binaries.

    For example:

    > Bin1 = <<1,2,3>>.
    │ │ │ +<<1,2,3>>
    │ │ │ +> Bin2 = <<4,5>>.
    │ │ │ +<<4,5>>
    │ │ │ +> Bin3 = <<6>>.
    │ │ │ +<<6>>
    │ │ │  %% If you pass small binaries and integers it works as iolist_to_binary
    │ │ │ -> erlang:iolist_to_iovec([Bin1,1,[2,3,Bin2],4|Bin3]).
    │ │ │ -[<<1,2,3,1,2,3,4,5,4,6>>]
    │ │ │ +> erlang:iolist_to_iovec([Bin1,1,[2,3,Bin2],4|Bin3]).
    │ │ │ +[<<1,2,3,1,2,3,4,5,4,6>>]
    │ │ │  %% If you pass larger binaries, they are split and returned in a form
    │ │ │  %% optimized for calling the C function writev.
    │ │ │ -> erlang:iolist_to_iovec([<<1>>,<<2:8096>>,<<3:8096>>]).
    │ │ │ -[<<1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    │ │ │ -   0,...>>,
    │ │ │ - <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    │ │ │ -   ...>>,
    │ │ │ - <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...>>]
    │ │ │ +>
    erlang:iolist_to_iovec([<<1>>,<<2:8096>>,<<3:8096>>]). │ │ │ +[<<1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, │ │ │ + 0,...>>, │ │ │ + <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, │ │ │ + ...>>, │ │ │ + <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...>>]
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -10253,19 +10253,19 @@ │ │ │
    │ │ │ │ │ │
    -spec is_map_key(Key, Map) -> boolean() when Key :: term(), Map :: map().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns true if map Map contains Key and returns false if it does not │ │ │ -contain the Key.

    The call fails with a {badmap,Map} exception if Map is not a map.

    Example:

    > Map = #{"42" => value}.
    │ │ │ -#{"42" => value}
    │ │ │ -> is_map_key("42",Map).
    │ │ │ +contain the Key.

    The call fails with a {badmap,Map} exception if Map is not a map.

    Example:

    > Map = #{"42" => value}.
    │ │ │ +#{"42" => value}
    │ │ │ +> is_map_key("42",Map).
    │ │ │  true
    │ │ │ -> is_map_key(value,Map).
    │ │ │ +> is_map_key(value,Map).
    │ │ │  false
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -10508,15 +10508,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec length(List) -> non_neg_integer() when List :: [term()].
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns the length of List.

    For example:

    > length([1,2,3,4,5,6,7,8,9]).
    │ │ │ +

    Returns the length of List.

    For example:

    > length([1,2,3,4,5,6,7,8,9]).
    │ │ │  9
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -10546,15 +10546,15 @@ │ │ │ Unicode characters above 255.

    Note

    The number of characters that are permitted in an atom name is limited. The │ │ │ default limits can be found in the │ │ │ efficiency guide (section System Limits).

    Note

    There is a configurable limit │ │ │ on how many atoms that can exist and atoms are not │ │ │ garbage collected. Therefore, it is recommended to consider if │ │ │ list_to_existing_atom/1 is a better option than │ │ │ list_to_atom/1. The default limits can be found in the │ │ │ -Efficiency Guide (section System Limits).

    Example:

    > list_to_atom("Erlang").
    │ │ │ +Efficiency Guide (section System Limits).

    Example:

    > list_to_atom("Erlang").
    │ │ │  'Erlang'
    │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -10575,22 +10575,22 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec list_to_binary(IoList) -> binary() when IoList :: iolist().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns a binary that is made from the integers and binaries in IoList.

    For example:

    > Bin1 = <<1,2,3>>.
    │ │ │ -<<1,2,3>>
    │ │ │ -> Bin2 = <<4,5>>.
    │ │ │ -<<4,5>>
    │ │ │ -> Bin3 = <<6>>.
    │ │ │ -<<6>>
    │ │ │ -> list_to_binary([Bin1,1,[2,3,Bin2],4|Bin3]).
    │ │ │ -<<1,2,3,1,2,3,4,5,4,6>>
    │ │ │ +

    Returns a binary that is made from the integers and binaries in IoList.

    For example:

    > Bin1 = <<1,2,3>>.
    │ │ │ +<<1,2,3>>
    │ │ │ +> Bin2 = <<4,5>>.
    │ │ │ +<<4,5>>
    │ │ │ +> Bin3 = <<6>>.
    │ │ │ +<<6>>
    │ │ │ +> list_to_binary([Bin1,1,[2,3,Bin2],4|Bin3]).
    │ │ │ +<<1,2,3,1,2,3,4,5,4,6>>
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns a bitstring that is made from the integers and bitstrings in │ │ │ BitstringList. (The last tail in BitstringList is allowed to be a │ │ │ -bitstring.)

    For example:

    > Bin1 = <<1,2,3>>.
    │ │ │ -<<1,2,3>>
    │ │ │ -> Bin2 = <<4,5>>.
    │ │ │ -<<4,5>>
    │ │ │ -> Bin3 = <<6,7:4>>.
    │ │ │ -<<6,7:4>>
    │ │ │ -> list_to_bitstring([Bin1,1,[2,3,Bin2],4|Bin3]).
    │ │ │ -<<1,2,3,1,2,3,4,5,4,6,7:4>>
    │ │ │ +bitstring.)

    For example:

    > Bin1 = <<1,2,3>>.
    │ │ │ +<<1,2,3>>
    │ │ │ +> Bin2 = <<4,5>>.
    │ │ │ +<<4,5>>
    │ │ │ +> Bin3 = <<6,7:4>>.
    │ │ │ +<<6,7:4>>
    │ │ │ +> list_to_bitstring([Bin1,1,[2,3,Bin2],4|Bin3]).
    │ │ │ +<<1,2,3,1,2,3,4,5,4,6,7:4>>
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -10683,15 +10683,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec list_to_float(String) -> float() when String :: string().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns the float whose text representation is String.

    For example:

    > list_to_float("2.2017764e+0").
    │ │ │ +

    Returns the float whose text representation is String.

    For example:

    > list_to_float("2.2017764e+0").
    │ │ │  2.2017764

    The float string format is the same as the format for │ │ │ Erlang float literals except for that underscores │ │ │ are not permitted.

    Failure: badarg if String contains a bad representation of a float.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -10714,17 +10714,17 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec list_to_integer(String) -> integer() when String :: string().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns an integer whose text representation is String.

    For example:

    > list_to_integer("123").
    │ │ │ -123
    > list_to_integer("-123").
    │ │ │ --123
    > list_to_integer("+123234982304982309482093833234234").
    │ │ │ +

    Returns an integer whose text representation is String.

    For example:

    > list_to_integer("123").
    │ │ │ +123
    > list_to_integer("-123").
    │ │ │ +-123
    > list_to_integer("+123234982304982309482093833234234").
    │ │ │  123234982304982309482093833234234

    String must contain at least one digit character and can have an optional │ │ │ prefix consisting of a single "+" or "-" character (that is, String must │ │ │ match the regular expression "^[+-]?[0-9]+$").

    Failure: badarg if String contains a bad representation of an integer.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -10747,19 +10747,19 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec list_to_integer(String, Base) -> integer() when String :: string(), Base :: 2..36.
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns an integer whose text representation in base Base is String.

    For example:

    > list_to_integer("3FF", 16).
    │ │ │ -1023
    > list_to_integer("+3FF", 16).
    │ │ │ -1023
    > list_to_integer("3ff", 16).
    │ │ │ -1023
    > list_to_integer("3fF", 16).
    │ │ │ -1023
    > list_to_integer("-3FF", 16).
    │ │ │ +

    Returns an integer whose text representation in base Base is String.

    For example:

    > list_to_integer("3FF", 16).
    │ │ │ +1023
    > list_to_integer("+3FF", 16).
    │ │ │ +1023
    > list_to_integer("3ff", 16).
    │ │ │ +1023
    > list_to_integer("3fF", 16).
    │ │ │ +1023
    > list_to_integer("-3FF", 16).
    │ │ │  -1023

    For example, when Base is 16, String must match the regular expression │ │ │ "^[+-]?([0-9]|[A-F]|[a-f])+$".

    Failure: badarg if String contains a bad representation of an integer.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -10781,15 +10781,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec list_to_pid(String) -> pid() when String :: string().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns a process identifier whose text representation is a String.

    For example:

    > list_to_pid("<0.4.1>").
    │ │ │ +

    Returns a process identifier whose text representation is a String.

    For example:

    > list_to_pid("<0.4.1>").
    │ │ │  <0.4.1>

    Failure: badarg if String contains a bad representation of a process │ │ │ identifier.

    Warning

    This BIF is intended for debugging and is not to be used in application │ │ │ programs.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -10814,15 +10814,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec list_to_port(String) -> port() when String :: string().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns a port identifier whose text representation is a String.

    For example:

    > list_to_port("#Port<0.4>").
    │ │ │ +

    Returns a port identifier whose text representation is a String.

    For example:

    > list_to_port("#Port<0.4>").
    │ │ │  #Port<0.4>

    Failure: badarg if String contains a bad representation of a port │ │ │ identifier.

    Warning

    This BIF is intended for debugging and is not to be used in application │ │ │ programs.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -10847,15 +10847,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec list_to_ref(String) -> reference() when String :: string().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns a reference whose text representation is a String.

    For example:

    > list_to_ref("#Ref<0.4192537678.4073193475.71181>").
    │ │ │ +

    Returns a reference whose text representation is a String.

    For example:

    > list_to_ref("#Ref<0.4192537678.4073193475.71181>").
    │ │ │  #Ref<0.4192537678.4073193475.71181>

    Failure: badarg if String contains a bad representation of a reference.

    Warning

    This BIF is intended for debugging and is not to be used in application │ │ │ programs.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -10877,16 +10877,16 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec list_to_tuple(List) -> tuple() when List :: [term()].
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns a tuple corresponding to List, for example

    > list_to_tuple([share, ['Ericsson_B', 163]]).
    │ │ │ -{share, ['Ericsson_B', 163]}

    List can contain any Erlang terms.

    │ │ │ +

    Returns a tuple corresponding to List, for example

    > list_to_tuple([share, ['Ericsson_B', 163]]).
    │ │ │ +{share, ['Ericsson_B', 163]}

    List can contain any Erlang terms.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -10936,16 +10936,16 @@ │ │ │
    │ │ │ │ │ │
    -spec make_tuple(Arity, InitialValue) -> tuple() when Arity :: arity(), InitialValue :: term().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Creates a new tuple of the specified Arity, where all elements are │ │ │ -InitialValue.

    For example:

    > erlang:make_tuple(4, []).
    │ │ │ -{[],[],[],[]}
    │ │ │ +InitialValue.

    For example:

    > erlang:make_tuple(4, []).
    │ │ │ +{[],[],[],[]}
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Creates a tuple of size Arity, where each element has value DefaultValue, │ │ │ and then fills in values from InitList.

    Each list element in InitList must be a two-tuple, where the first element is │ │ │ a position in the newly created tuple and the second element is any term. If a │ │ │ position occurs more than once in the list, the term corresponding to the last │ │ │ -occurrence is used.

    For example:

    > erlang:make_tuple(5, [], [{2,ignored},{5,zz},{2,aa}]).
    │ │ │ -{[],aa,[],[],zz}
    │ │ │ +occurrence is used.

    For example:

    > erlang:make_tuple(5, [], [{2,ignored},{5,zz},{2,aa}]).
    │ │ │ +{[],aa,[],[],zz}
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns value Value associated with Key if Map contains Key.

    The call fails with a {badmap,Map} exception if Map is not a map, or with a │ │ │ {badkey,Key} exception if no value is associated with Key.

    Example:

    > Key = 1337,
    │ │ │ -  Map = #{42 => value_two,1337 => "value one","a" => 1},
    │ │ │ -  map_get(Key,Map).
    │ │ │ +  Map = #{42 => value_two,1337 => "value one","a" => 1},
    │ │ │ +  map_get(Key,Map).
    │ │ │  "value one"
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -11040,15 +11040,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ -

    Returns an integer, which is the number of key-value pairs in Map.

    For example:

    > map_size(#{a=>1, b=>2, c=>3}).
    │ │ │ +

    Returns an integer, which is the number of key-value pairs in Map.

    For example:

    > map_size(#{a=>1, b=>2, c=>3}).
    │ │ │  3
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns the largest of Term1 and Term2. If the terms compare equal with the │ │ │ == operator, Term1 is returned.

    The Expressions section contains │ │ │ -descriptions of the == operator and how terms are ordered.

    Examples:

    > max(1, 2).
    │ │ │ -2
    > max(1.0, 1).
    │ │ │ -1.0
    > max(1, 1.0).
    │ │ │ -1
    > max("abc", "b").
    │ │ │ +descriptions of the == operator and how terms are ordered.

    Examples:

    > max(1, 2).
    │ │ │ +2
    > max(1.0, 1).
    │ │ │ +1.0
    > max(1, 1.0).
    │ │ │ +1
    > max("abc", "b").
    │ │ │  "b"

    Change

    Allowed in guards tests from Erlang/OTP 26.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns the smallest of Term1 and Term2. If the terms compare equal with the │ │ │ == operator, Term1 is returned.

    The Expressions section contains │ │ │ -descriptions of the == operator and how terms are ordered.

    Examples:

    > min(1, 2).
    │ │ │ -1
    > min(1.0, 1).
    │ │ │ -1.0
    > min(1, 1.0).
    │ │ │ -1
    > min("abc", "b").
    │ │ │ +descriptions of the == operator and how terms are ordered.

    Examples:

    > min(1, 2).
    │ │ │ +1
    > min(1.0, 1).
    │ │ │ +1.0
    > min(1, 1.0).
    │ │ │ +1
    > min("abc", "b").
    │ │ │  "abc"

    Change

    Allowed in guards tests from Erlang/OTP 26.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -11276,15 +11276,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec pid_to_list(Pid) -> string() when Pid :: pid().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns a string corresponding to the text representation of Pid.

    For example:

    > erlang:pid_to_list(self()).
    │ │ │ +

    Returns a string corresponding to the text representation of Pid.

    For example:

    > erlang:pid_to_list(self()).
    │ │ │  "<0.85.0>"

    Note

    The creation for the node is not included in the list │ │ │ representation of Pid. This means that processes in different incarnations │ │ │ of a node with a specific name can get the same list representation.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -11367,18 +11367,18 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec round(Number) -> integer() when Number :: number().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns an integer by rounding Number.

    For example:

    round(42.1).
    │ │ │ -42
    round(5.5).
    │ │ │ -6
    round(-5.5).
    │ │ │ --6
    round(36028797018963969.0).
    │ │ │ +

    Returns an integer by rounding Number.

    For example:

    round(42.1).
    │ │ │ +42
    round(5.5).
    │ │ │ +6
    round(-5.5).
    │ │ │ +-6
    round(36028797018963969.0).
    │ │ │  36028797018963968

    In the last example, round(36028797018963969.0) evaluates to │ │ │ 36028797018963968. The reason for this is that the number │ │ │ 36028797018963969.0 cannot be represented exactly as a float value. Instead, │ │ │ the float literal is represented as 36028797018963968.0, which is the closest │ │ │ number that can be represented exactly as a float value. See │ │ │ Representation of Floating Point Numbers │ │ │ for additional information.

    │ │ │ @@ -11408,16 +11408,16 @@ │ │ │
    -spec setelement(Index, Tuple1, Value) -> Tuple2
    │ │ │                      when Index :: pos_integer(), Tuple1 :: tuple(), Tuple2 :: tuple(), Value :: term().
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns a tuple that is a copy of argument Tuple1 with the element specified │ │ │ by integer argument Index (the first element is the element with index 1) │ │ │ -replaced by argument Value.

    For example:

    > setelement(2, {10, green, bottles}, red).
    │ │ │ -{10,red,bottles}
    │ │ │ +replaced by argument Value.

    For example:

    > setelement(2, {10, green, bottles}, red).
    │ │ │ +{10,red,bottles}
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -11440,17 +11440,17 @@ │ │ │
    │ │ │ │ │ │
    -spec size(Item) -> non_neg_integer() when Item :: tuple() | binary().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns the number of elements in a tuple or the number of bytes in a binary or │ │ │ -bitstring.

    For example:

    > size({morni, mulle, bwange}).
    │ │ │ +bitstring.

    For example:

    > size({morni, mulle, bwange}).
    │ │ │  3
    │ │ │ -> size(<<11, 22, 33>>).
    │ │ │ +> size(<<11, 22, 33>>).
    │ │ │  3

    For bitstrings, the number of whole bytes is returned. That is, if the number of │ │ │ bits in the bitstring is not divisible by 8, the resulting number of bytes is │ │ │ rounded down.

    See also tuple_size/1, byte_size/1, and bit_size/1.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -11474,23 +11474,23 @@ │ │ │
    │ │ │ │ │ │
    -spec split_binary(Bin, Pos) -> {binary(), binary()} when Bin :: binary(), Pos :: non_neg_integer().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns a tuple containing the binaries that are the result of splitting Bin │ │ │ -into two parts at position Pos.

    This is not a destructive operation. After the operation, there are three binaries altogether.

    For example:

    > B = list_to_binary("0123456789").
    │ │ │ -<<"0123456789">>
    │ │ │ -> byte_size(B).
    │ │ │ +into two parts at position Pos.

    This is not a destructive operation. After the operation, there are three binaries altogether.

    For example:

    > B = list_to_binary("0123456789").
    │ │ │ +<<"0123456789">>
    │ │ │ +> byte_size(B).
    │ │ │  10
    │ │ │ -> {B1, B2} = split_binary(B,3).
    │ │ │ -{<<"012">>,<<"3456789">>}
    │ │ │ -> byte_size(B1).
    │ │ │ +> {B1, B2} = split_binary(B,3).
    │ │ │ +{<<"012">>,<<"3456789">>}
    │ │ │ +> byte_size(B1).
    │ │ │  3
    │ │ │ -> byte_size(B2).
    │ │ │ +> byte_size(B2).
    │ │ │  7
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns a binary data object that is the result of encoding Term according to │ │ │ the Erlang external term format.

    This can be used for various purposes, for example, writing a term to a file in │ │ │ an efficient way, or sending an Erlang term to some type of communications │ │ │ -channel not supported by distributed Erlang.

    > Bin = term_to_binary(hello).
    │ │ │ -<<131,100,0,5,104,101,108,108,111>>
    │ │ │ -> hello = binary_to_term(Bin).
    │ │ │ +channel not supported by distributed Erlang.

    > Bin = term_to_binary(hello).
    │ │ │ +<<131,100,0,5,104,101,108,108,111>>
    │ │ │ +> hello = binary_to_term(Bin).
    │ │ │  hello

    See also binary_to_term/1.

    Note

    There is no guarantee that this function will return the same encoded │ │ │ representation for the same term.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -11741,18 +11741,18 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec tl(List) -> Tail when List :: nonempty_maybe_improper_list(), Tail :: term().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns the tail of List, that is, the list minus the first element

    It works with improper lists.

    Examples:

    > tl([geesties, guilies, beasties]).
    │ │ │ -[guilies, beasties]
    > tl([geesties]).
    │ │ │ -[]
    > tl([geesties, guilies, beasties | improper_end]).
    │ │ │ -[guilies, beasties | improper_end]
    > tl([geesties | improper_end]).
    │ │ │ +

    Returns the tail of List, that is, the list minus the first element

    It works with improper lists.

    Examples:

    > tl([geesties, guilies, beasties]).
    │ │ │ +[guilies, beasties]
    > tl([geesties]).
    │ │ │ +[]
    > tl([geesties, guilies, beasties | improper_end]).
    │ │ │ +[guilies, beasties | improper_end]
    > tl([geesties | improper_end]).
    │ │ │  improper_end

    Failure: badarg if List is an empty list [].

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -11775,18 +11775,18 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec trunc(Number) -> integer() when Number :: number().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Truncates the decimals of Number.

    For example:

    > trunc(5.7).
    │ │ │ -5
    > trunc(-5.7).
    │ │ │ --5
    > trunc(5).
    │ │ │ -5
    > trunc(36028797018963969.0).
    │ │ │ +

    Truncates the decimals of Number.

    For example:

    > trunc(5.7).
    │ │ │ +5
    > trunc(-5.7).
    │ │ │ +-5
    > trunc(5).
    │ │ │ +5
    > trunc(36028797018963969.0).
    │ │ │  36028797018963968

    In the last example, trunc(36028797018963969.0) evaluates to │ │ │ 36028797018963968. The reason for this is that the number │ │ │ 36028797018963969.0 cannot be represented exactly as a float value. Instead, │ │ │ the float literal is represented as 36028797018963968.0, which is the closest │ │ │ number that can be represented exactly as a float value. See │ │ │ Representation of Floating Point Numbers │ │ │ for additional information.

    │ │ │ @@ -11815,15 +11815,15 @@ │ │ │ │ │ │
    │ │ │ │ │ │
    -spec tuple_size(Tuple) -> non_neg_integer() when Tuple :: tuple().
    │ │ │ │ │ │
    │ │ │ │ │ │ -

    Returns an integer that is the number of elements in Tuple.

    For example:

    > tuple_size({morni, mulle, bwange}).
    │ │ │ +

    Returns an integer that is the number of elements in Tuple.

    For example:

    > tuple_size({morni, mulle, bwange}).
    │ │ │  3
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -11845,16 +11845,16 @@ │ │ │
    │ │ │ │ │ │
    -spec tuple_to_list(Tuple) -> [term()] when Tuple :: tuple().
    │ │ │ │ │ │
    │ │ │ │ │ │

    Returns a list corresponding to Tuple. Tuple can contain any Erlang terms. │ │ │ -Example:

    > tuple_to_list({share, {'Ericsson_B', 163}}).
    │ │ │ -[share,{'Ericsson_B',163}]
    │ │ │ +Example:

    > tuple_to_list({share, {'Ericsson_B', 163}}).
    │ │ │ +[share,{'Ericsson_B',163}]
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ @@ -12009,35 +12009,35 @@ │ │ │ │ │ │

    Create an alias which can be used when sending messages to the process that │ │ │ created the alias. When the alias has been deactivated, messages sent using the │ │ │ alias will be dropped. An alias can be deactivated using unalias/1.

    Currently available options for alias/1:

    • explicit_unalias - The alias can only be deactivated via a call to │ │ │ unalias/1. This is also the default behaviour if no options │ │ │ are passed or if alias/0 is called.

    • reply - The alias will be automatically deactivated when a reply message │ │ │ sent via the alias is received. The alias can also still be deactivated via a │ │ │ -call to unalias/1.

    Example:

    server() ->
    │ │ │ +call to unalias/1.

    Example:

    server() ->
    │ │ │      receive
    │ │ │ -        {request, AliasReqId, Request} ->
    │ │ │ -            Result = perform_request(Request),
    │ │ │ -            AliasReqId ! {reply, AliasReqId, Result}
    │ │ │ +        {request, AliasReqId, Request} ->
    │ │ │ +            Result = perform_request(Request),
    │ │ │ +            AliasReqId ! {reply, AliasReqId, Result}
    │ │ │      end,
    │ │ │ -    server().
    │ │ │ +    server().
    │ │ │  
    │ │ │ -client(ServerPid, Request) ->
    │ │ │ -    AliasReqId = alias([reply]),
    │ │ │ -    ServerPid ! {request, AliasReqId, Request},
    │ │ │ +client(ServerPid, Request) ->
    │ │ │ +    AliasReqId = alias([reply]),
    │ │ │ +    ServerPid ! {request, AliasReqId, Request},
    │ │ │      %% Alias will be automatically deactivated if we receive a reply
    │ │ │      %% since we used the 'reply' option...
    │ │ │      receive
    │ │ │ -        {reply, AliasReqId, Result} -> Result
    │ │ │ +        {reply, AliasReqId, Result} -> Result
    │ │ │      after 5000 ->
    │ │ │ -            unalias(AliasReqId),
    │ │ │ +            unalias(AliasReqId),
    │ │ │              %% Flush message queue in case the reply arrived
    │ │ │              %% just before the alias was deactivated...
    │ │ │ -            receive {reply, AliasReqId, Result} -> Result
    │ │ │ -            after 0 -> exit(timeout)
    │ │ │ +            receive {reply, AliasReqId, Result} -> Result
    │ │ │ +            after 0 -> exit(timeout)
    │ │ │              end
    │ │ │      end.

    Note that both the server and the client in this example must be executing on at │ │ │ least OTP 24 systems in order for this to work.

    For more information on process aliases see the │ │ │ Process Aliases section of │ │ │ the Erlang Reference Manual.

    │ │ │
    │ │ │ │ │ │ @@ -12096,17 +12096,17 @@ │ │ │
    -spec apply(Module, Function, Args) -> term()
    │ │ │                 when Module :: module(), Function :: atom(), Args :: [term()].
    │ │ │ │ │ │ │ │ │ │ │ │

    Returns the result of applying Function in Module to Args. The applied │ │ │ function must be exported from Module. The arity of the function is the length │ │ │ -of Args.

    For example:

    > apply(lists, reverse, [[a, b, c]]).
    │ │ │ -[c,b,a]
    │ │ │ -> apply(erlang, atom_to_list, ['Erlang']).
    │ │ │ +of Args.

    For example:

    > apply(lists, reverse, [[a, b, c]]).
    │ │ │ +[c,b,a]
    │ │ │ +> apply(erlang, atom_to_list, ['Erlang']).
    │ │ │  "Erlang"

    If the number of arguments are known at compile time, the call is better written │ │ │ as Module:Function(Arg1, Arg2, ..., ArgN).

    Failure: error_handler:undefined_function/3 is called if the applied function │ │ │ is not exported. The error handler can be redefined (see process_flag/2). If │ │ │ error_handler is undefined, or if the user has redefined the default │ │ │ error_handler so the replacement module is undefined, an error with reason │ │ │ undef is generated.

    │ │ │ │ │ │ @@ -12213,17 +12213,17 @@ │ │ │ when MonitorRef :: reference(), OptionList :: [Option], Option :: flush | info.
    │ │ │ │ │ │ │ │ │ │ │ │

    The returned value is true unless info is part of OptionList.

    demonitor(MonitorRef, []) is equivalent to │ │ │ demonitor(MonitorRef).

    Options:

    • flush - Removes (one) {_, MonitorRef, _, _, _} message, if there is │ │ │ one, from the caller message queue after monitoring has been stopped.

      Calling demonitor(MonitorRef, [flush]) is equivalent to the │ │ │ -following, but more efficient:

      demonitor(MonitorRef),
      │ │ │ +following, but more efficient:

      demonitor(MonitorRef),
      │ │ │  receive
      │ │ │ -    {_, MonitorRef, _, _, _} ->
      │ │ │ +    {_, MonitorRef, _, _, _} ->
      │ │ │          true
      │ │ │  after 0 ->
      │ │ │          true
      │ │ │  end
    • info - The returned value is one of the following:

      • true - The monitor was found and removed. In this case, no 'DOWN' │ │ │ message corresponding to this monitor has been delivered and will not be │ │ │ delivered.

      • false - The monitor was not found and could not be removed. This │ │ │ probably because someone already has placed a 'DOWN' message corresponding │ │ │ @@ -12252,18 +12252,18 @@ │ │ │ │ │ │

        │ │ │ │ │ │
        -spec erase() -> [{Key, Val}] when Key :: term(), Val :: term().
        │ │ │ │ │ │
        │ │ │ │ │ │ -

        Returns the process dictionary and deletes it.

        For example:

        > put(key1, {1, 2, 3}),
        │ │ │ -put(key2, [a, b, c]),
        │ │ │ -erase().
        │ │ │ -[{key1,{1,2,3}},{key2,[a,b,c]}]
        │ │ │ +

        Returns the process dictionary and deletes it.

        For example:

        > put(key1, {1, 2, 3}),
        │ │ │ +put(key2, [a, b, c]),
        │ │ │ +erase().
        │ │ │ +[{key1,{1,2,3}},{key2,[a,b,c]}]
        │ │ │ │ │ │ │ │ │
        │ │ │ │ │ │ │ │ │ │ │ │

        Returns the value Val associated with Key and deletes it from the process │ │ │ dictionary. Returns undefined if no value is associated with Key.

        The average time complexity for the current implementation of this function is │ │ │ O(1) and the worst case time complexity is O(N), where N is the number of │ │ │ -items in the process dictionary.

        For example:

        > put(key1, {merry, lambs, are, playing}),
        │ │ │ -X = erase(key1),
        │ │ │ -{X, erase(key1)}.
        │ │ │ -{{merry,lambs,are,playing},undefined}
        │ │ │ +items in the process dictionary.

        For example:

        > put(key1, {merry, lambs, are, playing}),
        │ │ │ +X = erase(key1),
        │ │ │ +{X, erase(key1)}.
        │ │ │ +{{merry,lambs,are,playing},undefined}
        │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │ │ │ │ │ │ │

        Raises an exception of class error with the reason Reason.

        As evaluating this function causes an exception to be thrown, it has no return value.

        The intent of the exception class error is to signal that an unexpected error │ │ │ has happened (for example, a function is called with a parameter that has an │ │ │ incorrect type). See the guide about │ │ │ errors and error handling for additional information. │ │ │ -Example:

        > catch error(foobar).
        │ │ │ -{'EXIT',{foobar,[{shell,apply_fun,3,
        │ │ │ -                        [{file,"shell.erl"},{line,906}]},
        │ │ │ -                 {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,677}]},
        │ │ │ -                 {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,430}]},
        │ │ │ -                 {shell,exprs,7,[{file,"shell.erl"},{line,687}]},
        │ │ │ -                 {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]},
        │ │ │ -                 {shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}]}}
        │ │ │ +Example:

        > catch error(foobar).
        │ │ │ +{'EXIT',{foobar,[{shell,apply_fun,3,
        │ │ │ +                        [{file,"shell.erl"},{line,906}]},
        │ │ │ +                 {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,677}]},
        │ │ │ +                 {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,430}]},
        │ │ │ +                 {shell,exprs,7,[{file,"shell.erl"},{line,687}]},
        │ │ │ +                 {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]},
        │ │ │ +                 {shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}]}}
        │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │ │ │ │ @@ -12365,21 +12365,21 @@ │ │ │ none.

        If Args is a list, it is used to provide the arguments for the current │ │ │ function in the stack back-trace. If it is none, the arity of the calling │ │ │ function is used in the stacktrace. As evaluating this function causes an │ │ │ exception to be raised, it has no return value.

        The intent of the exception class error is to signal that an unexpected error │ │ │ has happened (for example, a function is called with a parameter that has an │ │ │ incorrect type). See the guide about │ │ │ errors and error handling for additional information. │ │ │ -Example:

        test.erl:

        -module(test).
        │ │ │ --export([example_fun/2]).
        │ │ │ +Example:

        test.erl:

        -module(test).
        │ │ │ +-export([example_fun/2]).
        │ │ │  
        │ │ │ -example_fun(A1, A2) ->
        │ │ │ -    erlang:error(my_error, [A1, A2]).

        Erlang shell:

        6> c(test).
        │ │ │ -{ok,test}
        │ │ │ -7> test:example_fun(arg1,"this is the second argument").
        │ │ │ +example_fun(A1, A2) ->
        │ │ │ +    erlang:error(my_error, [A1, A2]).

        Erlang shell:

        6> c(test).
        │ │ │ +{ok,test}
        │ │ │ +7> test:example_fun(arg1,"this is the second argument").
        │ │ │  ** exception error: my_error
        │ │ │       in function  test:example_fun/2
        │ │ │           called as test:example_fun(arg1,"this is the second argument")
        │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │ @@ -12456,18 +12456,18 @@ │ │ │ │ │ │ │ │ │ │ │ │

        Raises an exception of class exit with exit reason Reason.

        As evaluating this function causes an exception to be raised, it has no return value.

        The intent of the exception class exit is that the current process should be │ │ │ stopped (for example when a message telling a process to stop is received).

        This function differ from error/1,2,3 by causing an exception of │ │ │ a different class and by having a reason that does not include the list of │ │ │ functions from the call stack.

        See the guide about errors and error handling for │ │ │ -additional information.

        Example:

        > exit(foobar).
        │ │ │ +additional information.

        Example:

        > exit(foobar).
        │ │ │  ** exception exit: foobar
        │ │ │ -> catch exit(foobar).
        │ │ │ -{'EXIT',foobar}

        Note

        If a process calls exit(kill) and does not catch the exception, │ │ │ +> catch exit(foobar). │ │ │ +{'EXIT',foobar}

        Note

        If a process calls exit(kill) and does not catch the exception, │ │ │ it will terminate with exit reason kill and also emit exit signals with exit │ │ │ reason kill (not killed) to all linked processes. Such exit signals with │ │ │ exit reason kill can be trapped by the linked processes. Note that this │ │ │ means that signals with exit reason kill behave differently depending on how │ │ │ they are sent because the signal will be untrappable if a process sends such a │ │ │ signal to another process with erlang:exit/2.

        │ │ │
        │ │ │ @@ -12660,19 +12660,19 @@ │ │ │
        │ │ │ │ │ │
        -spec get() -> [{Key, Val}] when Key :: term(), Val :: term().
        │ │ │ │ │ │
        │ │ │ │ │ │

        Returns the process dictionary as a list of {Key, Val} tuples. The items in │ │ │ -the returned list can be in any order.

        For example:

        > put(key1, merry),
        │ │ │ -put(key2, lambs),
        │ │ │ -put(key3, {are, playing}),
        │ │ │ -get().
        │ │ │ -[{key1,merry},{key2,lambs},{key3,{are,playing}}]
        │ │ │ +the returned list can be in any order.

        For example:

        > put(key1, merry),
        │ │ │ +put(key2, lambs),
        │ │ │ +put(key3, {are, playing}),
        │ │ │ +get().
        │ │ │ +[{key1,merry},{key2,lambs},{key3,{are,playing}}]
        │ │ │ │ │ │ │ │ │
        │ │ │ │ │ │ │ │ │ │ │ │

        Returns the value Val associated with Key in the process dictionary, or │ │ │ undefined if Key does not exist.

        The expected time complexity for the current implementation of this function is │ │ │ O(1) and the worst case time complexity is O(N), where N is the number of │ │ │ -items in the process dictionary.

        For example:

        > put(key1, merry),
        │ │ │ -put(key2, lambs),
        │ │ │ -put({any, [valid, term]}, {are, playing}),
        │ │ │ -get({any, [valid, term]}).
        │ │ │ -{are,playing}
        │ │ │ +items in the process dictionary.

        For example:

        > put(key1, merry),
        │ │ │ +put(key2, lambs),
        │ │ │ +put({any, [valid, term]}, {are, playing}),
        │ │ │ +get({any, [valid, term]}).
        │ │ │ +{are,playing}
        │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │ │ │ │ @@ -12730,19 +12730,19 @@ │ │ │ │ │ │ │ │ │

        Returns a list of all keys present in the process dictionary. The items in the │ │ │ -returned list can be in any order.

        For example:

        > put(dog, {animal,1}),
        │ │ │ -put(cow, {animal,2}),
        │ │ │ -put(lamb, {animal,3}),
        │ │ │ -get_keys().
        │ │ │ -[dog,cow,lamb]
        │ │ │ +returned list can be in any order.

        For example:

        > put(dog, {animal,1}),
        │ │ │ +put(cow, {animal,2}),
        │ │ │ +put(lamb, {animal,3}),
        │ │ │ +get_keys().
        │ │ │ +[dog,cow,lamb]
        │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │ │ │ │ @@ -12763,22 +12763,22 @@ │ │ │ │ │ │ │ │ │

        Returns a list of keys that are associated with the value Val in the process │ │ │ -dictionary. The items in the returned list can be in any order.

        For example:

        > put(mary, {1, 2}),
        │ │ │ -put(had, {1, 2}),
        │ │ │ -put(a, {1, 2}),
        │ │ │ -put(little, {1, 2}),
        │ │ │ -put(dog, {1, 3}),
        │ │ │ -put(lamb, {1, 2}),
        │ │ │ -get_keys({1, 2}).
        │ │ │ -[mary,had,a,little,lamb]
        │ │ │ +dictionary. The items in the returned list can be in any order.

        For example:

        > put(mary, {1, 2}),
        │ │ │ +put(had, {1, 2}),
        │ │ │ +put(a, {1, 2}),
        │ │ │ +put(little, {1, 2}),
        │ │ │ +put(dog, {1, 3}),
        │ │ │ +put(lamb, {1, 2}),
        │ │ │ +get_keys({1, 2}).
        │ │ │ +[mary,had,a,little,lamb]
        │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │ │ │ │ @@ -12925,17 +12925,17 @@ │ │ │

        Pid must refer to a process at the local node.

        Returns true if the process exists and is alive, that is, is not exiting and │ │ │ has not exited. Otherwise returns false.

        If process P1 calls is_process_alive(P2Pid) it is │ │ │ guaranteed that all signals, sent from P1 to P2 (P2 is the process with │ │ │ identifier P2Pid) before the call, will be delivered to P2 before the │ │ │ aliveness of P2 is checked. This guarantee means that one can use │ │ │ is_process_alive/1 to let a process P1 wait until a │ │ │ process P2, which has got an exit signal with reason kill from P1, is │ │ │ -killed.

        For example:

        exit(P2Pid, kill),
        │ │ │ +killed.

        For example:

        exit(P2Pid, kill),
        │ │ │  % P2 might not be killed
        │ │ │ -is_process_alive(P2Pid),
        │ │ │ +is_process_alive(P2Pid),
        │ │ │  % P2 is not alive (the call above always return false)

        See the documentation about signals │ │ │ and erlang:exit/2 for more information about signals and exit │ │ │ signals.

        │ │ │
        │ │ │ │ │ │
        │ │ │ │ │ │ @@ -13016,24 +13016,24 @@ │ │ │
        -spec monitor(process, monitor_process_identifier()) -> MonitorRef when MonitorRef :: reference();
        │ │ │               (port, monitor_port_identifier()) -> MonitorRef when MonitorRef :: reference();
        │ │ │               (time_offset, clock_service) -> MonitorRef when MonitorRef :: reference().
        │ │ │ │ │ │ │ │ │ │ │ │

        Sends a monitor request of type Type to the entity identified by Item.

        If the monitored entity does not exist or it changes monitored state, the caller │ │ │ -of monitor/2 is notified by a message on the following format:

        {Tag, MonitorRef, Type, Object, Info}

        Note

        The monitor request is an asynchronous signal. That is, it takes time before │ │ │ +of monitor/2 is notified by a message on the following format:

        {Tag, MonitorRef, Type, Object, Info}

        Note

        The monitor request is an asynchronous signal. That is, it takes time before │ │ │ the signal reaches its destination.

        Type can be one of the following atoms: process, port or time_offset.

        A process or port monitor is triggered only once, after that it is removed │ │ │ from both monitoring process and the monitored entity. Monitors are fired when │ │ │ the monitored process or port terminates, does not exist at the moment of │ │ │ creation, or if the connection to it is lost. If the connection to it is lost, │ │ │ we do not know if it still exists. The monitoring is also turned off when │ │ │ demonitor/1 is called.

        A process or port monitor by name resolves the RegisteredName to pid/0 │ │ │ or port/0 only once at the moment of monitor instantiation, later changes to │ │ │ the name registration will not affect the existing monitor.

        When a process or port monitor is triggered, a 'DOWN' message is sent that │ │ │ -has the following pattern:

        {'DOWN', MonitorRef, Type, Object, Info}

        In the monitor message MonitorRef and Type are the same as described │ │ │ +has the following pattern:

        {'DOWN', MonitorRef, Type, Object, Info}

        In the monitor message MonitorRef and Type are the same as described │ │ │ earlier, and:

        • Object - The monitored entity, which triggered the event. When │ │ │ monitoring a process or a local port, Object will be equal to the pid/0 │ │ │ or port/0 that was being monitored. When monitoring process or port by │ │ │ name, Object will have format {RegisteredName, Node} where │ │ │ RegisteredName is the name which has been used with │ │ │ monitor/2 call and Node is local or remote node name (for │ │ │ ports monitored by name, Node is always local node name).

        • Info - Either the exit reason of the process, noproc (process or port │ │ │ @@ -13069,15 +13069,15 @@ │ │ │ offset is changed when the runtime system detects that the │ │ │ OS system time has changed. The runtime │ │ │ system does, however, not detect this immediately when it occurs. A task │ │ │ checking the time offset is scheduled to execute at least once a minute, so │ │ │ under normal operation this is to be detected within a minute, but during │ │ │ heavy load it can take longer time.

          The monitor is not automatically removed after it has been triggered. That │ │ │ is, repeated changes of the time offset trigger the monitor repeatedly.

          When the monitor is triggered a 'CHANGE' message is sent to the monitoring │ │ │ -process. A 'CHANGE' message has the following pattern:

          {'CHANGE', MonitorRef, Type, Item, NewTimeOffset}

          where MonitorRef, Type, and Item are the same as described above, and │ │ │ +process. A 'CHANGE' message has the following pattern:

          {'CHANGE', MonitorRef, Type, Item, NewTimeOffset}

          where MonitorRef, Type, and Item are the same as described above, and │ │ │ NewTimeOffset is the new time offset.

          When the 'CHANGE' message has been received you are guaranteed not to │ │ │ retrieve the old time offset when calling │ │ │ erlang:time_offset/0. Notice that you can observe the │ │ │ change of the time offset when calling erlang:time_offset/0 before you get │ │ │ the 'CHANGE' message.

          Available since OTP 18.0.

        Making several calls to monitor/2 for the same Item and/or │ │ │ Type is not an error; it results in as many independent monitoring instances.

        The monitor functionality is expected to be extended. That is, other Types and │ │ │ Items are expected to be supported in a future release.

        Note

        If or when monitor/2 is extended, other possible values for │ │ │ @@ -13133,78 +13133,78 @@ │ │ │ via the alias is received. When a reply message is received via the alias │ │ │ the monitor will also be automatically removed. This is useful in │ │ │ client/server scenarios when a client monitors the server and will get the │ │ │ reply via the alias. Once the response is received both the alias and the │ │ │ monitor will be automatically removed regardless of whether the response is │ │ │ a reply or a 'DOWN' message. The alias can also still be deactivated via a │ │ │ call to unalias/1. Note that if the alias is removed using │ │ │ -the unalias/1 BIF, the monitor will still be left active.

      Example:

      server() ->
      │ │ │ +the unalias/1 BIF, the monitor will still be left active.

    Example:

    server() ->
    │ │ │      receive
    │ │ │ -        {request, AliasReqId, Request} ->
    │ │ │ -            Result = perform_request(Request),
    │ │ │ -            AliasReqId ! {reply, AliasReqId, Result}
    │ │ │ +        {request, AliasReqId, Request} ->
    │ │ │ +            Result = perform_request(Request),
    │ │ │ +            AliasReqId ! {reply, AliasReqId, Result}
    │ │ │      end,
    │ │ │ -    server().
    │ │ │ +    server().
    │ │ │  
    │ │ │ -client(ServerPid, Request) ->
    │ │ │ -    AliasMonReqId = monitor(process, ServerPid, [{alias, reply_demonitor}]),
    │ │ │ -    ServerPid ! {request, AliasMonReqId, Request},
    │ │ │ +client(ServerPid, Request) ->
    │ │ │ +    AliasMonReqId = monitor(process, ServerPid, [{alias, reply_demonitor}]),
    │ │ │ +    ServerPid ! {request, AliasMonReqId, Request},
    │ │ │      %% Alias as well as monitor will be automatically deactivated if we
    │ │ │      %% receive a reply or a 'DOWN' message since we used 'reply_demonitor'
    │ │ │      %% as unalias option...
    │ │ │      receive
    │ │ │ -        {reply, AliasMonReqId, Result} ->
    │ │ │ +        {reply, AliasMonReqId, Result} ->
    │ │ │              Result;
    │ │ │ -        {'DOWN', AliasMonReqId, process, ServerPid, ExitReason} ->
    │ │ │ -            error(ExitReason)
    │ │ │ +        {'DOWN', AliasMonReqId, process, ServerPid, ExitReason} ->
    │ │ │ +            error(ExitReason)
    │ │ │      end.

    Note that both the server and the client in this example must be executing on │ │ │ at least OTP 24 systems in order for this to work.

    For more information on process aliases see the │ │ │ Process Aliases section │ │ │ of the Erlang Reference Manual.

  • {tag, UserDefinedTag} - Replace the default Tag with UserDefinedTag │ │ │ in the monitor message delivered when the │ │ │ monitor is triggered. For example, when monitoring a process, the 'DOWN' tag │ │ │ in the down message will be replaced by UserDefinedTag.

    An example of how the {tag, UserDefinedTag} option can be used in order to │ │ │ enable the new │ │ │ selective receive optimization, │ │ │ -introduced in OTP 24, when making multiple requests to different servers:

    server() ->
    │ │ │ +introduced in OTP 24, when making multiple requests to different servers:

    server() ->
    │ │ │      receive
    │ │ │ -        {request, From, ReqId, Request} ->
    │ │ │ -            Result = perform_request(Request),
    │ │ │ -            From ! {reply, self(), ReqId, Result}
    │ │ │ +        {request, From, ReqId, Request} ->
    │ │ │ +            Result = perform_request(Request),
    │ │ │ +            From ! {reply, self(), ReqId, Result}
    │ │ │      end,
    │ │ │ -    server().
    │ │ │ +    server().
    │ │ │  
    │ │ │ -client(ServerPids, Request) when is_list(ServerPids) ->
    │ │ │ -    ReqId = make_ref(),
    │ │ │ -    lists:foreach(fun (ServerPid) ->
    │ │ │ -                          _ = monitor(process, ServerPid,
    │ │ │ -                                      [{tag, {'DOWN', ReqId}}]),
    │ │ │ -                          ServerPid ! {request, self(), ReqId, Request}
    │ │ │ +client(ServerPids, Request) when is_list(ServerPids) ->
    │ │ │ +    ReqId = make_ref(),
    │ │ │ +    lists:foreach(fun (ServerPid) ->
    │ │ │ +                          _ = monitor(process, ServerPid,
    │ │ │ +                                      [{tag, {'DOWN', ReqId}}]),
    │ │ │ +                          ServerPid ! {request, self(), ReqId, Request}
    │ │ │                    end,
    │ │ │ -                  ServerPids),
    │ │ │ -    receive_replies(ReqId, length(ServerPids), []).
    │ │ │ +                  ServerPids),
    │ │ │ +    receive_replies(ReqId, length(ServerPids), []).
    │ │ │  
    │ │ │ -receive_replies(_ReqId, 0, Acc) ->
    │ │ │ +receive_replies(_ReqId, 0, Acc) ->
    │ │ │      Acc;
    │ │ │ -receive_replies(ReqId, N, Acc) ->
    │ │ │ +receive_replies(ReqId, N, Acc) ->
    │ │ │      %% The compiler will detect that we match on the 'ReqId'
    │ │ │      %% reference in all clauses, and will enable the selective
    │ │ │      %% receive optimization which makes the receive able to
    │ │ │      %% skip past all messages present in the message queue at
    │ │ │      %% the time when the 'ReqId' reference was created...
    │ │ │      Res = receive
    │ │ │ -              {reply, ServerPid, ReqId, Result} ->
    │ │ │ +              {reply, ServerPid, ReqId, Result} ->
    │ │ │                    %% Here we typically would have deactivated the
    │ │ │                    %% monitor by a call to demonitor(Mon, [flush]) but
    │ │ │                    %% we ignore this in this example for simplicity...
    │ │ │ -                  {ok, ServerPid, Result};
    │ │ │ -              {{'DOWN', ReqId}, _Mon, process, ServerPid, ExitReason} ->
    │ │ │ -                  {error, ServerPid, ExitReason}
    │ │ │ +                  {ok, ServerPid, Result};
    │ │ │ +              {{'DOWN', ReqId}, _Mon, process, ServerPid, ExitReason} ->
    │ │ │ +                  {error, ServerPid, ExitReason}
    │ │ │            end,
    │ │ │ -    receive_replies(ReqId, N-1, [Res | Acc]).

    In order for this example to work as intended, the client must be executing on │ │ │ + receive_replies(ReqId, N-1, [Res | Acc]).

    In order for this example to work as intended, the client must be executing on │ │ │ at least an OTP 24 system, but the servers may execute on older systems.

  • │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -13910,15 +13910,15 @@ │ │ │ (sensitive, Boolean) -> OldBoolean when Boolean :: boolean(), OldBoolean :: boolean(); │ │ │ ({monitor_nodes, term()}, term()) -> term(); │ │ │ (monitor_nodes, term()) -> term().
    │ │ │ │ │ │ │ │ │ │ │ │

    Sets the process flag indicated to the specified value. Returns the previous value │ │ │ -of the flag.

    Flag is one of the following:

    • process_flag(async_dist, boolean())

      Enable or disable fully asynchronous distributed signaling for the calling │ │ │ +of the flag.

      Flag is one of the following:

      • process_flag(async_dist, boolean())

        Enable or disable fully asynchronous distributed signaling for the calling │ │ │ process. When disabled, which is the default, the process sending a distributed │ │ │ signal will block in the send operation if the buffer for the distribution │ │ │ channel reach the distribution buffer busy limit. The │ │ │ process will remain blocked until the buffer shrinks enough. This might in some │ │ │ cases take a substantial amount of time. When async_dist is enabled, send │ │ │ operations of distributed signals will always buffer the signal on the outgoing │ │ │ distribution channel and then immediately return. That is, these send operations │ │ │ @@ -13935,22 +13935,22 @@ │ │ │ caller.

        The async_dist flag can also be set on a new process when spawning it using │ │ │ the spawn_opt() BIF with the option │ │ │ {async_dist, Enable}. The default │ │ │ async_dist flag to use on newly spawned processes can be set by passing the │ │ │ command line argument +pad <boolean> when starting the │ │ │ runtime system. If the +pad <boolean> command line argument is not passed, the │ │ │ default value of the async_dist flag will be false.

        You can inspect the state of the async_dist process flag of a process by │ │ │ -calling process_info(Pid, async_dist).

      • process_flag(trap_exit, boolean())

        When trap_exit is set to true, exit signals arriving to a process are │ │ │ +calling process_info(Pid, async_dist).

      • process_flag(trap_exit, boolean())

        When trap_exit is set to true, exit signals arriving to a process are │ │ │ converted to {'EXIT', From, Reason} messages, which can be received as │ │ │ ordinary messages. If trap_exit is set to false, the process exits if it │ │ │ receives an exit signal other than normal and the exit signal is propagated to │ │ │ -its linked processes. Application processes are normally not to trap exits.

        See also exit/2.

      • process_flag(error_handler, module())

        Used by a process to redefine the error_handler for undefined function calls and │ │ │ +its linked processes. Application processes are normally not to trap exits.

        See also exit/2.

      • process_flag(error_handler, module())

        Used by a process to redefine the error_handler for undefined function calls and │ │ │ undefined registered processes. Use this flag with substantial caution, as code │ │ │ -auto-loading depends on the correct operation of the error handling module.

      • process_flag(fullsweep_after,  non_neg_integer())

        Changes the maximum number of generational collections before forcing a │ │ │ -fullsweep for the calling process.

      • process_flag(min_heap_size, non_neg_integer())

        Changes the minimum heap size for the calling process.

      • process_flag(min_bin_vheap_size, non_neg_integer())

        Changes the minimum binary virtual heap size for the calling process.

      • process_flag(max_heap_size, max_heap_size())

        This flag sets the maximum heap size for the calling process. If MaxHeapSize │ │ │ +auto-loading depends on the correct operation of the error handling module.

      • process_flag(fullsweep_after,  non_neg_integer())

        Changes the maximum number of generational collections before forcing a │ │ │ +fullsweep for the calling process.

      • process_flag(min_heap_size, non_neg_integer())

        Changes the minimum heap size for the calling process.

      • process_flag(min_bin_vheap_size, non_neg_integer())

        Changes the minimum binary virtual heap size for the calling process.

      • process_flag(max_heap_size, max_heap_size())

        This flag sets the maximum heap size for the calling process. If MaxHeapSize │ │ │ is an integer, the system default values for kill and error_logger are used.

        For details on how the heap grows, see │ │ │ Sizing the heap in the ERTS internal │ │ │ documentation.

        • size - The maximum size in words of the process. If set to zero, the │ │ │ heap size limit is disabled. badarg is be thrown if the value is smaller │ │ │ than min_heap_size. The size check │ │ │ is only done when a garbage collection is triggered.

          size is the entire heap of the process when garbage collection is triggered. │ │ │ This includes all generational heaps, the process stack, any │ │ │ @@ -13978,27 +13978,27 @@ │ │ │ of it is referred by the process.

          If include_shared_binaries is not defined in the map, the system default is │ │ │ used. The default system default is false. It can be changed by either the │ │ │ option +hmaxib in erl, or │ │ │ erlang:system_flag(max_heap_size, MaxHeapSize).

        The heap size of a process is quite hard to predict, especially the amount of │ │ │ memory that is used during the garbage collection. When contemplating using this │ │ │ option, it is recommended to first run it in production with kill set to │ │ │ false and inspect the log events to see what the normal peak sizes of the │ │ │ -processes in the system is and then tune the value accordingly.

      • process_flag(message_queue_data, message_queue_data())

        Determines how messages in the message queue are stored, as follows:

        • off_heap - All messages in the message queue will be stored outside │ │ │ +processes in the system is and then tune the value accordingly.

        • process_flag(message_queue_data, message_queue_data())

          Determines how messages in the message queue are stored, as follows:

          • off_heap - All messages in the message queue will be stored outside │ │ │ the process heap. This implies that no messages in the message queue will be │ │ │ part of a garbage collection of the process.

          • on_heap - All messages in the message queue will eventually be placed on │ │ │ the process heap. They can, however, be temporarily stored off the heap. This │ │ │ is how messages have always been stored up until ERTS 8.0.

          The default value of the message_queue_data process flag is determined by the │ │ │ command-line argument +hmqd in erl.

          If the process may potentially accumulate a large number of messages in its │ │ │ queue it is recommended to set the flag value to off_heap. This is due to the │ │ │ fact that the garbage collection of a process that has a large number of │ │ │ messages stored on the heap can become extremely expensive and the process can │ │ │ consume large amounts of memory. The performance of the actual message passing │ │ │ is, however, generally better when the flag value is on_heap.

          Changing the flag value causes any existing messages to be moved. The move │ │ │ operation is initiated, but not necessarily completed, by the time the function │ │ │ -returns.

        • process_flag(priority, priority_level())

          Sets the process priority. Level is an atom. Four priority levels exist: │ │ │ +returns.

        • process_flag(priority, priority_level())

          Sets the process priority. Level is an atom. Four priority levels exist: │ │ │ low, normal, high, and max. Default is normal.

          Note

          Priority level max is reserved for internal use in the Erlang runtime │ │ │ system, and is not to be used by others.

          Internally in each priority level, processes are scheduled in a round robin │ │ │ fashion.

          Execution of processes on priority normal and low are interleaved. Processes │ │ │ on priority low are selected for execution less frequently than processes on │ │ │ priority normal.

          When runnable processes on priority high exist, no processes on priority low │ │ │ or normal are selected for execution. Notice however that this does not mean │ │ │ that no processes on priority low or normal can run when processes are │ │ │ @@ -14019,24 +14019,24 @@ │ │ │ process during the call. Even if this is not the case with one version of the │ │ │ code that you have no control over, it can be the case in a future version of │ │ │ it. This can, for example, occur if a high priority process triggers code │ │ │ loading, as the code server runs on priority normal.

          Other priorities than normal are normally not needed. When other priorities │ │ │ are used, use them with care, especially priority high. A process on │ │ │ priority high is only to perform work for short periods. Busy looping for long │ │ │ periods in a high priority process causes most likely problems, as important │ │ │ -OTP servers run on priority normal.

        • process_flag(save_calls, 0..10000)

          N must be an integer in the interval 0..10000. If N > 0, call saving is made │ │ │ +OTP servers run on priority normal.

        • process_flag(save_calls, 0..10000)

          N must be an integer in the interval 0..10000. If N > 0, call saving is made │ │ │ active for the process. This means that information about the N most recent │ │ │ global function calls, BIF calls, sends, and receives made by the process are │ │ │ saved in a list, which can be retrieved with │ │ │ process_info(Pid, last_calls). A global function call is │ │ │ one in which the module of the function is explicitly mentioned. Only a fixed │ │ │ amount of information is saved, as follows:

          • A tuple {Module, Function, Arity} for function calls
          • The atoms send, 'receive', and timeout for sends and receives │ │ │ ('receive' when a message is received and timeout when a receive times │ │ │ out)

          If N = 0, call saving is disabled for the process, which is the default. │ │ │ -Whenever the size of the call saving list is set, its contents are reset.

        • process_flag(sensitive, boolean())

          Sets or clears flag sensitive for the current process. When a process has been │ │ │ +Whenever the size of the call saving list is set, its contents are reset.

        • process_flag(sensitive, boolean())

          Sets or clears flag sensitive for the current process. When a process has been │ │ │ marked as sensitive by calling │ │ │ process_flag(sensitive, true), features in the runtime │ │ │ system that can be used for examining the data or inner working of the process │ │ │ are silently disabled.

          Features that are disabled include (but are not limited to) the following:

          • Tracing. Trace flags can still be set for the process, but no trace messages │ │ │ of any kind are generated. (If flag sensitive is turned off, trace messages │ │ │ are again generated if any trace flags are set.)
          • Sequential tracing. The sequential trace token is propagated as usual, but no │ │ │ sequential trace messages are generated.

          process_info/1,2 cannot be used to read out the message queue or the process │ │ │ @@ -14280,16 +14280,16 @@ │ │ │ │ │ │ │ │ │ │ │ │

          Returns a list of process identifiers corresponding to all the processes │ │ │ currently existing on the local node.

          Notice that an exiting process exists, but is not alive. That is, │ │ │ is_process_alive/1 returns false for an exiting │ │ │ process, but its process identifier is part of the result returned from │ │ │ -processes/0.

          Example:

          > processes().
          │ │ │ -[<0.0.0>,<0.2.0>,<0.4.0>,<0.5.0>,<0.7.0>,<0.8.0>]
          │ │ │ +processes/0.

          Example:

          > processes().
          │ │ │ +[<0.0.0>,<0.2.0>,<0.4.0>,<0.5.0>,<0.7.0>,<0.8.0>]
          │ │ │ │ │ │ │ │ │
          │ │ │ │ │ │ │ │ │ │ │ │

          Adds a new Key to the process dictionary, associated with the value Val, and │ │ │ returns undefined. If Key exists, the old value is deleted and replaced by │ │ │ Val, and the function returns the old value.

          The average time complexity for the current implementation of this function is │ │ │ O(1) and the worst case time complexity is O(N), where N is the number of │ │ │ -items in the process dictionary.

          For example:

          > X = put(name, walrus), Y = put(name, carpenter),
          │ │ │ -Z = get(name),
          │ │ │ -{X, Y, Z}.
          │ │ │ -{undefined,walrus,carpenter}

          Note

          The values stored when put is evaluated within the scope of a catch are │ │ │ +items in the process dictionary.

          For example:

          > X = put(name, walrus), Y = put(name, carpenter),
          │ │ │ +Z = get(name),
          │ │ │ +{X, Y, Z}.
          │ │ │ +{undefined,walrus,carpenter}

          Note

          The values stored when put is evaluated within the scope of a catch are │ │ │ not retracted if a throw is evaluated, or if an error occurs.

          │ │ │
          │ │ │
          │ │ │
          │ │ │ │ │ │ │ │ │ │ │ │

          Registers the name RegName with a process identifier (pid) or a port │ │ │ identifier in the │ │ │ name registry. │ │ │ RegName, which must be an atom, can be used instead of the pid or port │ │ │ identifier in send operator (RegName ! Message) and most other BIFs that take │ │ │ -a pid or port identifies as an argument.

          For example:

          > register(db, Pid).
          │ │ │ +a pid or port identifies as an argument.

          For example:

          > register(db, Pid).
          │ │ │  true

          The registered name is considered a │ │ │ Directly Visible Erlang Resource │ │ │ and is automatically unregistered when the process terminates.

          Failures:

          • badarg - If PidOrPort is not an existing local process or port.

          • badarg - If RegName is already in use.

          • badarg - If the process or port is already registered (already has a │ │ │ name).

          • badarg - If RegName is the atom undefined.

          │ │ │
          │ │ │ │ │ │
          │ │ │ @@ -14427,16 +14427,16 @@ │ │ │ │ │ │
          │ │ │ │ │ │
          -spec registered() -> [RegName] when RegName :: atom().
          │ │ │ │ │ │
          │ │ │ │ │ │ -

          Returns a list of names that have been registered using register/2.

          For example:

          > registered().
          │ │ │ -[code_server, file_server, init, user, my_db]
          │ │ │ +

          Returns a list of names that have been registered using register/2.

          For example:

          > registered().
          │ │ │ +[code_server, file_server, init, user, my_db]
          │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │ │ │ │ @@ -14491,15 +14491,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ -

          Returns the process identifier of the calling process.

          For example:

          > self().
          │ │ │ +

          Returns the process identifier of the calling process.

          For example:

          > self().
          │ │ │  <0.26.0>
          │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │ @@ -14741,15 +14741,15 @@ │ │ │

          Returns the process identifier of a new process started by the application of │ │ │ Module:Function to Args.

          error_handler:undefined_function(Module, Function, Args) is │ │ │ evaluated by the new process if Module:Function/Arity does not exist │ │ │ (where Arity is the length of Args). The error handler can be redefined │ │ │ (see process_flag/2). If │ │ │ error_handler is undefined, or the user has redefined the default │ │ │ error_handler and its replacement is undefined, a failure with reason undef │ │ │ -occurs.

          Example:

          > spawn(speed, regulator, [high_speed, thin_cut]).
          │ │ │ +occurs.

          Example:

          > spawn(speed, regulator, [high_speed, thin_cut]).
          │ │ │  <0.13.1>
          │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │ │ │ │ │ │ │

          Raises an exception of class throw. Intended to be used to do non-local │ │ │ returns from functions.

          If evaluated within a catch expression, the │ │ │ -catch expression returns value Any.

          For example:

          > catch throw({hello, there}).
          │ │ │ -        {hello,there}

          If evaluated within a try-block of a │ │ │ +catch expression returns value Any.

          For example:

          > catch throw({hello, there}).
          │ │ │ +        {hello,there}

          If evaluated within a try-block of a │ │ │ try expression, the value Any can be caught │ │ │ within the catch block.

          For example:

          try
          │ │ │ -    throw({my_exception, "Something happened"})
          │ │ │ +    throw({my_exception, "Something happened"})
          │ │ │  catch
          │ │ │ -    throw:{my_exception, Desc} ->
          │ │ │ -        io:format(standard_error, "Error: ~s~n", [Desc])
          │ │ │ +    throw:{my_exception, Desc} ->
          │ │ │ +        io:format(standard_error, "Error: ~s~n", [Desc])
          │ │ │  end

          Failure: nocatch if not caught by an exception handler.

          See the guide about errors and error handling for │ │ │ additional information.

          │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │
          │ │ │ @@ -15774,17 +15774,17 @@ │ │ │ trapping exits, an │ │ │ {'EXIT', Id, ExitReason} message due to the link may have been placed in the │ │ │ message queue of the caller before the unlink(Id) call │ │ │ completed. Also note that the {'EXIT', Id, ExitReason} message may be the │ │ │ result of the link, but may also be the result of the unlikee sending the caller │ │ │ an exit signal by calling the exit/2 BIF. Therefore, it may or may not be │ │ │ appropriate to clean up the message queue after a call to │ │ │ -unlink(Id) as follows, when trapping exits:

          unlink(Id),
          │ │ │ +unlink(Id) as follows, when trapping exits:

          unlink(Id),
          │ │ │  receive
          │ │ │ -    {'EXIT', Id, _} ->
          │ │ │ +    {'EXIT', Id, _} ->
          │ │ │          true
          │ │ │  after 0 ->
          │ │ │          true
          │ │ │  end

          The link removal is performed asynchronously. If such a link does not exist, │ │ │ nothing is done. A detailed description of the │ │ │ link protocol can be found in the │ │ │ Distribution Protocol chapter of the ERTS User's Guide.

          Note

          For some important information about distributed signals, see the │ │ │ @@ -15815,15 +15815,15 @@ │ │ │ │ │ │

          -spec unregister(RegName) -> true when RegName :: atom().
          │ │ │ │ │ │
          │ │ │ │ │ │

          Removes the registered name RegName associated with a │ │ │ process identifier or a port identifier from the │ │ │ -name registry.

          For example:

          > unregister(db).
          │ │ │ +name registry.

          For example:

          > unregister(db).
          │ │ │  true

          Keep in mind that you can still receive signals associated with the registered │ │ │ name after it has been unregistered as the sender may have looked up the name │ │ │ before sending to it.

          Users are advised not to unregister system processes.

          Failure: badarg if RegName is not a registered name.

          │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │ @@ -15849,15 +15849,15 @@ │ │ │
          -spec whereis(RegName) -> pid() | port() | undefined when RegName :: atom().
          │ │ │ │ │ │ │ │ │ │ │ │

          Returns the process identifier or port identifier with the │ │ │ registered name RegName from the │ │ │ name registry. Returns │ │ │ -undefined if the name is not registered.

          For example:

          > whereis(db).
          │ │ │ +undefined if the name is not registered.

          For example:

          > whereis(db).
          │ │ │  <0.43.0>
          │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │ @@ -15924,15 +15924,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ -

          Equivalent to calling halt(0, []).

          For example:

          > halt().
          │ │ │ +

          Equivalent to calling halt(0, []).

          For example:

          > halt().
          │ │ │  os_prompt%
          │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │ @@ -15955,15 +15955,15 @@ │ │ │ │ │ │
          -spec halt(Status :: non_neg_integer()) -> no_return();
          │ │ │            (Abort :: abort) -> no_return();
          │ │ │            (CrashDumpSlogan :: string()) -> no_return().
          │ │ │ │ │ │
          │ │ │ │ │ │ -

          Equivalent to calling halt(HaltType, []).

          For example:

          > halt(17).
          │ │ │ +

          Equivalent to calling halt(HaltType, []).

          For example:

          > halt(17).
          │ │ │  os_prompt% echo $?
          │ │ │  17
          │ │ │  os_prompt%
          │ │ │
          │ │ │ │ │ │
          │ │ │ │ │ │ @@ -15990,15 +15990,15 @@ │ │ │ │ │ │
          -spec halt(Status :: non_neg_integer(), Options :: halt_options()) -> no_return();
          │ │ │            (Abort :: abort, Options :: halt_options()) -> no_return();
          │ │ │            (CrashDumpSlogan :: string(), Options :: halt_options()) -> no_return().
          │ │ │ │ │ │ │ │ │ │ │ │ -

          Halt the runtime system.

          • halt(Status :: non_neg_integer(), Options :: halt_options())

            Halt the runtime system with status code Status.

            Note

            On many platforms, the OS supports only status codes 0-255. A too large │ │ │ +

            Halt the runtime system.

            • halt(Status :: non_neg_integer(), Options :: halt_options())

              Halt the runtime system with status code Status.

              Note

              On many platforms, the OS supports only status codes 0-255. A too large │ │ │ status code is truncated by clearing the high bits.

              Currently the following options are valid:

              • {flush, EnableFlushing} - If EnableFlushing equals │ │ │ true, which also is the default behavior, the runtime system will perform │ │ │ the following operations before terminating:

                • Flush all outstanding output.
                • Send all Erlang ports exit signals and wait for them to exit.
                • Wait for all async threads to complete all outstanding async jobs.
                • Call all installed NIF on halt callbacks.
                • Wait for all ongoing │ │ │ NIF calls with the delay halt setting enabled │ │ │ to return.
                • Call all installed atexit/on_exit callbacks.

                If EnableFlushing equals false, the runtime system will terminate │ │ │ immediately without performing any of the above listed operations.

                Change

                Runtime systems prior to OTP 26.0 called all installed atexit/on_exit │ │ │ callbacks also when flush was disabled, but as of OTP 26.0 this is no │ │ │ @@ -16007,18 +16007,18 @@ │ │ │ termination of the runtime system. Timeout is in milliseconds. The default │ │ │ value is determined by the the erl +zhft <Timeout> │ │ │ command line flag.

                If flushing has been ongoing for Timeout milliseconds, flushing operations │ │ │ will be interrupted and the runtime system will immediately be terminated │ │ │ with the exit code 255. If flushing is not enabled, the timeout will have │ │ │ no effect on the system.

                See also the erl +zhft <Timeout> command line flag. │ │ │ Note that the shortest timeout set by the command line flag and the │ │ │ -flush_timeout option will be the actual timeout value in effect.

                Since: OTP 27.0

            • halt(Abort :: abort, Options :: halt_options())

              Halt the Erlang runtime system by aborting and produce a core dump if core │ │ │ +flush_timeout option will be the actual timeout value in effect.

              Since: OTP 27.0

          • halt(Abort :: abort, Options :: halt_options())

            Halt the Erlang runtime system by aborting and produce a core dump if core │ │ │ dumping has been enabled in the environment that the runtime system is │ │ │ executing in.

            Note

            The {flush, boolean()} option will be ignored, and │ │ │ -flushing will be disabled.

          • halt(CrashDumpSlogan :: string(), Options :: halt_options())

            Halt the Erlang runtime system and generate an │ │ │ +flushing will be disabled.

        • halt(CrashDumpSlogan :: string(), Options :: halt_options())

          Halt the Erlang runtime system and generate an │ │ │ Erlang crash dump. The string CrashDumpSlogan will be used │ │ │ as slogan in the Erlang crash dump created. The slogan will be trunkated if │ │ │ CrashDumpSlogan is longer than 1023 characters.

          Note

          The {flush, boolean()} option will be ignored, and │ │ │ flushing will be disabled.

          Change

          Behavior changes compared to earlier versions:

          • Before OTP 24.2, the slogan was truncated if CrashDumpSlogan was longer │ │ │ than 200 characters. Now it will be truncated if longer than 1023 │ │ │ characters.
          • Before OTP 20.1, only code points in the range 0-255 were accepted in the │ │ │ slogan. Now any Unicode string is valid.
        │ │ │ @@ -16195,19 +16195,19 @@ │ │ │ (wall_clock) -> {Total_Wallclock_Time, Wallclock_Time_Since_Last_Call} │ │ │ when │ │ │ Total_Wallclock_Time :: non_neg_integer(), │ │ │ Wallclock_Time_Since_Last_Call :: non_neg_integer().
    │ │ │ │ │ │ │ │ │ │ │ │ -

    Returns statistics about the current system.

    The possible flags are:

    • statistics(active_tasks) -> [non_neg_integer()]

      Returns the same as │ │ │ +

      Returns statistics about the current system.

      The possible flags are:

      • statistics(active_tasks) -> [non_neg_integer()]

        Returns the same as │ │ │ statistics(active_tasks_all) with │ │ │ the exception that no information about the dirty IO run queue and its │ │ │ associated schedulers is part of the result. That is, only tasks that are │ │ │ -expected to be CPU bound are part of the result.

        Available since OTP 18.3

      • statistics(active_tasks_all) -> [non_neg_integer()]

        Returns a list where each element represents the amount of active processes and │ │ │ +expected to be CPU bound are part of the result.

        Available since OTP 18.3

      • statistics(active_tasks_all) -> [non_neg_integer()]

        Returns a list where each element represents the amount of active processes and │ │ │ ports on each run queue and its associated schedulers. That is, the number of │ │ │ processes and ports that are ready to run, or are currently running. Values for │ │ │ normal run queues and their associated schedulers are located first in the │ │ │ resulting list. The first element corresponds to scheduler number 1 and so on. │ │ │ If support for dirty schedulers exist, an element with the value for the dirty │ │ │ CPU run queue and its associated dirty CPU schedulers follow and then as last │ │ │ element the value for the dirty IO run queue and its associated dirty IO │ │ │ @@ -16221,44 +16221,44 @@ │ │ │ migrate to other normal run queues. This has to be taken into account when │ │ │ evaluating the result.

        See also │ │ │ statistics(total_active_tasks), │ │ │ statistics(run_queue_lengths), │ │ │ statistics(run_queue_lengths_all), │ │ │ statistics(total_run_queue_lengths), │ │ │ and │ │ │ -statistics(total_run_queue_lengths_all).

        Available since OTP 20.0

      • statistics(context_switches) -> {non_neg_integer(), 0}

        Returns the total number of context switches since the system started.

      • statistics(exact_reductions) -> {Total :: non_neg_integer(), SinceLastCall :: non_neg_integer()}

        Returns the number of exact reductions.

        Note

        statistics(exact_reductions) is a more expensive operation │ │ │ -than statistics(reductions).

      • statistics(garbage_collection) ->
        │ │ │ -  { NumerOfGCs :: non_neg_integer(), WordsReclaimed :: non_neg_integer(), 0}

        Returns information about garbage collection, for example:

        > statistics(garbage_collection).
        │ │ │ -{85,23961,0}

        This information can be invalid for some implementations.

      • statistics(io) -> {{input, non_neg_integer()}, {output, non_neg_integer()}}

        Returns Input, which is the total number of bytes received through ports, and │ │ │ -Output, which is the total number of bytes output to ports.

      • statistics(microstate_accounting) -> [MSAcc_Thread]

        Microstate accounting can be used to measure how much time the Erlang runtime │ │ │ +statistics(total_run_queue_lengths_all).

        Available since OTP 20.0

      • statistics(context_switches) -> {non_neg_integer(), 0}

        Returns the total number of context switches since the system started.

      • statistics(exact_reductions) -> {Total :: non_neg_integer(), SinceLastCall :: non_neg_integer()}

        Returns the number of exact reductions.

        Note

        statistics(exact_reductions) is a more expensive operation │ │ │ +than statistics(reductions).

      • statistics(garbage_collection) ->
        │ │ │ +  { NumerOfGCs :: non_neg_integer(), WordsReclaimed :: non_neg_integer(), 0}

        Returns information about garbage collection, for example:

        > statistics(garbage_collection).
        │ │ │ +{85,23961,0}

        This information can be invalid for some implementations.

      • statistics(io) -> {{input, non_neg_integer()}, {output, non_neg_integer()}}

        Returns Input, which is the total number of bytes received through ports, and │ │ │ +Output, which is the total number of bytes output to ports.

      • statistics(microstate_accounting) -> [MSAcc_Thread]

        Microstate accounting can be used to measure how much time the Erlang runtime │ │ │ system spends doing various tasks. It is designed to be as lightweight as │ │ │ possible, but some overhead exists when this is enabled. Microstate accounting │ │ │ is meant to be a profiling tool to help finding performance bottlenecks. To │ │ │ start/stop/reset microstate accounting, use system flag │ │ │ microstate_accounting.

        statistics(microstate_accounting) returns a list of maps │ │ │ representing some of the OS threads within ERTS. Each map contains type and │ │ │ id fields that can be used to identify what thread it is, and also a counters │ │ │ field that contains data about how much time has been spent in the various │ │ │ -states.

        Example:

        > erlang:statistics(microstate_accounting).
        │ │ │ -[#{counters => #{aux => 1899182914,
        │ │ │ +states.

        Example:

        > erlang:statistics(microstate_accounting).
        │ │ │ +[#{counters => #{aux => 1899182914,
        │ │ │                   check_io => 2605863602,
        │ │ │                   emulator => 45731880463,
        │ │ │                   gc => 1512206910,
        │ │ │                   other => 5421338456,
        │ │ │                   port => 221631,
        │ │ │ -                 sleep => 5150294100},
        │ │ │ +                 sleep => 5150294100},
        │ │ │     id => 1,
        │ │ │ -   type => scheduler}|...]

        The time unit is the same as returned by os:perf_counter/0. So, to convert it │ │ │ -to milliseconds, you can do something like this:

        lists:map(
        │ │ │ -  fun(#{ counters := Cnt } = M) ->
        │ │ │ -         MsCnt = maps:map(fun(_K, PerfCount) ->
        │ │ │ -                                    erlang:convert_time_unit(PerfCount, perf_counter, 1000)
        │ │ │ -                           end, Cnt),
        │ │ │ -         M#{ counters := MsCnt }
        │ │ │ -  end, erlang:statistics(microstate_accounting)).

        Notice that these values are not guaranteed to be the exact time spent in each │ │ │ + type => scheduler}|...]

        The time unit is the same as returned by os:perf_counter/0. So, to convert it │ │ │ +to milliseconds, you can do something like this:

        lists:map(
        │ │ │ +  fun(#{ counters := Cnt } = M) ->
        │ │ │ +         MsCnt = maps:map(fun(_K, PerfCount) ->
        │ │ │ +                                    erlang:convert_time_unit(PerfCount, perf_counter, 1000)
        │ │ │ +                           end, Cnt),
        │ │ │ +         M#{ counters := MsCnt }
        │ │ │ +  end, erlang:statistics(microstate_accounting)).

        Notice that these values are not guaranteed to be the exact time spent in each │ │ │ state. This is because of various optimisation done to keep the overhead as │ │ │ small as possible.

        MSAcc_Thread_Types:

        • scheduler - The main execution threads that do most of the work. See │ │ │ erl +S for more details.

        • dirty_cpu_scheduler - The threads for long running cpu intensive work. │ │ │ See erl +SDcpu for more details.

        • dirty_io_scheduler - The threads for long running I/O work. See │ │ │ erl +SDio for more details.

        • async - Async threads are used by various linked-in drivers (mainly the │ │ │ file drivers) do offload non-CPU intensive work. See │ │ │ erl +A for more details.

        • aux - Takes care of any work that is not specifically assigned to a │ │ │ @@ -16282,28 +16282,28 @@ │ │ │ states this time is part of the gc state.

        • nif - Time spent in NIFs. Without extra states this time is part of the │ │ │ emulator state.

        • send - Time spent sending messages (processes only). Without extra │ │ │ states this time is part of the emulator state.

        • timers - Time spent managing timers. Without extra states this time is │ │ │ part of the other state.

        The utility module msacc can be used to more easily analyse these │ │ │ statistics.

        Returns undefined if system flag │ │ │ microstate_accounting is │ │ │ turned off.

        The list of thread information is unsorted and can appear in different order │ │ │ -between calls.

        Note

        The threads and states are subject to change without any prior notice.

        Available since OTP 19.0

      • statistics(reductions) -> {Reductions :: non_neg_integer(), SinceLastCall :: non_neg_integer()}

        Returns information about reductions, for example:

        > statistics(reductions).
        │ │ │ -{2046,11}

        Change

        As from ERTS 5.5 (Erlang/OTP R11B), this value does not include reductions │ │ │ +between calls.

        Note

        The threads and states are subject to change without any prior notice.

        Available since OTP 19.0

      • statistics(reductions) -> {Reductions :: non_neg_integer(), SinceLastCall :: non_neg_integer()}

        Returns information about reductions, for example:

        > statistics(reductions).
        │ │ │ +{2046,11}

        Change

        As from ERTS 5.5 (Erlang/OTP R11B), this value does not include reductions │ │ │ performed in current time slices of currently scheduled processes. If an exact │ │ │ value is wanted, use │ │ │ -statistics(exact_reductions).

      • statistics(run_queue) -> non_neg_integer()

        Returns the total length of all normal and dirty CPU run queues. That is, queued │ │ │ +statistics(exact_reductions).

      • statistics(run_queue) -> non_neg_integer()

        Returns the total length of all normal and dirty CPU run queues. That is, queued │ │ │ work that is expected to be CPU bound. The information is gathered atomically. │ │ │ That is, the result is a consistent snapshot of the state, but this operation is │ │ │ much more expensive compared to │ │ │ statistics(total_run_queue_lengths), │ │ │ -especially when a large amount of schedulers is used.

      • statistics(run_queue_lengths) -> [non_neg_integer()]

        Returns the same as │ │ │ +especially when a large amount of schedulers is used.

      • statistics(run_queue_lengths) -> [non_neg_integer()]

        Returns the same as │ │ │ statistics(run_queue_lengths_all) │ │ │ with the exception that no information about the dirty IO run queue is part of │ │ │ the result. That is, only run queues with work that is expected to be CPU bound │ │ │ -is part of the result.

        Available since OTP 18.3

      • statistics(run_queue_lengths_all) -> [non_neg_integer()]

        Returns a list where each element represents the amount of processes and ports │ │ │ +is part of the result.

        Available since OTP 18.3

      • statistics(run_queue_lengths_all) -> [non_neg_integer()]

        Returns a list where each element represents the amount of processes and ports │ │ │ ready to run for each run queue. Values for normal run queues are located first │ │ │ in the resulting list. The first element corresponds to the normal run queue of │ │ │ scheduler number 1 and so on. If support for dirty schedulers exist, values for │ │ │ the dirty CPU run queue and the dirty IO run queue follow (in that order) at the │ │ │ end. The information is not gathered atomically. That is, the result is not │ │ │ necessarily a consistent snapshot of the state, but instead quite efficiently │ │ │ gathered.

        Note

        Each normal scheduler has one run queue that it manages. If dirty schedulers │ │ │ @@ -16315,21 +16315,21 @@ │ │ │ evaluating the result.

        See also │ │ │ statistics(run_queue_lengths), │ │ │ statistics(total_run_queue_lengths_all), │ │ │ statistics(total_run_queue_lengths), │ │ │ statistics(active_tasks), │ │ │ statistics(active_tasks_all), and │ │ │ statistics(total_active_tasks), │ │ │ -statistics(total_active_tasks_all).

        Available since OTP 20.0

      • statistics(runtime) -> {Total :: non_neg_integer(), SinceLastCall :: non_neg_integer()}

        Returns information about runtime, in milliseconds.

        This is the sum of the runtime for all threads in the Erlang runtime system and │ │ │ +statistics(total_active_tasks_all).

        Available since OTP 20.0

      • statistics(runtime) -> {Total :: non_neg_integer(), SinceLastCall :: non_neg_integer()}

        Returns information about runtime, in milliseconds.

        This is the sum of the runtime for all threads in the Erlang runtime system and │ │ │ can therefore be greater than the wall clock time.

        Warning

        This value might wrap due to limitations in the underlying functionality │ │ │ -provided by the operating system that is used.

        Example:

        > statistics(runtime).
        │ │ │ -{1690,1620}
      • statistics(scheduler_wall_time) ->
        │ │ │ -  [{Id :: pos_integer,
        │ │ │ -    ActiveTime :: non_neg_integer(),
        │ │ │ -    TotalTime :: non_neg_integer()}] |
        │ │ │ +provided by the operating system that is used.

        Example:

        > statistics(runtime).
        │ │ │ +{1690,1620}
      • statistics(scheduler_wall_time) ->
        │ │ │ +  [{Id :: pos_integer,
        │ │ │ +    ActiveTime :: non_neg_integer(),
        │ │ │ +    TotalTime :: non_neg_integer()}] |
        │ │ │    undefined

        Returns information describing how much time │ │ │ normal and │ │ │ dirty CPU schedulers in the │ │ │ system have been busy. This value is normally a better indicator of how much │ │ │ load an Erlang node is under instead of looking at the CPU utilization provided │ │ │ by tools such as top or sysstat. This is because scheduler_wall_time also │ │ │ includes time where the scheduler is waiting for some other reasource (such as │ │ │ @@ -16361,60 +16361,60 @@ │ │ │ Dirty CPU schedulers will have scheduler identifiers in the range │ │ │ erlang:system_info(schedulers) < SchedulerId =< erlang:system_info(schedulers) +erlang:system_info(dirty_cpu_schedulers).

        Note

        The different types of schedulers handle specific types of jobs. Every job is │ │ │ assigned to a specific scheduler type. Jobs can migrate between different │ │ │ schedulers of the same type, but never between schedulers of different types. │ │ │ This fact has to be taken under consideration when evaluating the result │ │ │ returned.

        You can use scheduler_wall_time to calculate scheduler utilization. First you │ │ │ take a sample of the values returned by │ │ │ -erlang:statistics(scheduler_wall_time).

        > erlang:system_flag(scheduler_wall_time, true).
        │ │ │ +erlang:statistics(scheduler_wall_time).

        > erlang:system_flag(scheduler_wall_time, true).
        │ │ │  false
        │ │ │ -> Ts0 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.
        │ │ │ +> Ts0 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.
        │ │ │  ok

        Some time later the user takes another snapshot and calculates scheduler │ │ │ -utilization per scheduler, for example:

        > Ts1 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.
        │ │ │ +utilization per scheduler, for example:

        > Ts1 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.
        │ │ │  ok
        │ │ │ -> lists:map(fun({{I, A0, T0}, {I, A1, T1}}) ->
        │ │ │ -        {I, (A1 - A0)/(T1 - T0)} end, lists:zip(Ts0,Ts1)).
        │ │ │ -[{1,0.9743474730177548},
        │ │ │ - {2,0.9744843782751444},
        │ │ │ - {3,0.9995902361669045},
        │ │ │ - {4,0.9738012596572161},
        │ │ │ - {5,0.9717956667018103},
        │ │ │ - {6,0.9739235846420741},
        │ │ │ - {7,0.973237033077876},
        │ │ │ - {8,0.9741297293248656}]

        Using the same snapshots to calculate a total scheduler utilization:

        > {A, T} = lists:foldl(fun({{_, A0, T0}, {_, A1, T1}}, {Ai,Ti}) ->
        │ │ │ -        {Ai + (A1 - A0), Ti + (T1 - T0)} end, {0, 0}, lists:zip(Ts0,Ts1)),
        │ │ │ +> lists:map(fun({{I, A0, T0}, {I, A1, T1}}) ->
        │ │ │ +        {I, (A1 - A0)/(T1 - T0)} end, lists:zip(Ts0,Ts1)).
        │ │ │ +[{1,0.9743474730177548},
        │ │ │ + {2,0.9744843782751444},
        │ │ │ + {3,0.9995902361669045},
        │ │ │ + {4,0.9738012596572161},
        │ │ │ + {5,0.9717956667018103},
        │ │ │ + {6,0.9739235846420741},
        │ │ │ + {7,0.973237033077876},
        │ │ │ + {8,0.9741297293248656}]

        Using the same snapshots to calculate a total scheduler utilization:

        > {A, T} = lists:foldl(fun({{_, A0, T0}, {_, A1, T1}}, {Ai,Ti}) ->
        │ │ │ +        {Ai + (A1 - A0), Ti + (T1 - T0)} end, {0, 0}, lists:zip(Ts0,Ts1)),
        │ │ │    TotalSchedulerUtilization = A/T.
        │ │ │  0.9769136803764825

        Total scheduler utilization will equal 1.0 when all schedulers have been │ │ │ active all the time between the two measurements.

        Another (probably more) useful value is to calculate total scheduler utilization │ │ │ -weighted against maximum amount of available CPU time:

        > WeightedSchedulerUtilization = (TotalSchedulerUtilization
        │ │ │ -                                  * (erlang:system_info(schedulers)
        │ │ │ -                                     + erlang:system_info(dirty_cpu_schedulers)))
        │ │ │ -                                 / erlang:system_info(logical_processors_available).
        │ │ │ +weighted against maximum amount of available CPU time:

        > WeightedSchedulerUtilization = (TotalSchedulerUtilization
        │ │ │ +                                  * (erlang:system_info(schedulers)
        │ │ │ +                                     + erlang:system_info(dirty_cpu_schedulers)))
        │ │ │ +                                 / erlang:system_info(logical_processors_available).
        │ │ │  0.9769136803764825

        This weighted scheduler utilization will reach 1.0 when schedulers are active │ │ │ the same amount of time as maximum available CPU time. If more schedulers exist │ │ │ than available logical processors, this value may be greater than 1.0.

        As of ERTS version 9.0, the Erlang runtime system will as default have more │ │ │ schedulers than logical processors. This due to the dirty schedulers.

        Note

        scheduler_wall_time is by default disabled. To enable it, use │ │ │ -erlang:system_flag(scheduler_wall_time, true).

        Available since OTP R15B01

      • statistics(scheduler_wall_time_all) ->
        │ │ │ -  [{Id :: pos_integer,
        │ │ │ -    ActiveTime :: non_neg_integer(),
        │ │ │ -    TotalTime :: non_neg_integer()}] |
        │ │ │ +erlang:system_flag(scheduler_wall_time, true).

        Available since OTP R15B01

      • statistics(scheduler_wall_time_all) ->
        │ │ │ +  [{Id :: pos_integer,
        │ │ │ +    ActiveTime :: non_neg_integer(),
        │ │ │ +    TotalTime :: non_neg_integer()}] |
        │ │ │    undefined

        Equivalent to │ │ │ statistics(scheduler_wall_time), │ │ │ except that it also include information about all dirty I/O schedulers.

        Dirty IO schedulers will have scheduler identifiers in the range │ │ │ erlang:system_info(schedulers)+erlang:system_info(dirty_cpu_schedulers)< SchedulerId =< erlang:system_info(schedulers) + erlang:system_info(dirty_cpu_schedulers) +erlang:system_info(dirty_io_schedulers).

        Note

        Note that work executing on dirty I/O schedulers are expected to mainly wait │ │ │ for I/O. That is, when you get high scheduler utilization on dirty I/O │ │ │ -schedulers, CPU utilization is not expected to be high due to this work.

        Available since OTP 20.0

      • statistics(total_active_tasks) -> non_neg_integer()

        Equivalent to calling │ │ │ +schedulers, CPU utilization is not expected to be high due to this work.

        Available since OTP 20.0

      • statistics(total_active_tasks) -> non_neg_integer()

        Equivalent to calling │ │ │ lists:sum(statistics(active_tasks)), │ │ │ -but more efficient.

        Available since OTP 18.3

      • statistics(total_active_tasks_all) -> non_neg_integer()

        Equivalent to calling │ │ │ +but more efficient.

        Available since OTP 18.3

      • statistics(total_active_tasks_all) -> non_neg_integer()

        Equivalent to calling │ │ │ lists:sum(statistics(active_tasks_all)), │ │ │ -but more efficient.

        Available since OTP 20.0

      • statistics(total_run_queue_lengths) -> non_neg_integer()

        Equivalent to calling │ │ │ +but more efficient.

        Available since OTP 20.0

      • statistics(total_run_queue_lengths) -> non_neg_integer()

        Equivalent to calling │ │ │ lists:sum(statistics(run_queue_lengths)), │ │ │ -but more efficient.

        Available since OTP 18.3

      • statistics(total_run_queue_lengths_all) -> non_neg_integer()

        Equivalent to calling │ │ │ +but more efficient.

        Available since OTP 18.3

      • statistics(total_run_queue_lengths_all) -> non_neg_integer()

        Equivalent to calling │ │ │ lists:sum(statistics(run_queue_lengths_all)), │ │ │ -but more efficient.

        Available since OTP 20.0

      • statistics(wall_clock) -> {Total :: non_neg_integer(), SinceLastCall :: non_neg_integer()}

        Returns information about wall clock. wall_clock can be used in the same │ │ │ +but more efficient.

        Available since OTP 20.0

      • statistics(wall_clock) -> {Total :: non_neg_integer(), SinceLastCall :: non_neg_integer()}

        Returns information about wall clock. wall_clock can be used in the same │ │ │ manner as runtime, except that real time is measured as opposed to runtime or │ │ │ CPU time.

      │ │ │ │ │ │ │ │ │
      │ │ │ │ │ │
      │ │ │ @@ -16478,65 +16478,65 @@ │ │ │ when │ │ │ Tracer :: pid() | port() | {module(), term()} | false, │ │ │ PrevTracer :: pid() | port() | {module(), term()} | false; │ │ │ (reset_seq_trace, true) -> true.
    │ │ │ │ │ │ │ │ │ │ │ │ -

    Sets a system flag to the given value.

    The possible flags to set are:

    • system_flag(backtrace_depths, non_neg_integer()) -> non_neg_integer()

      Sets the maximum depth of call stack back-traces in the exit reason element of │ │ │ +

      Sets a system flag to the given value.

      The possible flags to set are:

      • system_flag(backtrace_depths, non_neg_integer()) -> non_neg_integer()

        Sets the maximum depth of call stack back-traces in the exit reason element of │ │ │ 'EXIT' tuples. The flag also limits the stacktrace depth returned by │ │ │ -process_info/2 item current_stacktrace.

        Returns the old value of the flag.

      • system_flag(cpu_topology, cpu_topology()) -> cpu_topology()

        Warning

        This argument is deprecated. Instead of using this argument, use │ │ │ +process_info/2 item current_stacktrace.

        Returns the old value of the flag.

      • system_flag(cpu_topology, cpu_topology()) -> cpu_topology()

        Warning

        This argument is deprecated. Instead of using this argument, use │ │ │ command-line argument +sct in erl.

        When this argument is removed, a final CPU topology to use is determined at │ │ │ emulator boot time.

        Sets the user-defined CpuTopology. The user-defined CPU topology overrides any │ │ │ automatically detected CPU topology. By passing undefined as CpuTopology, │ │ │ the system reverts to the CPU topology automatically detected. The returned │ │ │ value equals the value returned from erlang:system_info(cpu_topology) before │ │ │ the change was made.

        Returns the old value of the flag.

        The CPU topology is used when binding schedulers to logical processors. If │ │ │ schedulers are already bound when the CPU topology is changed, the schedulers │ │ │ are sent a request to rebind according to the new CPU topology.

        The user-defined CPU topology can also be set by passing command-line argument │ │ │ +sct to erl.

        For information on type CpuTopology and more, see │ │ │ erlang:system_info(cpu_topology) as │ │ │ well as command-line flags +sct and │ │ │ -+sbt in erl.

      • system_flag(dirty_cpu_schedulers_online, pos_integer()) -> pos_integer()

        Sets the number of dirty CPU schedulers online. Range is │ │ │ ++sbt in erl.

      • system_flag(dirty_cpu_schedulers_online, pos_integer()) -> pos_integer()

        Sets the number of dirty CPU schedulers online. Range is │ │ │ 1 <= DirtyCPUSchedulersOnline <= N, where N is the smallest of the return │ │ │ values of erlang:system_info(dirty_cpu_schedulers) and │ │ │ erlang:system_info(schedulers_online).

        Returns the old value of the flag.

        The number of dirty CPU schedulers online can change if the number of schedulers │ │ │ online changes. For example, if 12 schedulers and 6 dirty CPU schedulers are │ │ │ online, and system_flag/2 is used to set the number of │ │ │ schedulers online to 6, then the number of dirty CPU schedulers online is │ │ │ automatically decreased by half as well, down to 3. Similarly, the number of │ │ │ dirty CPU schedulers online increases proportionally to increases in the number │ │ │ of schedulers online.

        For more information, see │ │ │ erlang:system_info(dirty_cpu_schedulers) │ │ │ and │ │ │ -erlang:system_info(dirty_cpu_schedulers_online).

        Available since OTP 17.0

      • system_flag(erts_alloc, {Alloc :: atom(), F :: atom(), V :: integer()}) ->
        │ │ │ +erlang:system_info(dirty_cpu_schedulers_online).

        Available since OTP 17.0

      • system_flag(erts_alloc, {Alloc :: atom(), F :: atom(), V :: integer()}) ->
        │ │ │    ok | notsup

        Sets system flags for erts_alloc(3). Alloc is the allocator │ │ │ to affect, for example binary_alloc. F is the flag to change and V is the │ │ │ new value.

        Only a subset of all erts_alloc flags can be changed at run time. This subset │ │ │ -is currently only the flag sbct.

        Returns ok if the flag was set or notsup if not supported by erts_alloc.

        Available since OTP 20.2.3

      • system_flag(fullsweep_after, non_neg_integer()) -> non_neg_integer()

        Sets system flag fullsweep_after. Number is a non-negative integer │ │ │ +is currently only the flag sbct.

        Returns ok if the flag was set or notsup if not supported by erts_alloc.

        Available since OTP 20.2.3

      • system_flag(fullsweep_after, non_neg_integer()) -> non_neg_integer()

        Sets system flag fullsweep_after. Number is a non-negative integer │ │ │ indicating how many times generational garbage collections can be done without │ │ │ forcing a fullsweep collection. The value applies to new processes, while │ │ │ processes already running are not affected.

        Returns the old value of the flag.

        In low-memory systems (especially without virtual memory), setting the value to │ │ │ 0 can help to conserve memory.

        This value can also be set through (OS) environment variable │ │ │ -ERL_FULLSWEEP_AFTER.

      • system_flag(microstate_accounting, true | false | reset) -> boolean()

        Turns on/off microstate accounting measurements. When passing reset, all │ │ │ +ERL_FULLSWEEP_AFTER.

      • system_flag(microstate_accounting, true | false | reset) -> boolean()

        Turns on/off microstate accounting measurements. When passing reset, all │ │ │ counters are reset to 0.

        For more information see │ │ │ -statistics(microstate_accounting).

        Available since OTP 19.0

      • system_flag(min_heap_size, non_neg_integer()) -> non_neg_integer()

        Sets the default minimum heap size for processes. The size is specified in │ │ │ +statistics(microstate_accounting).

        Available since OTP 19.0

      • system_flag(min_heap_size, non_neg_integer()) -> non_neg_integer()

        Sets the default minimum heap size for processes. The size is specified in │ │ │ words. The new min_heap_size effects only processes spawned after the change │ │ │ of min_heap_size has been made. min_heap_size can be set for individual │ │ │ -processes by using spawn_opt/4 or process_flag/2.

        Returns the old value of the flag.

      • system_flag(min_bin_vheap_size, non_neg_integer()) -> non_neg_integer()

        Sets the default minimum binary virtual heap size for processes. The size is │ │ │ +processes by using spawn_opt/4 or process_flag/2.

        Returns the old value of the flag.

      • system_flag(min_bin_vheap_size, non_neg_integer()) -> non_neg_integer()

        Sets the default minimum binary virtual heap size for processes. The size is │ │ │ specified in words. The new min_bin_vhheap_size effects only processes spawned │ │ │ after the change of min_bin_vheap_size has been made. min_bin_vheap_size can │ │ │ be set for individual processes by using spawn_opt/2,3,4 or │ │ │ -process_flag/2.

        Returns the old value of the flag.

        Available since OTP R13B04

      • system_flag(max_heap_size, max_heap_size()) -> max_heap_size()

        Sets the default maximum heap size settings for processes. The size is specified │ │ │ +process_flag/2.

        Returns the old value of the flag.

        Available since OTP R13B04

      • system_flag(max_heap_size, max_heap_size()) -> max_heap_size()

        Sets the default maximum heap size settings for processes. The size is specified │ │ │ in words. The new max_heap_size effects only processes spawned after the │ │ │ change has been made. max_heap_size can be set for individual processes using │ │ │ spawn_opt/2,3,4 or │ │ │ process_flag/2.

        Returns the old value of the flag.

        For details on how the heap grows, see │ │ │ Sizing the heap in the ERTS internal │ │ │ -documentation.

        Available since OTP 19.0

      • system_flag(multi_scheduling, BlockState) -> OldBlockState when
        │ │ │ +documentation.

        Available since OTP 19.0

      • system_flag(multi_scheduling, BlockState) -> OldBlockState when
        │ │ │    BlockState :: block | unblock | block_normal | unblock_normal,
        │ │ │    OldBlockState :: blocked | disabled | enabled

        If multi-scheduling is enabled, more than one scheduler thread is used by the │ │ │ emulator. Multi-scheduling can be blocked in two different ways. Either all │ │ │ schedulers but one is blocked, or all normal schedulers but one is blocked. │ │ │ When only normal schedulers are blocked, dirty schedulers are free to continue │ │ │ to schedule processes.

        If BlockState =:= block, multi-scheduling is blocked. That is, one and only │ │ │ one scheduler thread will execute. If BlockState =:= unblock and no one else │ │ │ @@ -16557,27 +16557,27 @@ │ │ │ erlang:system_info(multi_scheduling).

        Note

        Blocking of multi-scheduling and normal multi-scheduling is normally not │ │ │ needed. If you feel that you need to use these features, consider it a few │ │ │ more times again. Blocking multi-scheduling is only to be used as a last │ │ │ resort, as it is most likely a very inefficient way to solve the problem.

        See also │ │ │ erlang:system_info(multi_scheduling), │ │ │ erlang:system_info(normal_multi_scheduling_blockers), │ │ │ erlang:system_info(multi_scheduling_blockers), │ │ │ -and erlang:system_info(schedulers).

      • system_flag(outstanding_system_requests_limit, 1..134217727) -> 1..134217727

        Sets a limit on the amount of outstanding requests made by a system process │ │ │ +and erlang:system_info(schedulers).

      • system_flag(outstanding_system_requests_limit, 1..134217727) -> 1..134217727

        Sets a limit on the amount of outstanding requests made by a system process │ │ │ orchestrating system wide changes. Currently there are two such processes:

        • The Code Purger - The code purger orchestrates checking of references to │ │ │ old code before old code is removed from the system.

        • The Literal Area Collector - The literal area collector orchestrates │ │ │ copying of references from old literal areas before removal of such areas from │ │ │ the system.

        Each of these processes are allowed to have as many outstanding requests as this │ │ │ limit is set to. By default this limit is set to twice the amount of │ │ │ schedulers on the system. This will ensure │ │ │ that schedulers will have enough work scheduled to perform these operations as │ │ │ quickly as possible at TRUNCATED DUE TO SIZE LIMIT: 10485760 bytes