This is the mail archive of the
cygwin-talk@cygwin.com
mailing list for the cygwin project.
Re: find prints wrong file size for files >2GB
- From: Brian Dessent <brian at dessent dot net>
- To: Talk Amongst Yourselves <cygwin-talk at cygwin dot com>
- Date: Mon, 06 Dec 2004 11:54:10 -0800
- Subject: Re: find prints wrong file size for files >2GB
- Organization: My own little world...
- References: <41B43182.9AEE4F96@hot.pl> <20041206120515.GB332@efn.org> <41B4504A.321065CF@dessent.net> <20041206190511.GA2184@efn.org>
- Reply-to: Talk Amongst Yourselves <cygwin-talk at cygwin dot com>
Yitzchak Scott-Thoennes wrote:
> > dd if=/dev/zero bs=1 count=0 seek=2G of=filename
>
> Can that work in place (just modifying a file without creating another)?
>
> How would you extend/shorten an existing file using that?
$ echo "hello world" >testfile
$ ls -l testfile
-rw-r--r-- 1 brian None 12 Dec 6 11:50 testfile
$ dd if=/dev/zero bs=1 count=0 seek=150M of=testfile
0+0 records in
0+0 records out
$ ls -l testfile
-rw-r--r-- 1 brian None 150M Dec 6 11:51 testfile
$ dd if=/dev/zero bs=1 count=0 seek=5 of=testfile
0+0 records in
0+0 records out
$ ls -l testfile
-rw-r--r-- 1 brian None 5 Dec 6 11:51 testfile
$ cat testfile
hello
By using "count=0" there's no actual writing going on, just the
seek/truncate operation. At least I think that's what's going on..
Brian