commit 6c2587a3b1168546cb6cdbe41dad61149a3961ef
parent 1614d10090c2d19b935868fecf14d4deb21ac537
Author: Heikki Lindholm <holin@iki.fi>
Date: Fri, 15 Feb 2008 07:14:59 +0000
get size of data fork (the original file without macos metadata)
Diffstat:
1 file changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/plugins/applefileextractor.c b/src/plugins/applefileextractor.c
@@ -160,6 +160,24 @@ libextractor_applefile_extract (const char *filename,
printf("applefile entry: %u %u %u\n", dsc.id, dsc.offset, dsc.length);
#endif
switch (dsc.id) {
+ case AED_ID_DATA_FORK:
+ {
+ /* same as in filenameextractor.c */
+ char * s = malloc (14);
+
+ if (dsc.length >= 1000000000)
+ snprintf (s, 13, "%.2f %s", dsc.length / 1000000000.0,
+ _("GB"));
+ else if (dsc.length >= 1000000)
+ snprintf (s, 13, "%.2f %s", dsc.length / 1000000.0, _("MB"));
+ else if (dsc.length >= 1000)
+ snprintf (s, 13, "%.2f %s", dsc.length / 1000.0, _("KB"));
+ else
+ snprintf (s, 13, "%.2f %s", (double) dsc.length, _("Bytes"));
+
+ result = addKeyword(EXTRACTOR_FILE_SIZE, s, result);
+ }
+ break;
case AED_ID_REAL_NAME:
if (dsc.length < 2048 && (dsc.offset + dsc.length) < size) {
char *s = malloc(dsc.length + 1);