aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/filelib.erl
diff options
context:
space:
mode:
authorErland Schönbeck <[email protected]>2014-07-11 11:09:09 +0200
committerErland Schönbeck <[email protected]>2014-07-11 11:09:09 +0200
commit9a1419a7d4325085dc2235a8531d77e1d96ea689 (patch)
treeebb7ed16ce92c1c99b44091bee9e4d2a7220ef75 /lib/stdlib/src/filelib.erl
parenta56f6e3e716c4a2c8f16933e1e30759381c4fdb8 (diff)
parent934b6de4d2ab6c31c5217e1ba4779ade9e37cc83 (diff)
downloadotp-9a1419a7d4325085dc2235a8531d77e1d96ea689.tar.gz
otp-9a1419a7d4325085dc2235a8531d77e1d96ea689.tar.bz2
otp-9a1419a7d4325085dc2235a8531d77e1d96ea689.zip
Merge branch 'maint-17' into maint
Diffstat (limited to 'lib/stdlib/src/filelib.erl')
-rw-r--r--lib/stdlib/src/filelib.erl14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/stdlib/src/filelib.erl b/lib/stdlib/src/filelib.erl
index c0921e4cf1..9efbe8da20 100644
--- a/lib/stdlib/src/filelib.erl
+++ b/lib/stdlib/src/filelib.erl
@@ -265,7 +265,7 @@ do_wildcard(Pattern, Cwd, Mod) ->
lists:sort(Files).
do_wildcard_1({exists,File}, Mod) ->
- case eval_read_file_info(File, Mod) of
+ case eval_read_link_info(File, Mod) of
{ok,_} -> [File];
_ -> []
end;
@@ -488,7 +488,7 @@ badpattern(Reason) ->
error({badpattern,Reason}).
eval_read_file_info(File, file) ->
- file:read_link_info(File);
+ file:read_file_info(File);
eval_read_file_info(File, erl_prim_loader) ->
case erl_prim_loader:read_file_info(File) of
error -> {error, erl_prim_loader};
@@ -497,6 +497,16 @@ eval_read_file_info(File, erl_prim_loader) ->
eval_read_file_info(File, Mod) ->
Mod:read_file_info(File).
+eval_read_link_info(File, file) ->
+ file:read_link_info(File);
+eval_read_link_info(File, erl_prim_loader) ->
+ case erl_prim_loader:read_link_info(File) of
+ error -> {error, erl_prim_loader};
+ Res-> Res
+ end;
+eval_read_link_info(File, Mod) ->
+ Mod:read_link_info(File).
+
eval_list_dir(Dir, file) ->
file:list_dir(Dir);
eval_list_dir(Dir, erl_prim_loader) ->