Bugs: Browse | Submit New | Admin

[#28966] Cannot delete spreadsheet-file

Date:
2011-02-23 23:04
Priority:
3
Submitted By:
Thomas Preymesser (thopre)
Assigned To:
Nobody (None)
Category:
worksheet
State:
Open
Summary:
Cannot delete spreadsheet-file

Detailed description
Hello,

I tried to access a spreadsheet and then delete the spreadsheet-file. This failed because the file seems to be locked
until the file is not closed.
Is there an explicit 'close' for a spreadsheet file in the spreadsheet-gem

#
require 'spreadsheet'

book = Spreadsheet.open 'tmp.xls'
sheet = book.worksheet 0
sheet.each do |row| puts row[0] end

FileUtils.rm("tmp.xls")

c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1309:in `unlink': Permission denied - tmp
.xls (Errno::EACCES)
        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1309:in `block in remove_fil
e'
        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1317:in `platform_support'
        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1308:in `remove_file'
        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:776:in `remove_file'
        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:559:in `block in rm'
        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:558:in `each'
        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:558:in `rm'
        from rm_test.rb:20:in `<main>'

Add A Comment: Notepad

Please login


Followup

Message
Date: 2011-08-04 11:45
Sender: Zeno R.R. Davatz

Please report any further issues to:

http://groups.google.com/group/rubyspreadsheet

with your sample file and sample code posted on github and linked
to above mailing list.

This seems to be a Windows-Permission Error. 

Best
Zeno

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item