Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between io:format and io:fwrite in Erlang?

Tags:

syntax

io

erlang

Even in the documentation, there does not seem to be any difference.

like image 952
Mahathi Vempati Avatar asked Mar 19 '20 07:03

Mahathi Vempati


People also ask

What is fwrite in Erlang and how to use it?

You would have seen this (io:fwrite) used in all of the above programs. The fwrite function is part of the ‘io’ module or Erlang, which can be used to output the value of variables in the program. The following example shows a few more parameters which can be used with the fwrite statement.

What is the default IO Device in Erlang?

All Erlang processes have a default standard IO device. This device is used when no IoDeviceargument is specified in the above function calls. However, it is sometimes desirable to use an explicit IoDeviceargument which refers to the default IO device. This is the case with functions that can access either a file or the default IO device.

What is the use of ~W in Erlang?

The ~w is for writing with standard syntax. It can can print any Erlang term. The output can be parsed to return the original Erlang term, unless it contained terms that don't have a parsable written representation, i.e. pids, ports and references.

Is the io domain extension right for You?

If you have a tech startup or even a blog that centers around modern technology, the .io domain extension may be for you! It has a natural connection to computer science and can attract all the right attention.


1 Answers

io:fwrite was introduced as an alias for io:format, for symmetry with io:fread, but most people kept using the name format anyway.

like image 128
RichardC Avatar answered Oct 06 '22 08:10

RichardC