mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-14 06:32:33 +00:00
TaggedFile: Add temporary fix for save_to
breakage due to tag order
Depending on the order of the tags in a `TaggedFile`, since we write the tags independently of each other, they could step on each other's toes and leave the file in position where it cannot be probed. This wouldn't break the file, nor cause partial writes of tags, however there is a chance not *all* of the tags stored in the `TaggedFile` would be written.
This commit is contained in:
parent
c5bddba0cf
commit
42761e6bad
1 changed files with 3 additions and 0 deletions
|
@ -487,6 +487,9 @@ impl TaggedFileExt for TaggedFile {
|
|||
|
||||
fn save_to(&self, file: &mut File) -> Result<()> {
|
||||
for tag in &self.tags {
|
||||
// TODO: This is a temporary solution. Ideally we should probe once and use
|
||||
// the format-specific writing to avoid these rewinds.
|
||||
file.rewind()?;
|
||||
tag.save_to(file)?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue