Merge pull request #63 from lowks/master
changes to add another clause to the directory/file check
This commit is contained in:
commit
364726c166
1 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue