diff options
author | Erland Schönbeck <[email protected]> | 2014-07-11 11:09:09 +0200 |
---|---|---|
committer | Erland Schönbeck <[email protected]> | 2014-07-11 11:09:09 +0200 |
commit | 9a1419a7d4325085dc2235a8531d77e1d96ea689 (patch) | |
tree | ebb7ed16ce92c1c99b44091bee9e4d2a7220ef75 /lib/stdlib/src/filelib.erl | |
parent | a56f6e3e716c4a2c8f16933e1e30759381c4fdb8 (diff) | |
parent | 934b6de4d2ab6c31c5217e1ba4779ade9e37cc83 (diff) | |
download | otp-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.erl | 14 |
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) -> |