diff options
author | Andre Nathan <[email protected]> | 2019-04-18 17:45:04 -0300 |
---|---|---|
committer | Andre Nathan <[email protected]> | 2019-05-14 11:16:58 -0300 |
commit | bd3f4f05bb6dafdedbae5671ee50c769a3560021 (patch) | |
tree | 45c7a8e844a8f7b10cce1b6e20646fece3ef20a6 /lib/kernel/src | |
parent | c6d5af1054f8d555a69111f29b59d5485ef8e48f (diff) | |
download | otp-bd3f4f05bb6dafdedbae5671ee50c769a3560021.tar.gz otp-bd3f4f05bb6dafdedbae5671ee50c769a3560021.tar.bz2 otp-bd3f4f05bb6dafdedbae5671ee50c769a3560021.zip |
file: allow open/2 to work on directories
This is useful mainly to ensure that a new file has been persisted
to disk by calling file:sync/1 or file:datasync/1 on file's parent
directory.
Diffstat (limited to 'lib/kernel/src')
-rw-r--r-- | lib/kernel/src/file.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl index 1d4e37196c..a0616da670 100644 --- a/lib/kernel/src/file.erl +++ b/lib/kernel/src/file.erl @@ -460,7 +460,7 @@ raw_write_file_info(Name, #file_info{} = Info) -> -spec open(File, Modes) -> {ok, IoDevice} | {error, Reason} when File :: Filename | iodata(), Filename :: name_all(), - Modes :: [mode() | ram], + Modes :: [mode() | ram | directory], IoDevice :: io_device(), Reason :: posix() | badarg | system_limit. @@ -1143,7 +1143,7 @@ path_script(Path, File, Bs) -> {ok, IoDevice, FullName} | {error, Reason} when Path :: [Dir :: name_all()], Filename :: name_all(), - Modes :: [mode()], + Modes :: [mode() | directory], IoDevice :: io_device(), FullName :: filename_all(), Reason :: posix() | badarg | system_limit. |