From: Aaron Patterson Date: 2011-11-18T02:18:12+09:00 Subject: [ruby-core:41111] [ruby-trunk - Bug #5645][Closed] YAML.load_file prevents following File.delete Issue #5645 has been updated by Aaron Patterson. Status changed from Open to Closed Assignee set to Aaron Patterson % Done changed from 0 to 100 This was fixed by r33775, but the ticket wasn't closed automatically. :-/ Closing now. Thanks for the bug report! ---------------------------------------- Bug #5645: YAML.load_file prevents following File.delete http://redmine.ruby-lang.org/issues/5645 Author: Glen Knowles Status: Closed Priority: Normal Assignee: Aaron Patterson Category: Target version: ruby -v: ruby 1.9.3p0 (2011-10-30) [i386-mingw32] In ruby 1.9.2 and earlier this works: d = YAML::load_file(fname) File.delete(fname) In 1.9.3 the delete fails with permission denied. The work around is to use: d = File.open(fname) { |f| YAML::load(f) } File.delete(fname) -- http://redmine.ruby-lang.org