On Thu, Dec 3, 2020 at 11:56 AM José Valim <jose.va...@dashbit.co> wrote:
>
> About 1, Path.wildcard uses File.ls underneath, so it would be the same.
>
> About 2, Path.wildcard ignores all dots by default after reading them from 
> File.ls. We probably want something like this: unless the user explicitly 
> starts the last segment with a dot, we ignore dots.
>
> Both of these in practice means something like this:
>
> with {:ok, files} <- FIle.ls(dir) do
>   if last == "" do
>     Enum.reject(files, &String.starts_with?(&1, "."))
>   else
>     Enum.filter(files, &String.starts_with?(&1, last))
>   end
> end
>
> Thoughts?

Totally convinced. I'll switch it out. Thanks for the detailed explanation.

Frank

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CA%2B-urNSpLc0jcQ0m1j38pvpmQS2pw3dL6z0%2B8XAo1ukMGw3Hjg%40mail.gmail.com.

Reply via email to