From ad65cc4d45860dffabbacc0175d76fe7955b58e7 Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Date: Wed, 9 Jan 2008 15:35:59 +0100 Subject: [PATCH] Add API to get the size of a file node. --- src/libisofs.h | 5 +++++ src/node.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/libisofs.h b/src/libisofs.h index 0152db0..a4fd104 100644 --- a/src/libisofs.h +++ b/src/libisofs.h @@ -843,6 +843,11 @@ void iso_node_set_sort_weight(IsoNode *node, int w); */ int iso_file_get_sort_weight(IsoFile *file); +/** + * Get the size of the file, in bytes + */ +off_t iso_file_get_size(IsoFile *file); + /** * Add a new directory to the iso tree. Permissions, owner and hidden atts * are taken from parent, you can modify them later. diff --git a/src/node.c b/src/node.c index 56f2595..78b0c81 100644 --- a/src/node.c +++ b/src/node.c @@ -591,6 +591,14 @@ int iso_file_get_sort_weight(IsoFile *file) return file->sort_weight; } +/** + * Get the size of the file, in bytes + */ +off_t iso_file_get_size(IsoFile *file) +{ + return iso_stream_get_size(file->stream); +} + /** * Check if a given name is valid for an iso node. *