Hi, Pete Batard wrote: > - I'm not entirely sure that the sector size array is entirely necessary
The specs say that extents of the same file must be neighbors and in sequence. But they do not outrule that an extent's size is not aligned to block size. So there could be invalid bytes between extents. > - Not sure about adding a test for this one, even if I'd like to. There's > Thomas' very helpful multiextent compressed ISO image, from: > https://dev.haiku-os.org/raw-attachment/ticket/8473/file_of_4gb.iso.bz2 > However, since that image uncompresses to 4 GB, and then we might have to > process another 4GB file, it looks like a tricky sale... In the course of https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=48959 i provided 73 KB of http://scdbackup.webframe.org/t_cd9660_regression_v02.tgz It contains two files which can be combined to form a sparse ISO image of only a few hundred KB of weight: cd9660/cd9660_rgr.image.at0.bz2.uue cd9660/cd9660_rgr.image.at2114008.bz2.uue To be unpacked and combined by uudecode -o - < cd9660/cd9660_rgr.image.at0.bz2.uue | bunzip2 > test.iso uudecode -o - < cd9660/cd9660_rgr.image.at2114008.bz2.uue | bunzip2 | \ dd bs=2048 seek=2114008 of=test.iso (uuencode is a demand of NetBSD regression testing system. bunzip2 does not offer an option to create a sparse file. But dd seek= hopping over a large unwritten range causes a lightweight range of 0-bytes.) Then you will see on a filesystem that can store sparse files (here ext4): $ ls -l test.iso -rw-r--r-- 1 thomas thomas 4329758720 Jun 6 19:42 test.iso $ du test.iso 388 test.iso # mount test.iso /mnt/iso mount: /dev/loop0 is write-protected, mounting read-only $ find /mnt/iso -exec ls -ld '{}' ';' dr-x------ 1 thomas root 2048 May 6 2014 /mnt/iso dr-x------ 1 thomas root 2048 May 3 2014 /mnt/iso/dev prw------- 1 thomas root 0 May 25 2014 /mnt/iso/dev/test.fifo br-------- 1 thomas tty 0, 12 May 14 2014 /mnt/iso/dev/wd1e dr-x------ 1 thomas thomas 2048 May 6 2014 /mnt/iso/my -r-------- 1 thomas thomas 4329375744 May 6 2014 /mnt/iso/my/large_file dr-x------ 1 thomas root 2048 Jan 19 2014 /mnt/iso/reg -r-x------ 1 thomas root 133411 Jan 19 2014 /mnt/iso/reg/tar lr-x------ 1 thomas root 3 May 26 2014 /mnt/iso/reg/to_regfile -> tar -r-------- 1 thomas thomas 6 May 6 2014 /mnt/iso/small_file $ wc /mnt/iso/my/large_file 0 0 4329375744 /mnt/iso/my/large_file (Note: No i/o errors on wc.) Have a nice day :) Thomas
