Detect size changes on files.

This commit is contained in:
Vreixo Formoso
2008-02-06 18:04:51 +01:00
parent 293e8ab2fc
commit 5088428742
3 changed files with 29 additions and 4 deletions

View File

@@ -286,6 +286,16 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
}
}
continue;
} else if (res > 1) {
char *name = iso_stream_get_name(file->stream);
res = iso_msg_submit(t->image->id, ISO_FILE_CANT_WRITE, 0,
"Size of file \"%s\" has changed. It will be %s", name,
(res == 2 ? "truncated" : "padded with 0's"));
free(name);
if (res < 0) {
filesrc_close(file);
return res; /* aborted due to error severity */
}
}
/* write file contents to image */