@@ -10,40 +10,40 @@ defmodule File.Stat do
10
10
11
11
Its fields are:
12
12
13
- * `size` - Size of file in bytes.
13
+ * `size` - size of file in bytes.
14
14
15
- * `type` - `:device`, ` :directory`, ` :regular`, ` :other`. The type of the
15
+ * `type` - `:device | :directory | :regular | :other`; the type of the
16
16
file.
17
17
18
- * `access` - `:read`, ` :write`, ` :read_write`, ` :none`. The current system
18
+ * `access` - `:read | :write | :read_write | :none`; the current system
19
19
access to the file.
20
20
21
- * `atime` - The last time the file was read.
21
+ * `atime` - the last time the file was read.
22
22
23
- * `mtime` - The last time the file was written.
23
+ * `mtime` - the last time the file was written.
24
24
25
- * `ctime` - The interpretation of this time field depends on the operating
25
+ * `ctime` - the interpretation of this time field depends on the operating
26
26
system. On Unix, it is the last time the file or the inode was changed.
27
- In Windows, it is the create time.
27
+ In Windows, it is the time of creation .
28
28
29
- * `mode` - The file permissions.
29
+ * `mode` - the file permissions.
30
30
31
- * `links` - The number of links to this file. This is always 1 for file
31
+ * `links` - the number of links to this file. This is always 1 for file
32
32
systems which have no concept of links.
33
33
34
- * `major_device` - Identifies the file system where the file is located.
34
+ * `major_device` - identifies the file system where the file is located.
35
35
In windows, the number indicates a drive as follows: 0 means A:, 1 means
36
36
B:, and so on.
37
37
38
- * `minor_device` - Only valid for character devices on Unix. In all other
38
+ * `minor_device` - only valid for character devices on Unix. In all other
39
39
cases, this field is zero.
40
40
41
- * `inode` - Gives the inode number. On non-Unix file systems, this field
41
+ * `inode` - gives the inode number. On non-Unix file systems, this field
42
42
will be zero.
43
43
44
- * `uid` - Indicates the owner of the file.
44
+ * `uid` - indicates the owner of the file.
45
45
46
- * `gid` - Gives the group that the owner of the file belongs to. Will be
46
+ * `gid` - gives the group that the owner of the file belongs to. Will be
47
47
zero for non-Unix file systems.
48
48
49
49
The time type returned in `atime`, `mtime`, and `ctime` is dependent on the
@@ -280,13 +280,13 @@ defmodule File do
280
280
281
281
Typical error reasons are:
282
282
283
- * `:eacces` - Missing search or write permissions for the parent directories
284
- of `path`.
285
- * `:eexist` - There is already a file or directory named `path`.
286
- * `:enoent` - A component of `path` does not exist.
287
- * `:enospc` - There is a no space left on the device.
288
- * `:enotdir` - A component of `path` is not a directory.
289
- On some platforms, `:enoent` is returned instead.
283
+ * `:eacces` - missing search or write permissions for the parent
284
+ directories of `path`
285
+ * `:eexist` - there is already a file or directory named `path`
286
+ * `:enoent` - a component of `path` does not exist
287
+ * `:enospc` - there is a no space left on the device
288
+ * `:enotdir` - a component of `path` is not a directory;
289
+ on some platforms, `:enoent` is returned instead
290
290
"""
291
291
@ spec mkdir ( Path . t ) :: :ok | { :error , posix }
292
292
def mkdir ( path ) do
@@ -312,10 +312,10 @@ defmodule File do
312
312
313
313
Typical error reasons are:
314
314
315
- * `:eacces` - Missing search or write permissions for the parent directories
316
- of `path`.
317
- * `:enospc` - There is a no space left on the device.
318
- * `:enotdir` - A component of `path` is not a directory.
315
+ * `:eacces` - missing search or write permissions for the parent
316
+ directories of `path`
317
+ * `:enospc` - there is a no space left on the device
318
+ * `:enotdir` - a component of `path` is not a directory
319
319
"""
320
320
@ spec mkdir_p ( Path . t ) :: :ok | { :error , posix }
321
321
def mkdir_p ( path ) do
@@ -341,13 +341,13 @@ defmodule File do
341
341
342
342
Typical error reasons:
343
343
344
- * `:enoent` - The file does not exist.
345
- * `:eacces` - Missing permission for reading the file,
346
- or for searching one of the parent directories.
347
- * `:eisdir` - The named file is a directory.
348
- * `:enotdir` - A component of the file name is not a directory.
349
- On some platforms, `:enoent` is returned instead.
350
- * `:enomem` - There is not enough memory for the contents of the file.
344
+ * `:enoent` - the file does not exist
345
+ * `:eacces` - missing permission for reading the file,
346
+ or for searching one of the parent directories
347
+ * `:eisdir` - the named file is a directory
348
+ * `:enotdir` - a component of the file name is not a directory;
349
+ on some platforms, `:enoent` is returned instead
350
+ * `:enomem` - there is not enough memory for the contents of the file
351
351
352
352
You can use `:file.format_error/1` to get a descriptive string of the error.
353
353
"""
@@ -381,8 +381,7 @@ defmodule File do
381
381
382
382
The accepted options are:
383
383
384
- * `:time` if the time should be `:local`, `:universal` or `:posix`.
385
- Default is `:local`.
384
+ * `:time` - `:local | :universal | :posix`; default: `:local`
386
385
387
386
"""
388
387
@ spec stat ( Path . t , stat_options ) :: { :ok , File.Stat . t } | { :error , posix }
@@ -728,13 +727,13 @@ defmodule File do
728
727
729
728
Typical error reasons are:
730
729
731
- * `:enoent` - A component of the file name does not exist.
732
- * `:enotdir` - A component of the file name is not a directory.
733
- On some platforms, enoent is returned instead.
734
- * `:enospc` - There is a no space left on the device.
735
- * `:eacces` - Missing permission for writing the file or searching one of the
736
- parent directories.
737
- * `:eisdir` - The named file is a directory.
730
+ * `:enoent` - a component of the file name does not exist
731
+ * `:enotdir` - a component of the file name is not a directory;
732
+ on some platforms, enoent is returned instead
733
+ * `:enospc` - there is a no space left on the device
734
+ * `:eacces` - missing permission for writing the file or searching one of
735
+ the parent directories
736
+ * `:eisdir` - the named file is a directory
738
737
739
738
The writing is automatically done in `:raw` mode. Check
740
739
`File.open/2` for other available options.
@@ -765,12 +764,12 @@ defmodule File do
765
764
766
765
Typical error reasons are:
767
766
768
- * `:enoent` - The file does not exist.
769
- * `:eacces` - Missing permission for the file or one of its parents.
770
- * `:eperm` - The file is a directory and user is not super-user.
771
- * `:enotdir` - A component of the file name is not a directory.
772
- On some platforms, enoent is returned instead.
773
- * `:einval` - Filename had an improper type, such as tuple.
767
+ * `:enoent` - the file does not exist
768
+ * `:eacces` - missing permission for the file or one of its parents
769
+ * `:eperm` - the file is a directory and user is not super-user
770
+ * `:enotdir` - a component of the file name is not a directory;
771
+ on some platforms, enoent is returned instead
772
+ * `:einval` - filename had an improper type, such as tuple
774
773
775
774
## Examples
776
775
@@ -966,31 +965,31 @@ defmodule File do
966
965
967
966
The allowed modes:
968
967
969
- * `:read` - The file, which must exist, is opened for reading.
968
+ * `:read` - the file, which must exist, is opened for reading.
970
969
971
- * `:write` - The file is opened for writing. It is created if it does not
970
+ * `:write` - the file is opened for writing. It is created if it does not
972
971
exist.
973
972
974
- If the file exists, and if write is not combined with read, the file will
975
- be truncated.
973
+ If the file does exists, and if write is not combined with read, the file
974
+ will be truncated.
976
975
977
- * `:append` - The file will be opened for writing, and it will be created
976
+ * `:append` - the file will be opened for writing, and it will be created
978
977
if it does not exist. Every write operation to a file opened with append
979
978
will take place at the end of the file.
980
979
981
- * `:exclusive` - The file, when opened for writing, is created if it does
980
+ * `:exclusive` - the file, when opened for writing, is created if it does
982
981
not exist. If the file exists, open will return `{:error, :eexist}`.
983
982
984
- * `:char_list` - When this term is given, read operations on the file will
985
- return char lists rather than binaries;
983
+ * `:char_list` - when this term is given, read operations on the file will
984
+ return char lists rather than binaries.
986
985
987
- * `:compressed` - Makes it possible to read or write gzip compressed files.
986
+ * `:compressed` - makes it possible to read or write gzip compressed files.
988
987
989
988
The compressed option must be combined with either read or write, but not
990
989
both. Note that the file size obtained with `stat/1` will most probably
991
990
not match the number of bytes that can be read from a compressed file.
992
991
993
- * `:utf8` - This option denotes how data is actually stored in the disk
992
+ * `:utf8` - this option denotes how data is actually stored in the disk
994
993
file and makes the file perform automatic translation of characters to
995
994
and from utf-8.
996
995
@@ -1004,7 +1003,7 @@ defmodule File do
1004
1003
1005
1004
This function returns:
1006
1005
1007
- * `{:ok, io_device}` - The file has been opened in the requested mode.
1006
+ * `{:ok, io_device}` - the file has been opened in the requested mode.
1008
1007
1009
1008
`io_device` is actually the pid of the process which handles the file.
1010
1009
This process is linked to the process which originally opened the file.
@@ -1014,7 +1013,7 @@ defmodule File do
1014
1013
An `io_device` returned from this call can be used as an argument to the
1015
1014
`IO` module functions.
1016
1015
1017
- * `{:error, reason}` - The file could not be opened.
1016
+ * `{:error, reason}` - the file could not be opened.
1018
1017
1019
1018
## Examples
1020
1019
0 commit comments