Permalink
Browse files

Fix file existence checks

  • Loading branch information...
1 parent a887080 commit 58fd80917a2fab2353bc19f9f4bc648d8e54db92 @tuncer tuncer committed Jan 7, 2011
@@ -174,7 +174,7 @@ referenced_dtls1(Step, Config, Seen) ->
end, Step)),
DocRoot = option(doc_root, DtlOpts),
WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ],
- Existing = [F || F <- WithPaths, filelib:is_file(F)],
+ Existing = [F || F <- WithPaths, filelib:is_regular(F)],
New = sets:subtract(sets:from_list(Existing), Seen),
case sets:size(New) of
0 -> Seen;
View
@@ -195,7 +195,7 @@ is_quickcheck_avail() ->
{error, bad_name} ->
IsAvail = false;
Dir ->
- IsAvail = filelib:is_file(filename:join(Dir, "eqc.hrl"))
+ IsAvail = filelib:is_regular(filename:join(Dir, "eqc.hrl"))
end,
erlang:put(is_quickcheck_avail, IsAvail),
?DEBUG("Quickcheck availability: ~p\n", [IsAvail]),
@@ -133,7 +133,7 @@ referenced_pegs1(Step, Config, Seen) ->
end, Step)),
DocRoot = option(doc_root, NeoOpts),
WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ],
- Existing = [F || F <- WithPaths, filelib:is_file(F)],
+ Existing = [F || F <- WithPaths, filelib:is_regular(F)],
New = sets:subtract(sets:from_list(Existing), Seen),
case sets:size(New) of
0 -> Seen;
View
@@ -33,7 +33,7 @@ is_rel_dir() ->
is_rel_dir(Dir) ->
Fname = filename:join([Dir, "reltool.config"]),
- case filelib:is_file(Fname) of
+ case filelib:is_regular(Fname) of
true ->
{true, Fname};
false ->
View
@@ -259,7 +259,7 @@ render(Bin, Context) ->
write_file(Output, Data, Force) ->
%% determine if the target file already exists
- FileExists = filelib:is_file(Output),
+ FileExists = filelib:is_regular(Output),
%% perform the function if we're allowed,
%% otherwise just process the next template

0 comments on commit 58fd809

Please sign in to comment.