From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 17 Dec 2002 11:15:14 +0300 From: "Dmitry V. Levin" To: ALT Linux general discussion list Cc: ALT Linux Sisyphus mailing list Subject: Re: [sisyphus] Re: du =?koi8-r?B?z9vJwsHF?= =?koi8-r?B?1NPRLi4u?= Message-ID: <20021217081514.GB4059@basalt.office.altlinux.ru> Mail-Followup-To: ALT Linux general discussion list , ALT Linux Sisyphus mailing list References: <3DFD91C6.2030906@mmk.ru> <20021216105750.GD46267@osdn.org.ua> <3DFD9D9F.9060700@mmk.ru> <20021216115034.GA4765@ungrund> <3DFE91A2.4090005@mmk.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DrWhICOqskFTAXiy" Content-Disposition: inline In-Reply-To: <3DFE91A2.4090005@mmk.ru> X-fingerprint: 9658 398D 181B 1200 8FC5 26B8 F6F8 846B C1E2 3429 Sender: sisyphus-admin@altlinux.ru Errors-To: sisyphus-admin@altlinux.ru X-BeenThere: sisyphus@altlinux.ru X-Mailman-Version: 2.0.9 Precedence: bulk Reply-To: sisyphus@altlinux.ru List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Archived-At: List-Archive: --DrWhICOqskFTAXiy Content-Type: multipart/mixed; boundary="jousvV0MzM2p6OtC" Content-Disposition: inline Content-Transfer-Encoding: 8bit --jousvV0MzM2p6OtC Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, Dec 17, 2002 at 07:53:22AM +0500, Alexander Kirey wrote: > >du означает disk usage, а вы хотите с помощью его посчитать суммарный > >размер файлов? Он вам и показывает disk usage. > > > Да-с, и как это я... Но разница почти в 100 мегабайт... Вот вам пример в числах: 1. Скомпилируйте lseek.c (attached), 2. Запустите $ ./lseek 0x400000000 ~/tmp/empty 3. Сравните вывод от $ ls -lh ~/tmp/empty и $ du -h ~/tmp/empty P.S. Этот предмет - для community@. -- ldv --jousvV0MzM2p6OtC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lseek.c" #include #include #include #include #include int main (int ac, char *const *av) { const char *fname; int fd; off_t offset; if (ac != 3) error (1, 0, "usage: offset fname"); offset = strtoull (av[1], 0, 0); fname = av[2]; fd = open (fname, O_CREAT | O_EXCL | O_WRONLY, 0600); if (fd < 0) error (1, errno, "open: %s", fname); if (lseek (fd, offset - 1, SEEK_SET) == (off_t)-1) error (1, errno, "lseek: %#llx", (unsigned long long) offset); if (write (fd, "", 1) < 0) error (1, errno, "write: %s", fname); if (close (fd) < 0) error (1, errno, "close: %s", fname); return 0; } --jousvV0MzM2p6OtC-- --DrWhICOqskFTAXiy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE9/t0S9viEa8HiNCkRAkx3AJ9YbJJFPgJHVVgNNuLiUcHxkwGASQCff+6r DmJfUPKfErQIZpZr1CtfDUI= =gFv9 -----END PGP SIGNATURE----- --DrWhICOqskFTAXiy--