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

@@ -30,12 +30,28 @@ typedef struct
static
int fsrc_open(IsoStream *stream)
{
int ret;
struct stat info;
off_t esize;
IsoFileSource *src;
if (stream == NULL) {
return ISO_NULL_POINTER;
}
src = ((FSrcStreamData*)stream->data)->src;
return iso_file_source_open(src);
ret = iso_file_source_stat(src, &info);
if (ret < 0) {
return ret;
}
ret = iso_file_source_open(src);
if (ret < 0) {
return ret;
}
esize = ((FSrcStreamData*)stream->data)->size;
if (info.st_size == esize) {
return ISO_SUCCESS;
} else {
return (esize > info.st_size) ? 3 : 2;
}
}
static