From: Kent Dahl Date: 2003-01-29T03:22:42+09:00 Subject: Re: FileTest.size? vs du -b Curious Person wrote: > Well, what I eventually want to do is have a script that fills CDRs up to > capacity for mkisofs to burn (but not over). Therefore, I need a way to > measure size to ensure a good fit on the disc. I'm not sure which would be > better; blocks or bytes, though. Would FileTest.size would be the most > appropriate method to use? Measuring in blocks for the target filesystem would be the correct way. The blocks given by the source filesystem can't be trusted, since the block size might be bigger (waste space) or smaller (might mess up the total size). So take in the filesize, as FileTest.size reports, round upwards to nearest block size as defined by the target filesystem (IOS9660?) and use that number to fill it to bursting point. http://osdev.berlios.de/osd-fs.html#iso Uhm, would this be a bad time to mention that this sounds like the knapsack problem? :-P HTH -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 5. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)