Skip to content

Commit eb36c2b

Browse files
author
José Valim
committed
Improve docs for File
1 parent 3537bbb commit eb36c2b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/elixir/lib/file.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,13 @@ defmodule File do
712712
@doc """
713713
Opens the given `path` according to the given list of modes.
714714
715-
By default, the file is opened in read mode, as a binary with utf8 encoding.
715+
In order to write and read files, one must use the functions
716+
in the IO module. By default, a file is opened on binary mode
717+
which requires the functions `IO.binread`, `IO.binwrite` and
718+
`IO.binreadline` to interact with the file. A developer may pass
719+
`:utf8` as an option when opening the file and then all other
720+
functions from IO are available, since they work directly with
721+
Unicode data.
716722
717723
The allowed modes:
718724

0 commit comments

Comments
 (0)