Re: [Gimp-developer] Re: Portable XCF
On Friday, August 15, 2003, at 11:53 PM, Carol Spears wrote: [ ... ] I looked up heuristic it said it meant heuristisch! How can this be so? Did you use an English/German dictionary? Next time use Merriam-Webster Online at www.m-w.com I thought when i cp'd something i was totally making a copy of the file and simply giving it a new name. The size never changes, so how could this be true? The contents of the file will not change, just it's representation on the disk. The "ls" will still report the original file size, but the file will actually use less space on the disk. Once the file is read back into memory, the "hole" is filled with the correct amount of zeros again. Karl Heinz ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Re: Portable XCF
Austin Donnelly wrote: Yes, try it with dd and cp (GNU version only?): dd if=/dev/zero of=/tmp/zero-test count=1000 cp --sparse=always /tmp/zero-test /tmp/zero-sparse ls -l /tmp/zero-test /tmp/zero-sparse du -cs /tmp/zero-test /tmp/zero-sparse [...] What I do not know is how many fs support it, and if they can do on the fly or a forced copy is needed It is the copy which makes the sparse file. You can't make a hole in a file merely by writing a bunch of zeros to it. You can only do it by seeking past the (current) end of the file, then writing non-zero data. The bytes you seeked over are the hole, and will be read as if zeros. GNU cp uses a bunch of heuristics to discover runs of zeros in the input file and seek over them in the output file, rather than just writing zeros. Austin I looked up heuristic it said it meant heuristisch! How can this be so? I thought when i cp'd something i was totally making a copy of the file and simply giving it a new name. The size never changes, so how could this be true? carol ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
RE: [Gimp-developer] Re: Portable XCF
> Yes, try it with dd and cp (GNU version only?): > > dd if=/dev/zero of=/tmp/zero-test count=1000 > cp --sparse=always /tmp/zero-test /tmp/zero-sparse > ls -l /tmp/zero-test /tmp/zero-sparse > du -cs /tmp/zero-test /tmp/zero-sparse > [...] > What I do not know is how many fs support it, and if they can do on > the fly or a forced copy is needed It is the copy which makes the sparse file. You can't make a hole in a file merely by writing a bunch of zeros to it. You can only do it by seeking past the (current) end of the file, then writing non-zero data. The bytes you seeked over are the hole, and will be read as if zeros. GNU cp uses a bunch of heuristics to discover runs of zeros in the input file and seek over them in the output file, rather than just writing zeros. Austin ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
[Gimp-developer] Re: Portable XCF
[EMAIL PROTECTED] (2003-08-15 at 1541.28 +0200): > BTW: Would it be possible to get a sparse file by zeroing the unused > bits? Then it would be quite space efficient (at least with some file > systems). Yes, try it with dd and cp (GNU version only?): dd if=/dev/zero of=/tmp/zero-test count=1000 cp --sparse=always /tmp/zero-test /tmp/zero-sparse ls -l /tmp/zero-test /tmp/zero-sparse du -cs /tmp/zero-test /tmp/zero-sparse If you get same byte size, 512000 bytes, but different block usage, 0 vs 503 here, your fs is doing sparse files. Another test I did here with a 8258506 bytes file, composed by catting a real data file of 7745389 bytes, then 512000 zero bytes and a final 1117 byte group of random data, gives an usage of 8098 blocks for the original and 7601 for the sparse copy. What I do not know is how many fs support it, and if they can do on the fly or a forced copy is needed, or if it is a good idea from performance point of view. GSR ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
[Gimp-developer] Re: Portable XCF
[EMAIL PROTECTED] (2003-08-15 at 1357.35 +0200): > There is unfortunately one thing that most of these filesystems have > in common: they are designed to store their data in a partition that > has a fixed size. If you create such a filesystem in a regular file, > you have to pre-allocate the space that you will need for storing your > data. Or use a tool to change the size, they exist, and in some cases they allow changing while online. Examples are ext2resize and growfs. GSR ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer