Merge pull request #63 from lowks/master

changes to add another clause to the directory/file check
This commit is contained in:
Jordan Wilberding 2014-05-15 09:34:28 +02:00
commit 364726c166

View file

@ -118,7 +118,7 @@ is_symlink(Path) ->
false
end.
%% @doc returns the type of the file.
-spec type(file:name()) -> file | symlink | directory.
-spec type(file:name()) -> file | symlink | directory | undefined.
type(Path) ->
case filelib:is_regular(Path) of
true ->
@ -127,9 +127,12 @@ type(Path) ->
case is_symlink(Path) of
true ->
symlink;
false ->
directory
false -> case filelib:is_dir(Path) of
true -> directory;
false -> undefined
end
end
end.
%% @doc gets the real path of a directory. This is mostly useful for
%% resolving symlinks. Be aware that this temporarily changes the