From 48cf13380365f38280323442eb49166cb3b55973 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Thu, 29 Jun 2017 22:47:51 -0400 Subject: Report MacBinary time stamps. --- frommacbinary.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frommacbinary.c b/frommacbinary.c index 6657dc9..67f985e 100644 --- a/frommacbinary.c +++ b/frommacbinary.c @@ -73,6 +73,7 @@ static void ProcessFile(char *filename) { unsigned char header[128]; char name[80]; int dlen, rlen; + time_t stamp; int i,ch; binfile = fopen(filename,"r"); @@ -129,14 +130,20 @@ return; } else { name[header[1]] = '\0'; fprintf( infofile, "Mac filename = %s\n", name ); - fprintf( infofile, "Data fork length = %d\n", dlen ); - fprintf( infofile, "Resource fork length = %d\n", rlen ); fprintf( infofile, "File Type = %c%c%c%c\n", header[65], header[66], header[67], header[68]); fprintf( infofile, "File Creator = %c%c%c%c\n", header[69], header[70], header[71], header[72]); fprintf( infofile, "Finder Flags = %08x\n", header[73]); + fprintf( infofile, "Data fork length = %d\n", dlen ); + fprintf( infofile, "Resource fork length = %d\n", rlen ); + stamp = ((header[91]<<24)|(header[92]<<16)|(header[93]<<8)|header[94]) + - 2082844800; + fprintf( infofile, "Creation time = %s", ctime(&stamp) ); + stamp = ((header[95]<<24)|(header[96]<<16)|(header[97]<<8)|header[98]) + - 2082844800; + fprintf( infofile, "Modification time = %s", ctime(&stamp) ); fclose( infofile ); } } -- cgit v1.2.3