summaryrefslogtreecommitdiff
path: root/src/rabbit_file.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-03-04 13:40:10 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-03-04 13:40:10 +0000
commit8753a55923e115ff39bb703b7c28fdaa4fd9cc29 (patch)
tree0b7c5b2660062fa3d632a9fa28f76c1edff944b0 /src/rabbit_file.erl
parenta571a6748de982f518d0f00af62d39c63ec29379 (diff)
parentcdf1c82e6fc3737c7a9583b3ad52e1a04714d470 (diff)
downloadrabbitmq-server-8753a55923e115ff39bb703b7c28fdaa4fd9cc29.tar.gz
stable to default
Diffstat (limited to 'src/rabbit_file.erl')
-rw-r--r--src/rabbit_file.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rabbit_file.erl b/src/rabbit_file.erl
index 1a766b05..4658ecfd 100644
--- a/src/rabbit_file.erl
+++ b/src/rabbit_file.erl
@@ -94,9 +94,12 @@ ensure_dir_internal(File) ->
end.
wildcard(Pattern, Dir) ->
- {ok, Files} = list_dir(Dir),
- {ok, RE} = re:compile(Pattern, [anchored]),
- [File || File <- Files, match =:= re:run(File, RE, [{capture, none}])].
+ case list_dir(Dir) of
+ {ok, Files} -> {ok, RE} = re:compile(Pattern, [anchored]),
+ [File || File <- Files,
+ match =:= re:run(File, RE, [{capture, none}])];
+ {error, _} -> []
+ end.
list_dir(Dir) -> with_fhc_handle(fun () -> prim_file:list_dir(Dir) end).