In case anyone is interested, here is a small patch to make hfsutils work with large volumes (over 4Gb).
Under Linux, I also has to compile the code with
"-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
(There is probably a way to do this via 'configure', but I haven't a clue how to do that ...)
The only strange bit about the the patch is that I had to split the "return" line into two lines - which is the only way it would gives the correct result using gcc v2.96-98 on Linux for large numbers ...
James Pearson
*** hfsutils-3.2.6/libhfs/os/unix.c.dist Mon Nov 2 22:09:13 1998 --- hfsutils-3.2.6/libhfs/os/unix.c Wed Oct 2 13:46:29 2002 *************** *** 147,158 **** if (offset == (unsigned long) -1) result = lseek(fd, 0, SEEK_END); else ! result = lseek(fd, offset << HFS_BLOCKSZ_BITS, SEEK_SET);
if (result == -1) ERROR(errno, "error seeking medium");
! return (unsigned long) result >> HFS_BLOCKSZ_BITS;
fail: return -1; --- 147,160 ---- if (offset == (unsigned long) -1) result = lseek(fd, 0, SEEK_END); else ! result = lseek(fd, (off_t)offset << HFS_BLOCKSZ_BITS, SEEK_SET);
if (result == -1) ERROR(errno, "error seeking medium");
! result >>= HFS_BLOCKSZ_BITS; ! ! return (unsigned long) result;
fail: return -1;
In case anyone is interested, here is a small patch to make hfsutils work with large volumes (over 4Gb).
Under Linux, I also has to compile the code with
"-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
(There is probably a way to do this via 'configure', but I haven't a clue how to do that ...)
The only strange bit about the the patch is that I had to split the "return" line into two lines - which is the only way it would gives the correct result using gcc v2.96-98 on Linux for large numbers ...
I missed that hfsutils reports the number free bytes on a volume - which overflow a 32 bit integer for volumes over 4Gb - the following replacement patch should fix this.
James Pearson
begin 664 hfsutils-3.2.6-lfs-2.patch.gz M'XL(")UAG#T``VAF<W5T:6QS+3,N,BXV+6QF<RTR+G!A=&-H`-U6:T_;2!3] M;'[%)5*1G<:)'PD$I[""DFJK0B+%B&ZW6T7&'B<68SORC-F65?_[WAG;(08, M7;5=M!LID'F<,S/GWC-WVNTV+$.6\X@RW>Y:W=T>C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,:AHRH0U]&XJ&$Y_T)P*%CXT MK<%&*J@;-76G5BU%]6R!*EQ``JV%Q;/5*A^4I8ZMB(T?WH,_(S@B0/ANQ<, M9?1Y%!-UIRA(4@VM&4P]QB%.@RB,&BCBH*+8OD^Q1`J1AH7S1;C^2(I(;E1C =N?K7(DUZ;2EI)<8ZI_X_8OQ#-?X&?47^$E,.``"Q ` end
In case anyone is interested, here is a small patch to make hfsutils work with large volumes (over 4Gb).
Under Linux, I also has to compile the code with
"-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
(There is probably a way to do this via 'configure', but I haven't a clue how to do that ...)
The only strange bit about the the patch is that I had to split the "return" line into two lines - which is the only way it would gives the correct result using gcc v2.96-98 on Linux for large numbers ...
I missed that hfsutils reports the number free bytes on a volume - which overflow a 32 bit integer for volumes over 4Gb - the following replacement patch should fix this.
James Pearson
begin 664 hfsutils-3.2.6-lfs-2.patch.gz M'XL(")UAG#T``VAF<W5T:6QS+3,N,BXV+6QF<RTR+G!A=&-H`-U6:T_;2!3] M;'[%)5*1G<:)'PD$I[""DFJK0B+%B&ZW6T7&'B<68SORC-F65?_[WAG;(08, M7;5=M!LID'F<,S/GWC-WVNTV+$.6\X@RW>Y:W=T>C2ZQIY>R7IY$G[M^-X@8 M5[2!";I-8`%EN48^XYI@[F_/]S2=?TI!N4]"6#J<P$V;:>_ZUC[8!F&M=6N M?T0;S/Y>QQP,078`?J(0U#0,&>%P<`!JGK!HD2`C39.%!KJIR5D`&6$YQ3E` M&2%7:AATP.B`.QZ_FX\G)]I(3B,XN+7=-+]<YM4K^/6-.S^G;Y^Y_X^/WY[ M[I9$[OA<$JTW5I$<;&QD/)M-9RK)LB3M0`O_IQF():)D`3$)HCQN%23;<A<\ MSY)[QRIY#P_O[:1</O0BZFS!+8-NCF0PI'Z[!N!O_=_63ZPSY]JSR%CJ=?"` M8-O?(/5CLK8;78+?1H<8QE,.D6CE?)D7[D!'6<Y@S^D_X@[;&G1LVZK<4<0D MX?IA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