diff options
Diffstat (limited to 'lib/stdlib/src/c.erl')
-rw-r--r-- | lib/stdlib/src/c.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl index 91d317489c..fb6b8c8661 100644 --- a/lib/stdlib/src/c.erl +++ b/lib/stdlib/src/c.erl @@ -694,7 +694,7 @@ pwd() -> Dir :: file:name(). cd(Dir) -> - file:set_cwd(Dir), + _ = file:set_cwd(Dir), pwd(). %% ls() @@ -713,8 +713,10 @@ ls(Dir) -> case file:list_dir(Dir) of {ok, Entries} -> ls_print(sort(Entries)); - {error,_E} -> - format("Invalid directory\n") + {error, enotdir} -> + ls_print([Dir]); + {error, Error} -> + format("~s\n", [file:format_error(Error)]) end. ls_print([]) -> ok; |