diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-03-04 13:40:10 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-03-04 13:40:10 +0000 |
commit | 8753a55923e115ff39bb703b7c28fdaa4fd9cc29 (patch) | |
tree | 0b7c5b2660062fa3d632a9fa28f76c1edff944b0 /src/rabbit_file.erl | |
parent | a571a6748de982f518d0f00af62d39c63ec29379 (diff) | |
parent | cdf1c82e6fc3737c7a9583b3ad52e1a04714d470 (diff) | |
download | rabbitmq-server-8753a55923e115ff39bb703b7c28fdaa4fd9cc29.tar.gz |
stable to default
Diffstat (limited to 'src/rabbit_file.erl')
-rw-r--r-- | src/rabbit_file.erl | 9 |
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). |