Class: TagLib::File Abstract

Inherits:
Object
  • Object
show all
Defined in:
docs/taglib/base.rb

Overview

This class is abstract.

Base class for files, see subclasses.

Instance Method Summary collapse

Instance Method Details

#closevoid

This method returns an undefined value.

Closes the file and releases all objects that were read from the file (basically everything from the TagLib namespace).

After this method has been called, no other methods on this object may be called. So it's a good idea to always use it like this:

file = TagLib::MPEG::File.new("file.mp3")
# ...
file.close
file = nil

This method should always be called as soon as you're finished with a file. Otherwise the file will only be closed when GC is run, which may be much later. On Windows, this is especially important as the file is locked until it is closed.

As a better alternative to this, use the open class method:

TagLib::MPEG::File.open("file.mp3") do |file|
   # ...
end


197
198
# File 'docs/taglib/base.rb', line 197

def close
end

#saveBoolean

Save the file and the associated tags.

See subclasses, as some provide more control over what is saved.

Returns:

  • (Boolean)

    whether saving was successful



171
172
# File 'docs/taglib/base.rb', line 171

def save
end