 
     modes =
       if raw do
-        if :lists.keyfind(:read_ahead, 1, modes) do
+        if :lists.keyfind(:read_ahead, 1, modes) == {:read_ahead, false} do
           [:raw|modes]
         else
           [:raw, :read_ahead|modes]


  @doc """
  Same as `open/3` but raises an error if file could not be opened.
  Returns the function result otherwise.
  """
  @spec open!(Path.t, list, (io_device -> res)) :: res | no_return when res: var

                   the parent directories
    * `:eisdir`  - the named file is a directory

  Check `File.open/2` for other available options.
  """
  @spec write(Path.t, iodata, list) :: :ok | {:error, posix}
  def write(path, content, modes \\ []) do
    F.write_file(IO.chardata_to_string(path), content, modes)
  end

  @doc """
