[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do a copy a file?
Dr. David Kirkby
Re: How do a copy a file?
Fri, 18 Apr 2003 02:06:42 +0100
Eric Siegerman wrote:
> On Fri, Apr 18, 2003 at 12:09:07AM +0100, Dr. David Kirkby wrote:
> > [A script run from <project_root>/tests contains:]
> > #! /bin/sh
> > echo top_srcdir = $top_srcdir top_builddir= $top_builddir
> > cp $top_srcdir/examples/25ohm-201h.bmp
> > $top_builddir/tmp/25ohm-201h.bmp
> > [During "make distcheck", The echo above prints:]
> > top_srcdir = ../.. top_builddir= ..
> That looks correct to me. If I understand correctly, your
> "tests" directory is at the first level within the project root.
> distcheck puts its build directory there too, so the structure
> during the distcheck run looks like this:
> 0 PROJECT_ROOT/ # top_srcdir
> 1 tests/ # srcdir
> 1 PKGNAME-VERSION/ # top_buildir
> 2 tests/ # builddir (if that variable
> # were in fact defined)
> (The numbers show depths, in case the indentation gets mangled in
> transit, as your "cp" command seems to have been :-)
> What's actually going wrong?
I've hacked that one about a bit, but here is another, and the exact
I now have 3 lines.
1) Does an ls, which reports the file does not exist.
2) Tries unsuccesfully to copy the file.
3) 'atlc' tries unsuccesfully to use the copied file.
4) Tries unsucessfully to report computer by the program 'atlc'
ls -l $top_srcdir/examples/undefined_permittivities.bmp
cp $top_srcdir/examples/test-coupler1.bmp $top_builddir/tmp
echo Zo = $Zo
The exact message generated are:
../../examples/undefined_permittivities.bmp: No such file or directory
cp: cannot access ../../examples/undefined_permittivities.bmp
cannot open ../tmp/undefined_permittivities.bmp
The messages suggest the files does not exits, but it does:
% find . -name undefined_permittivities.bmp
So 'undefined_permittivities.bmp' does exist, but neither ls or cp can
find it when I do a 'make distcheck'. But when I do a simple 'make
check', both ls and cp file it okay and the test passes.
As you see below, ls reports the file size, cp produces nothing to
stderr and the value of Zo gets printed and later checks produce a
pass from the test.
-rw-r--r-- 1 davek staff 132330 Apr 17 14:49
Zo = 24.86
The top srcdir looks like this, with the example directly off the top
source directory. A file $top_builddir/tmp is created elsewhere.
Dr. David Kirkby,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408