From owner-freebsd-questions@FreeBSD.ORG Tue Nov 8 15:53:51 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F25106566B for ; Tue, 8 Nov 2011 15:53:51 +0000 (UTC) (envelope-from cwhiteh@onetel.com) Received: from woodbine.london.02.net (woodbine.london.02.net [87.194.255.145]) by mx1.freebsd.org (Postfix) with ESMTP id E42078FC15 for ; Tue, 8 Nov 2011 15:53:50 +0000 (UTC) Received: from muji2.config (87.194.237.233) by woodbine.london.02.net (8.5.140) id 4E79D72901F77061 for freebsd-questions@freebsd.org; Tue, 8 Nov 2011 15:53:49 +0000 Message-ID: <4EB9508D.8090800@onetel.com> Date: Tue, 08 Nov 2011 15:53:49 +0000 From: Chris Whitehouse User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) Gecko/20100924 Thunderbird/3.1.4 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: recursive copy with spaces in descendants X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:53:51 -0000 On 05/11/2011 19:47, Chris wrote: > I'm having difficulty copying a directory tree from my FreeBSD server to > USB storage. The problem is that the tree contains file and folder names > which have spaces, similar to the following: > > ./foo bar/some name.tar.gz > ./foo bar/child dir/some other name.tar.gz > > I've tried various combinations of cp with enclosing the top level > directory in quotations, along with other commands like tar or xargs to no > avail. The problem seems to be with creating the destination directories > and folders, where mkdir/cp terminates with an invalid argument response. > > Cleaning up the source filenames using something like detox isn't viable, > as the files are being served by transmission-daemon, and as such the names > must be preserved. Permissions are not an issue either, as the same > responses occur whether I use a standard or root account. > > Any ideas would be greatly appreciated, since I'm pretty much out of them > at this point. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > %mount_msdosfs /dev/da0s1 mnt #USB external HD %ls mnt %cd ~/temp2 %find . . ./dir with spaces ./dir with spaces/file1 with spaces ./dir with spaces/file2 with spaces %find . -depth |cpio -pdmv ~/mnt /home/chrisw/mnt/./dir with spaces/file1 with spaces /home/chrisw/mnt/./dir with spaces/file2 with spaces /home/chrisw/mnt/./dir with spaces /home/chrisw/mnt/. 0 blocks %find ~/mnt /home/chrisw/mnt /home/chrisw/mnt/dir with spaces /home/chrisw/mnt/dir with spaces/file1 with spaces /home/chrisw/mnt/dir with spaces/file2 with spaces or have I missed something? Chris