aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-02-14 12:04:56 +0100
committerBjörn Gustavsson <[email protected]>2013-02-14 12:04:56 +0100
commit9905024a8b7d9a26f7fdf6640ab391c5cb8f6780 (patch)
tree435f9e18d02c565efa184b56956dfa4db35a173a /lib/kernel
parent3a223f53c7c4fa5d2656c8cdc5dae74f20185b04 (diff)
parent1d6ac47dc148bcfdb61c205b709b61172374eb30 (diff)
downloadotp-9905024a8b7d9a26f7fdf6640ab391c5cb8f6780.tar.gz
otp-9905024a8b7d9a26f7fdf6640ab391c5cb8f6780.tar.bz2
otp-9905024a8b7d9a26f7fdf6640ab391c5cb8f6780.zip
Merge branch 'bjorn/stdlib/types'
* bjorn/stdlib/types: Make the file:filename() type more restrictive c: Remove handling of binaries in return from file:list_dir/1
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/doc/src/file.xml3
-rw-r--r--lib/kernel/src/file.erl11
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml
index a96da0fb4e..069b13eacf 100644
--- a/lib/kernel/doc/src/file.xml
+++ b/lib/kernel/doc/src/file.xml
@@ -110,6 +110,9 @@
<name name="filename"/>
</datatype>
<datatype>
+ <name name="filename_all"/>
+ </datatype>
+ <datatype>
<name name="io_device"/>
<desc>
<p>As returned by
diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl
index 6b92d6c025..5f52f94270 100644
--- a/lib/kernel/src/file.erl
+++ b/lib/kernel/src/file.erl
@@ -67,8 +67,8 @@
-export([ipread_s32bu_p32bu_int/3]).
%% Types that can be used from other modules -- alphabetically ordered.
--export_type([date_time/0, fd/0, file_info/0, filename/0, io_device/0,
- name/0, posix/0]).
+-export_type([date_time/0, fd/0, file_info/0, filename/0, filename_all/0,
+ io_device/0, name/0, posix/0]).
%%% Includes and defines
-include("file.hrl").
@@ -80,7 +80,8 @@
-define(RAM_FILE, ram_file). % Module
%% data types
--type filename() :: string() | binary().
+-type filename() :: string().
+-type filename_all() :: string() | binary().
-type file_info() :: #file_info{}.
-type fd() :: #file_descriptor{}.
-type io_device() :: pid() | fd().
@@ -280,7 +281,7 @@ read_link(Name) ->
-spec read_link_all(Name) -> {ok, Filename} | {error, Reason} when
Name :: name(),
- Filename :: filename(),
+ Filename :: filename_all(),
Reason :: posix() | badarg.
read_link_all(Name) ->
@@ -313,7 +314,7 @@ list_dir(Name) ->
-spec list_dir_all(Dir) -> {ok, Filenames} | {error, Reason} when
Dir :: name(),
- Filenames :: [filename()],
+ Filenames :: [filename_all()],
Reason :: posix() | badarg.
list_dir_all(Name) ->