libtool
[Top][All Lists]
Advanced

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

Re: [Patch #41] Do all rm's in one command with --mode=clean


From: Robert Boehne
Subject: Re: [Patch #41] Do all rm's in one command with --mode=clean
Date: Wed, 24 Oct 2001 09:21:48 -0500

Jeff:

Heh, yeah, this is getting more complex isn't it.  :)
Libtool saves a good guess for the maximum length
of command lines as max_cmd_len so if you wanted to
support removing files up to an average of 99 characters
you could divide max_cmd_len by 100 to get the number
of files to delete at a time.  The max_cmd_len is meant
to be a safe lower bound, libtool doesn't count all the
arguments, only the object files, so

max_cmd_len < maximum length of object files listed + length of other
linking arguments

  Or we could get everyone to switch to the GNU Hurd OS,
that is the only one I know of that doesn't have limits
on the length of a command line. ;)

Hope that helps,

Robert

Jeff Dubrule wrote:
> 
> Hmm.  I was having trouble trying to feed 'xargs' it's data without
> actually putting it all on a command-line at some point(silly, eh?).
> In any event, perhaps something like this will work:
> 
>    for each file
>       ...
>       $rmfiles=$rmfiles $some_files_to_delete
>       ...
>       if 100 < -l "$rmfiles"  then
>         $show "$rm $rmfiles"
>         $run $rm || exit_status=1
>         $rmfiles=
>       fi
>     done
>     if test -n "$rmfiles"; then
>       $show "$rm $rmfiles"
>       $run $rm || exit_status=1
>       $rmfiles=
>     fi
> 
> Is there a less random number than 100, that would be a reasonable
> minimum?
> 
> -jeff

-- 
Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  address@hidden



reply via email to

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