Issue #238 has been updated by Matthew Boeh.


Ruby shouldn't place any arbitrary restrictions on file manipulation that aren't enforced by the C standard library, and neither Windows nor Unix forbid deleting write-protected files:

  % cat my-rm.c
  #include <stdio.h>

  int main(int argc, char *argv[])
  {
    int i;
    for (i = 0; i < argc; i++)
      remove(argv[i]);
    return 0;
  }
  % gcc my-rm.c -o my-rm
  % touch handsoff; chmod a-rwx handsoff
  % ./my-rm handsoff
  % ls handsoff
  ls: handsoff: No such file or directory

It's not circumventing permissions -- rm prompting you before deleting a write-protected file is a courtesy for interactive users, and it doesn't occur otherwise:

  % touch handsoff; chmod a-rwx handsoff
  % rm handsoff
  rm: remove write-protected regular empty file `handsoff'? n
  % rm handsoff </dev/null
  % ls handsoff
  ls: handsoff: No such file or directory
----------------------------------------
http://redmine.ruby-lang.org/issues/show/238

----------------------------------------
http://redmine.ruby-lang.org