From mboxrd@z Thu Jan 1 00:00:00 1970
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fee84,4da5e030e6766a04
X-Google-Attributes: gidfee84,public
X-Google-ArrivalTime: 1994-11-19 08:15:39 PST
Path: nntp.gmd.de!xlink.net!news.dfn.de!swiss.ans.net!howland.reston.ans.net!pipex!sunic!news.chalmers.se!cd.chalmers.se!tl
From: tl@cd.chalmers.se (Torbj|rn Lindgren)
Newsgroups: comp.unix.osf.osf1
Subject: Re: Sparse files take up more space when copied
Date: 15 Nov 1994 19:52:33 GMT
Organization: Chalmers Computer Society
Message-ID: <3ab3i1$rlp@nyheter.chalmers.se>
References: <3aaj2f$qql@xdm084.ccc.cranfield.ac.uk>
NNTP-Posting-Host: haddock.cd.chalmers.se
In article <3aaj2f$qql@xdm084.ccc.cranfield.ac.uk>,
Peter Lister
wrote:
>I tarred the directory and gzip managed 94% compression on the tar
>file (yes, that's right, reduced the size by 94%), so these files are
>obviously pretty sparse. It would seem that I-DEAS can take advantage
>of some pretty good file compression in the OSF1 filesystem when it
>writes it's files, but tar,cp,etc don't manage this. My guess is that
>I-DEAS uses mmap(3) and that that virtual memory paging writes the
>file blocks more efficiently than stream I/O as used by cp, tar, etc.
It uses sparse allocated files (often created by seeking or by
mmaping).
GNU cp (I think it's included in fileutils, that would be the logical
place for it) creates this kind of file when you tell it to copy a
file (if there are any blocks of zeros of course), which means that
sometimes files are smaller after you have copied them :)
The real size of a file is easy to check by using the -s parameter to
'ls'.