Rubinius sidesteps similar issues in `dir19.rb` by aliasing `File` to `PrivateFile` and using that. I would suggest a similar solution here.