Ruby 如何解决 File.open 的错误

KUMU · July 25, 2025 · 37 hits

在某些 windows 系统中,由于 null.sys 文件的损坏,会导致系统中的 nul 不能用,这时你用 ruby 的运行 File.open("1.txt","wb") 就会报错: in `initialize': Too many open files @ rb_sysopen - 1.txt (Errno::EMFILE) 现在一般是从好的电脑拷贝个 null.sys 文件来替换掉他,让 nul 有效才行,有没有什么办法可以就算 nul 无效也能让 File.open("1.txt","wb") 可以正常运行

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.