diff options
author | Björn Gustavsson <[email protected]> | 2013-05-29 15:19:09 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-05-29 15:19:09 +0200 |
commit | 3c12a584fc8b88625902342747c7b3d8a3eb06b3 (patch) | |
tree | f0bc4f26807a750e1e8f84dfaaa3e9b4188cbdb6 /lib/stdlib/src | |
parent | 59fc364f7426d1a05d916900b42ba7aa0fda32bc (diff) | |
parent | 67d83e15fdee068217df7f14a32fb901d7d4d91b (diff) | |
download | otp-3c12a584fc8b88625902342747c7b3d8a3eb06b3.tar.gz otp-3c12a584fc8b88625902342747c7b3d8a3eb06b3.tar.bz2 otp-3c12a584fc8b88625902342747c7b3d8a3eb06b3.zip |
Merge branch 'bjorn/stdlib/improve-ls/OTP-11108' into maint
* bjorn/stdlib/improve-ls/OTP-11108:
Teach c:ls/1 to show non-directory files
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/c.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl index 91d317489c..6e96e3d564 100644 --- a/lib/stdlib/src/c.erl +++ b/lib/stdlib/src/c.erl @@ -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; |