[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with cp (copy)

From: Bob Proulx
Subject: Re: Problem with cp (copy)
Date: Thu, 23 Jan 2003 23:11:31 -0700
User-agent: Mutt/1.4i

David T-G wrote:
> Alfred --
> ...and then Alfred M. Szmidt said...
> % 
> % Please read the Coreutils FAQ, it describes your problem in detail [1].
> % 
> % Argument list too long
> There's a very interesting wrinkle here, though...  As he has posted, he
> actually has fewer files in the .05 directory than he has in the .01
> directory.

The arg max problem would be related to the size of the command line
which means that fewer files with longer names might overflow that
limit before more files with shorter names did.

> Oh, wait -- Phil, are all fo the files in these dirs of a standard name
> format, or could they be anything?  More precisely, have [any of] the
> files in .05 longer names than in, say, .01?
>   echo 01.01.01/* | wc -c
>   echo 01.02.01/* | wc -c
>   echo 01.03.01/* | wc -c
>   echo 01.04.01/* | wc -c
>   echo 01.05.01/* | wc -c

That '*' is going to be trouble.  If there are too many files and it
overflows arg max then this will cause the error and the wc -c won't
return anything.

What you wanted is to see now many files and how long the files were
in the directory.

  ls 01.01.01 | wc -c
  ls 01.02.01 | wc -c
  ls 01.03.01 | wc -c
  ls 01.04.01 | wc -c
  ls 01.05.01 | wc -c

Since there is no command line expansion this avoids arg max entirely.

> There is the "too many things" kind of 'too long' and there's the "too
> many characters" kind of 'too long'; you may be hitting the *second* one
> rather than the first.

Well, "Argument list too long" refers to the first type.  But of
course longer file names would push you over the limit with less of


reply via email to

[Prev in Thread] Current Thread [Next in Thread]