Class: TagLib::File Abstract
- Inherits:
-
Object
- Object
- TagLib::File
- Defined in:
- docs/taglib/base.rb
Overview
Base class for files, see subclasses.
Direct Known Subclasses
TagLib::FLAC::File, MP4::File, MPEG::File, Ogg::File, RIFF::AIFF::File, RIFF::WAV::File
Instance Method Summary collapse
-
#close ⇒ void
Closes the file and releases all objects that were read from the file (basically everything from the TagLib namespace).
-
#save ⇒ Boolean
Save the file and the associated tags.
Instance Method Details
#close ⇒ void
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 |
#save ⇒ Boolean
Save the file and the associated tags.
See subclasses, as some provide more control over what is saved.
171 172 |
# File 'docs/taglib/base.rb', line 171 def save end |