Empty directory: Difference between revisions
Content added Content deleted
(Added F# version) |
(Added Erlang) |
||
Line 159: | Line 159: | ||
<pre>somedir is empty: false</pre> |
<pre>somedir is empty: false</pre> |
||
=={{header|Erlang}}== |
|||
From the Erlang shell, or in a program, match {ok, []}. It this works the directory is empty. |
|||
{{out}} |
|||
<pre> |
|||
3> {ok, []} = file:list_dir_all("/usr"). |
|||
** exception error: no match of right hand side value |
|||
{ok,["X11R6","X11","standalone","share","sbin","local", |
|||
"libexec","lib","bin"]} |
|||
4> {ok, []} = file:list_dir_all("/asd"). |
|||
** exception error: no match of right hand side value {error,enoent} |
|||
5> {ok, []} = file:list_dir_all("./empty"). |
|||
{ok,[]} |
|||
</pre> |
|||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |