Re: [Bashburn-info] Copy Data CD to CD Issues
Brought to you by:
bashburn
From: Nick W. <ni...@li...> - 2008-10-01 19:01:18
|
On Wed, 1 Oct 2008 10:59:49 -0400 (EDT) "Steven W. Orr" <st...@sy...> wrote: > On Wednesday, Oct 1st 2008 at 09:53 -0000, quoth Fabian Stietzel: > > =>Steven W. Orr wrote: > =>> * The copy command is using globbing. Globbing is evil. We need > to only =>> copy files that are explicitly specified. If you copy by > saying something =>> like... > =>> > =>The shell is globbing. cp will never do it. It's the shell. The > globbing =>can be avoided easily by using single quotation marks. > => > =>> cp dir/* somewhere/ > =>> > =>> Then there's no way to detect that the cp didn't pick something > up. We =>> have to either verify that the disk is mounted and/or we > have to always =>> specify explict files. DEATH TO GLOBBING. > =>> > =>> > =>Of course you can detect if cd "didn't pick something up". cd will > pick =>every file supplied as a command line argument before the last > (target). =>if someting goes wrong the return value/exit code of cd > will not be 0. =>the shell does the globbing, thus instead of > 'dir/*', 'dir/a' 'dir/b' is =>supplied to cp as command line argument > if 'dir/a' and 'dir/b' exist. => > =>If you do something like 'cp dir/* somewhere/' you will get an > error if =>'dir/' is empty. This is because if 'dir/' is empty the > shell will not =>do globbing for the asterisk. So cp will complain > that it can't find the =>file 'dir/*'. I think before doing major > changes here...maybe somebody =>just forgot to check $? after the cp > invocation. => > => > =>Just my 2 cents, > =>Fabian > > Thanks Fabian. Certainly worth checking. Nick, do you know what code > we're talking about here? Where is this cp command in question? > No, I didn't analyse it at all. 1) Copy Data CD (CD to CD) is where this issue is. I haven't looked at code at due to testing all the other stuff. Nick -- Free Software Foundation Associate Member 5508 |