From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PjGXn-0005M7-N2 for garchives@archives.gentoo.org; Sat, 29 Jan 2011 19:33:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C801AE0B27; Sat, 29 Jan 2011 19:31:46 +0000 (UTC) Received: from mx.virtyou.com (mx.virtyou.com [94.23.166.77]) by pigeon.gentoo.org (Postfix) with ESMTP id 8CF5AE0B27 for ; Sat, 29 Jan 2011 19:31:46 +0000 (UTC) Received: from weird.localnet (p5794EB7F.dip.t-dialin.net [87.148.235.127]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx.virtyou.com (Postfix) with ESMTPSA id DBF2B39A079 for ; Sat, 29 Jan 2011 20:31:45 +0100 (CET) From: Alex Schuster To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Cloning a directory hierarchy, but not the content Date: Sat, 29 Jan 2011 20:31:43 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.37-ck; KDE/4.5.5; x86_64; ; ) References: <201101291458.13533.wonko@wonkology.org> <4D4426A4.9060303@binarywings.net> In-Reply-To: <4D4426A4.9060303@binarywings.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201101292031.44649.wonko@wonkology.org> X-Archives-Salt: X-Archives-Hash: 96de90d0398721d4b0358062cca3f7cd Florian Philipp writes: > Use `truncate -s ` > > It creates a sparse file if the specified file is smaller than the > specified size. It will also create a new file if it does not yet exist. Nice one. First I did not see an improvement over using dd to create the sparse file, but in combination with cp --attributes-only I can now duplicate the file with its attributes but zero size, and then fake the size. > In order to avoid trouble with line breaks in names, I recommend > something like: > find . -type f -print0 | > while read -d $'\0' file; do > echo "File=$file" > done Thanks! > For copying file attributes from one file to another you can use `cp > --attributes-only`. Oh my, another case of a (german) man page that does not show all the possible arguments. Never heard about that, thanks! Wonko