@@ -59,19 +59,19 @@ defmodule File do
5959 This module contains functions to manipulate files.
6060
6161 Some of those functions are low-level, allowing the user
62- to interact with the file or IO devices, like `File. open/2`,
63- `File. copy/3` and others. This module also provides higher
62+ to interact with the file or IO devices, like `open/2`,
63+ `copy/3` and others. This module also provides higher
6464 level functions that works with filenames and have their naming
6565 based on UNIX variants. For example, one can copy a file
66- via `File. cp/3` and remove files and directories recursively
67- via `File. rm_rf/2 `
66+ via `cp/3` and remove files and directories recursively
67+ via `rm_rf/1 `
6868
6969 In order to write and read files, one must use the functions
70- in the IO module. By default, a file is opened in binary mode
71- which requires the functions `IO.binread` and `IO.binwrite`
70+ in the `IO` module. By default, a file is opened in binary mode
71+ which requires the functions `IO.binread/2 ` and `IO.binwrite/2 `
7272 to interact with the file. A developer may pass `:utf8` as an
7373 option when opening the file and then all other functions
74- from IO are available, since they work directly with Unicode
74+ from `IO` are available, since they work directly with Unicode
7575 data.
7676
7777 Most of the functions in this module return `:ok` or
@@ -104,7 +104,7 @@ defmodule File do
104104 alias :filelib , as: FL
105105
106106 @ doc """
107- Returns true if the path is a regular file.
107+ Returns ` true` if the path is a regular file.
108108
109109 ## Examples
110110
@@ -116,14 +116,14 @@ defmodule File do
116116 end
117117
118118 @ doc """
119- Returns true if the path is a directory.
119+ Returns ` true` if the path is a directory.
120120 """
121121 def dir? ( path ) do
122122 FL . is_dir ( path )
123123 end
124124
125125 @ doc """
126- Returns true if the given path exists.
126+ Returns ` true` if the given path exists.
127127 It can be regular file, directory, socket,
128128 symbolic link, named pipe or device file.
129129
@@ -161,7 +161,7 @@ defmodule File do
161161 end
162162
163163 @ doc """
164- Same as `mkdir`, but raises an exception in case of failure. Otherwise `:ok`.
164+ Same as `mkdir/1 `, but raises an exception in case of failure. Otherwise `:ok`.
165165 """
166166 def mkdir! ( path ) do
167167 case mkdir ( path ) do
@@ -186,7 +186,7 @@ defmodule File do
186186 end
187187
188188 @ doc """
189- Same as `mkdir_p`, but raises an exception in case of failure. Otherwise `:ok`.
189+ Same as `mkdir_p/1 `, but raises an exception in case of failure. Otherwise `:ok`.
190190 """
191191 def mkdir_p! ( path ) do
192192 case mkdir_p ( path ) do
@@ -210,15 +210,15 @@ defmodule File do
210210 On some platforms, `:enoent` is returned instead.
211211 * :enomem - There is not enough memory for the contents of the file.
212212
213- You can use `:file.format_error(reason) ` to get a descriptive string of the error.
213+ You can use `:file.format_error/1 ` to get a descriptive string of the error.
214214 """
215215 def read ( path ) do
216216 F . read_file ( path )
217217 end
218218
219219 @ doc """
220220 Returns binary with the contents of the given filename or raises
221- File.Error if an error occurs.
221+ ` File.Error` if an error occurs.
222222 """
223223 def read! ( path ) do
224224 case read ( path ) do
@@ -233,14 +233,14 @@ defmodule File do
233233 Returns information about the `path`. If it exists, it
234234 returns a `{ :ok, info }` tuple, where info is a
235235 `File.Info` record. Retuns `{ :error, reason }` with
236- the same reasons as `File. read` if a failure occurs.
236+ the same reasons as `read/1 ` if a failure occurs.
237237
238238 ## Options
239239
240240 The accepted options are:
241241
242- * `:time` if the time should be local, universal or posix.
243- Default is local.
242+ * `:time` if the time should be `: local`, `: universal` or `: posix` .
243+ Default is `: local` .
244244
245245 """
246246 def stat ( path , opts // [ ] ) do
@@ -253,7 +253,7 @@ defmodule File do
253253 end
254254
255255 @ doc """
256- Same as `stat` but returns the `File.Stat` directly and
256+ Same as `stat/2 ` but returns the `File.Stat` directly and
257257 throws `File.Error` if an error is returned.
258258 """
259259 def stat! ( path , opts // [ ] ) do
@@ -296,7 +296,7 @@ defmodule File do
296296 end
297297
298298 @ doc """
299- Same as `touch/1 ` but raises an exception if it fails.
299+ Same as `touch/2 ` but raises an exception if it fails.
300300 Returns `:ok` otherwise.
301301 """
302302 def touch! ( path , time // :calendar . local_time ) do
@@ -311,7 +311,7 @@ defmodule File do
311311 Copies the contents of `source` to `destination`.
312312
313313 Both parameters can be a filename or an io device opened
314- with `File. open/2`. `bytes_count` specifies the number of
314+ with `open/2`. `bytes_count` specifies the number of
315315 bytes to copy, the default being `:infinity`.
316316
317317 If file `destination` already exists, it is overwritten
@@ -320,14 +320,14 @@ defmodule File do
320320 Returns `{ :ok, bytes_copied }` if successful,
321321 `{ :error, reason }` otherwise.
322322
323- Compared to the `File. cp/3`, this function is more low-level,
323+ Compared to the `cp/3`, this function is more low-level,
324324 allowing a copy from device to device limited by a number of
325- bytes. On the other hand, `File. cp/3` performs more extensive
325+ bytes. On the other hand, `cp/3` performs more extensive
326326 checks on both source and destination and it also preserves
327327 the file mode after copy.
328328
329329 Typical error reasons are the same as in `open/2`,
330- `read/1` and `write/2 `.
330+ `read/1` and `write/3 `.
331331 """
332332 def copy ( source , destination , bytes_count // :infinity ) do
333333 F . copy ( source , destination , bytes_count )
@@ -355,15 +355,15 @@ defmodule File do
355355 copies the contents of `source` to `destination/source`.
356356
357357 If a file already exists in the destination, it invokes a
358- callback which should return true if the existing file
359- should be overwritten, false otherwise. It defaults to return true.
358+ callback which should return ` true` if the existing file
359+ should be overwritten, ` false` otherwise. It defaults to return ` true` .
360360
361361 It returns `:ok` in case of success, returns
362362 `{ :error, reason }` otherwise.
363363
364364 If you want to copy contents from an io device to another device
365365 or do a straight copy from a source to a destination without
366- preserving modes, check `File. copy/3` instead.
366+ preserving modes, check `copy/3` instead.
367367 """
368368 def cp ( source , destination , callback // fn ( _ , _ ) -> true end ) do
369369 output =
@@ -381,7 +381,7 @@ defmodule File do
381381 end
382382
383383 @ doc """
384- The same as `cp/3`, but raises File.CopyError if it fails.
384+ The same as `cp/3`, but raises ` File.CopyError` if it fails.
385385 Returns the list of copied files otherwise.
386386 """
387387 def cp! ( source , destination , callback // fn ( _ , _ ) -> true end ) do
@@ -407,8 +407,8 @@ defmodule File do
407407
408408 If a file already exists in the destination,
409409 it invokes a callback which should return
410- true if the existing file should be overwritten,
411- false otherwise. It defaults to return true.
410+ ` true` if the existing file should be overwritten,
411+ ` false` otherwise. It defaults to return ` true` .
412412
413413 If a directory already exists in the destination
414414 where a file is meant to be (or otherwise), this
@@ -456,7 +456,7 @@ defmodule File do
456456 end
457457
458458 @ doc """
459- The same as `cp_r/3`, but raises File.CopyError if it fails.
459+ The same as `cp_r/3`, but raises ` File.CopyError` if it fails.
460460 Returns the list of copied files otherwise.
461461 """
462462 def cp_r! ( source , destination , callback // fn ( _ , _ ) -> true end ) do
@@ -607,7 +607,7 @@ defmodule File do
607607 end
608608
609609 @ doc """
610- Same as `rm`, but raises an exception in case of failure. Otherwise `:ok`.
610+ Same as `rm/1 `, but raises an exception in case of failure. Otherwise `:ok`.
611611 """
612612 def rm! ( path ) do
613613 case rm ( path ) do
@@ -724,8 +724,8 @@ defmodule File do
724724 Opens the given `path` according to the given list of modes.
725725
726726 In order to write and read files, one must use the functions
727- in the IO module. By default, a file is opened in binary mode
728- which requires the functions `IO.binread` and `IO.binwrite`
727+ in the `IO` module. By default, a file is opened in binary mode
728+ which requires the functions `IO.binread/2 ` and `IO.binwrite/2 `
729729 to interact with the file. A developer may pass `:utf8` as an
730730 option when opening the file and then all other functions from
731731 `IO` are available, since they work directly with Unicode data.
@@ -758,8 +758,8 @@ defmodule File do
758758
759759 If a function is given to modes (instead of a list), it dispatches to `open/3`.
760760
761- Check ` http://www.erlang.org/doc/man/file.html#open-2` for more information about
762- other options as `read_ahead` and `delayed_write`.
761+ Check http://www.erlang.org/doc/man/file.html#open-2 for more information about
762+ other options like `read_ahead` and `delayed_write`.
763763
764764 This function returns:
765765
@@ -879,7 +879,7 @@ defmodule File do
879879 end
880880
881881 @ doc """
882- The same as `cd/0 `, but raises an exception if it fails.
882+ The same as `cd/1 `, but raises an exception if it fails.
883883 """
884884 def cd! ( path ) do
885885 case F . set_cwd ( path ) do
@@ -964,7 +964,7 @@ defmodule File do
964964 @ doc """
965965 Opens the given `file` with the given `mode` and
966966 returns its binstream. The returned stream will
967- fail for the same reasons as `File. open!`. Note
967+ fail for the same reasons as `open!/2 `. Note
968968 that the file is opened when the iteration begins.
969969 """
970970 def binstream! ( file , mode // [ ] ) do
0 commit comments