title: Why Can't I Delete Files With A Tilde?
body: <p>Elixir 1.3.2</p>
  
  <p>Erlang/OTP 19</p>
  
  <p>Windows 7 (Standard User and Administrator)</p>
  
  <p>I'm trying to hack together a small Elixir script to wrap around commiting files to git.  The first thing I do, in order to insure I don't accidentally stage temporary files created by emacs is File.rm("*~").  However, this is what I get:</p>
  
  <pre><code>iex(2)&gt; File.rm("*~")
  {:error, :eio}
  </code></pre>
  
  <p>So I tried <code>File.rm("*.*~")</code>.  Same result. I get the same behavior when I run as either a Standard User (which is how I normally work on Windows) or as an administrator so it doesn't seem to be anything with permissions either.  </p>
  
  <p>So I captured the files into a list.</p>
  
  <pre><code>iex(15)&gt; {:ok,files} = File.ls
  {:ok,
   [".git", ".gitattributes", ".gitignore", "add.factor", "async_ut",
    "async_ut.cs", "cng_maint", "codecvg.cmd", "codecvg_rkt.cmd",
    "codecvg_rkt.cmd~", "CreateBr.vbs", "DevSandbox", "distillery", "dk.cmd",
    "example.scm", "example.sql", "factor", "fsele", "fsharp", "glp.vbs",
    "lwwtww.org", "mrgmain.cmd", "MrgMain.vbs", "mrgtrunk.cmd", "mrgtrunk.cmd~",
  </code></pre>
  
  <p>(truncated to save space)</p>
  
  <p>I can check for the strings in the list containing <code>~</code> and it comes back true.  So I'm not imagining the tilde being there.</p>
  
  <p>I created a temporary file called <code>test.txt</code> in the directory.  <code>File.rm</code> removed that one just fine so it seems to be something about the <code>~</code> which is causing the issue. I also tried these:</p>
  
  <pre><code>iex(7)&gt; File.rm("*\~")
  {:error, :eio}
  iex(8)&gt; File.rm("*\7F") #7F is hex code of ~
  {:error, :eio}
  </code></pre>
  
  <p>No luck as you can see. </p>
  
  <p>Googling for anything about <code>:eio</code> with Elixir and File.rm didn't turn up anything helpful.  I can try installing 1.4.0 to see if that has an effect but I just wanted to see if I was missing something dumb and obvious here.</p>
  
  <p>I've also got cygwin on the machine so I tried removing the files that way.  <code>rm *~</code> worked exactly as expected (under a standard user). </p>
  
  <p>It seems as if this is somehow an Erlang specific issue but I'm aksing here first. Am I doing something obviously wrong?</p>