سؤال

Erlang does not have fixed sized integers such as 32-bit or 64-bit sized. What is the library call to write say an integer to disk in a binary representation? And what is that binary representation?

More generally what is the disk binary representation for some arbitrary data structure?

هل كانت مفيدة؟

المحلول

You can serialize any erlang data structure using term_to_binary function. Your data will be serialized into erlang external term format.

Please look at http://erlang.org/doc/apps/erts/erl_ext_dist.html

and then, write to disk using file:write_file function http://www.erlang.org/doc/man/file.html#write_file-2

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top