           _ -> {:ok, :regular}
         end
       {:ok, :directory} ->
-        F.list_dir(path)
+        :file.list_dir(path)
       {:ok, _} ->
         {:ok, :regular}
       {:error, reason} ->


  # Both src and dest are files.
  defp do_cp_link(link, src, dest, callback, acc) do
    case F.make_symlink(link, dest) do
      :ok ->
        [dest | acc]
      {:error, :eexist} ->
        if path_differs?(src, dest) and callback.(src, dest) do
          # If rm/1 fails, F.make_symlink/2 will fail
          _ = rm(dest)
          case F.make_symlink(link, dest) do
            :ok -> [dest | acc]
            {:error, reason} -> {:error, reason, src}
          end

  `{:error, :enotsup}`.
  """
  def ln_s(existing, new) do
    :file.make_symlink(IO.chardata_to_string(existing), IO.chardata_to_string(new))
  end

  @doc """
