On Sep 12, 2012, at 6:37 PM, Inna Ilinskaya <[log in to unmask]> wrote:
> On http://marc.rubyforge.org/ page it's recommended that requests for
> gem 'marc' are sent to this mailing list :)
>
> I noticed that Class: MARC::Reader does not close the file after reading
> from it. And there is no close method available for this class.
>
> I have a script that loads file from ftp, reads from it using
> MARC::Reader and then deletes file. When I try to delete the file, I get
> "Permissions denied" error message, since the file was left open after I
> read from it.
>
> It will be beneficial if explicit close method is implemented for
> MARC::Reader.
>
> The workaround is to open the file via File object first, e.g.,
>
> fh = File.new("C:/temp/test.mrc")
> r = MARC::Reader.new(fh)
> ...
> fh.close
>
> Thank you so much!!!
>
> Inna
|