From: Michael G Schwern Date: 16:11 on 14 Aug 2007 Subject: Argument list too long... again. Oh look .ccache has gotten confused and filled up with tmp files and disk space is running low. That's ok, I'll just delete them. 0 windhund ~/.ccache$ rm tmp.* -bash: /sw/bin/rm: Argument list too long Hate. Anyone who tells me I should be piping or some shit to justify this will be destroyed.
From: demerphq Date: 16:17 on 14 Aug 2007 Subject: Re: Argument list too long... again. On 8/14/07, Michael G Schwern <schwern@xxxxx.xxx> wrote: > Oh look .ccache has gotten confused and filled up with tmp files and disk > space is running low. That's ok, I'll just delete them. > > 0 windhund ~/.ccache$ rm tmp.* > -bash: /sw/bin/rm: Argument list too long > > Hate. > > Anyone who tells me I should be piping or some shit to justify this will be > destroyed. Hah!, so there is something the win32 shell does better than *nixy ones. I knew there had to be something. :-) yves
From: Andy Armstrong Date: 16:19 on 14 Aug 2007 Subject: Re: Argument list too long... again. On 14 Aug 2007, at 16:17, demerphq wrote: > Hah!, so there is something the win32 shell does better than *nixy > ones. I knew there had to be something. :-) Does cmd.exe actually do wildcard expansion? I though programs had to do that for themselves.
From: demerphq Date: 16:21 on 14 Aug 2007 Subject: Re: Argument list too long... again. On 8/14/07, Andy Armstrong <andy@xxxxxx.xxx> wrote: > On 14 Aug 2007, at 16:17, demerphq wrote: > > Hah!, so there is something the win32 shell does better than *nixy > > ones. I knew there had to be something. :-) > > Does cmd.exe actually do wildcard expansion? I though programs had to > do that for themselves. Thats the whole point. By doing it themselves there is no danger of having an argument list too long because of trying to operate on an overly long directory. yves
From: demerphq Date: 16:30 on 14 Aug 2007 Subject: Re: Argument list too long... again. On 8/14/07, demerphq <demerphq@xxxxx.xxx> wrote: > On 8/14/07, Andy Armstrong <andy@xxxxxx.xxx> wrote: > > On 14 Aug 2007, at 16:17, demerphq wrote: > > > Hah!, so there is something the win32 shell does better than *nixy > > > ones. I knew there had to be something. :-) > > > > Does cmd.exe actually do wildcard expansion? I though programs had to > > do that for themselves. > > Thats the whole point. By doing it themselves there is no danger of > having an argument list too long because of trying to operate on an > overly long directory. Although in this context "doing it by themselves" means using the results returned by FindFirstFile(), FindNextFile() and FindClose(). Which isn't all that much really. Yves
From: Peter da Silva Date: 17:45 on 14 Aug 2007 Subject: Re: Argument list too long... again. On Aug 14, 2007, at 10:30, demerphq wrote: > Although in this context "doing it by themselves" means using the > results returned by FindFirstFile(), FindNextFile() and FindClose(). > Which isn't all that much really. Except that the beggar who wrote the program had to have bothered to do it. And of course every operating system has its own equivalent, so portable programs either don't bother or have a maze of ifdefs in main. Not that Windows programmers bother with writing portable code. And this gives them yet another reason to write OS-specific code instead of using the standard C library, so you get programs messing with DOS file handles instead of using stdio. Why do people do that? You don't often get programs on UNIX calling open() and read() instead of fopen() and fread() unless they're doing low level socket code or something that needs it.
From: Andy Armstrong Date: 16:33 on 14 Aug 2007 Subject: Re: Argument list too long... again. On 14 Aug 2007, at 16:21, demerphq wrote: > Thats the whole point. By doing it themselves there is no danger of > having an argument list too long because of trying to operate on an > overly long directory. I'm sure the situation's much better these days - but the whole 'I wonder if /this/ program does argument expansion' pain used to offset any advantage :)
From: A. Pagaltzis Date: 10:25 on 15 Aug 2007 Subject: Re: Argument list too long... again. * demerphq <demerphq@xxxxx.xxx> [2007-08-14 17:30]: > By doing it themselves there is no danger of having an argument > list too long because of trying to operate on an overly long > directory. By "doing it themselves" you force everyone to parse the command line on their own, which means quoting conventions and how to deal with spaces in filenames can vary not per shell, but per invoked program. If that's not hateful, I don't know what is. Thankfully most programs today use the same MSFT C RTL so the conventions don't vary as much as they could, but it was a right pain in the bottocks during the DOS era and continued until WinXP managed to excise the last large pockets of Win9x installs. Regards,
From: Peter da Silva Date: 12:35 on 15 Aug 2007 Subject: Re: Argument list too long... again. On Aug 15, 2007, at 4:25, A. Pagaltzis wrote: > By "doing it themselves" you force everyone to parse the command > line on their own, which means quoting conventions and how to > deal with spaces in filenames can vary not per shell, but per > invoked program. If that's not hateful, I don't know what is. It's also a security problem, because programs that call other programs don't know how to quote and escape the command line. In UNIX it is possible to write a program that can accept any command line safely, and to call it safely, without having any unexplained filename expansion, metacharacter interpretation, and so on happening. If you try and do that in DOS-derived systems you lose the ability to EVER get filename expansion from those programs. > Thankfully most programs today use the same MSFT C RTL so the > conventions don't vary as much as they could, but it was a right > pain in the bottocks during the DOS era and continued until WinXP > managed to excise the last large pockets of Win9x installs. Not enough do. Microsoft said so themselves, recently, during the recent "you're insecure too" row between IE and Firefox.
From: jrodman Date: 23:58 on 15 Aug 2007 Subject: Re: Argument list too long... again. On Wed, Aug 15, 2007 at 06:35:18AM -0500, Peter da Silva wrote: > On Aug 15, 2007, at 4:25, A. Pagaltzis wrote: > >By "doing it themselves" you force everyone to parse the command > >line on their own, which means quoting conventions and how to deal > >with spaces in filenames can vary not per shell, but per invoked > >program. If that's not hateful, I don't know what is. > > It's also a security problem, because programs that call other > programs don't know how to quote and escape the command line. To my knowledge, it's even worse than you say. I do not believe there is any way that you can correctly quote all valid filenames *even if* you restrict yourself to the set of programs which follow the default Microsoft rules. I do not believe the rules are actually specified anywhere. Exacerbating the problem is of course that the programs receive one string for the entire command line and argument list, so it is not possible to include delimiters out of band. Even if the quoting and escaping rules were sufficient to represent all valid filenames, sufficiently escaped -- they are not -- you would have to maintain your own independent escaping code, since such tools are not provided. -josh
From: Bruce Richardson Date: 20:14 on 14 Aug 2007 Subject: Re: Argument list too long... again. On Tue, Aug 14, 2007 at 05:17:09PM +0200, demerphq wrote: > On 8/14/07, Michael G Schwern <schwern@xxxxx.xxx> wrote: > > Oh look .ccache has gotten confused and filled up with tmp files and disk > > space is running low. That's ok, I'll just delete them. > > > > 0 windhund ~/.ccache$ rm tmp.* > > -bash: /sw/bin/rm: Argument list too long > > > > Hate. > > > > Anyone who tells me I should be piping or some shit to justify this will be > > destroyed. > > Hah!, so there is something the win32 shell does better than *nixy > ones. I knew there had to be something. :-) Hmm, that's an example of the win32 shell being crap and it just happens not to cause this specialised problem because it's too crap to encounter the situation. "Our car doesn't need windscreen wipers!" "Your car doesn't have a windscreen."
From: Jarkko Hietaniemi Date: 22:08 on 14 Aug 2007 Subject: Re: Argument list too long... again. > Hmm, that's an example of the win32 shell being crap and it just happens > not to cause this specialised problem because it's too crap to encounter > the situation. > > "Our car doesn't need windscreen wipers!" > > "Your car doesn't have a windscreen." More like "Our car doesn't need air bags!" "Your car doesn't have wheels."
From: =?iso-8859-1?b?U+liYXN0aWVu?= Aperghis-Tramoni Date: 16:28 on 14 Aug 2007 Subject: Re: Argument list too long... again. Michael G Schwern wrote: > Oh look .ccache has gotten confused and filled up with tmp files and di= sk > space is running low. That's ok, I'll just delete them. > > 0 windhund ~/.ccache$ rm tmp.* > -bash: /sw/bin/rm: Argument list too long > > Hate. > > Anyone who tells me I should be piping or some shit to justify this wil= l be > destroyed. Just do it in Perl: $ perl -eunlink+glob+shift 'tmp.*' --=20 S=E9bastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: Michael G Schwern Date: 16:53 on 14 Aug 2007 Subject: Re: Argument list too long... again. Sébastien Aperghis-Tramoni wrote: > Michael G Schwern wrote: > >> Oh look .ccache has gotten confused and filled up with tmp files and disk >> space is running low. That's ok, I'll just delete them. >> >> 0 windhund ~/.ccache$ rm tmp.* >> -bash: /sw/bin/rm: Argument list too long >> >> Hate. >> >> Anyone who tells me I should be piping or some shit to justify this will be >> destroyed. > > Just do it in Perl: > > $ perl -eunlink+glob+shift 'tmp.*' That's what I wound up doing, but less hateful to my brain. perl -wle 'unlink <tmp.*>'
From: David Cantrell Date: 16:37 on 14 Aug 2007 Subject: Re: Argument list too long... again. On Tue, Aug 14, 2007 at 08:11:54AM -0700, Michael G Schwern wrote: > 0 windhund ~/.ccache$ rm tmp.* > -bash: /sw/bin/rm: Argument list too long > Hate. > Anyone who tells me I should be piping or some shit to justify this will be > destroyed. Microsoft obviously got it right when they decided that applications should be responsible for their own globbing.
From: Peter da Silva Date: 17:27 on 14 Aug 2007 Subject: Re: Argument list too long... again. On Aug 14, 2007, at 10:11, Michael G Schwern wrote: > Anyone who tells me I should be piping or some shit to justify this > will be > destroyed. Well, you could do "find . -name 'tmp.*' -exec rm '{}' ';'" Piping or some shit is faster.
From: Michael Leuchtenburg Date: 17:42 on 14 Aug 2007 Subject: Re: Argument list too long... again. Peter da Silva wrote: > On Aug 14, 2007, at 10:11, Michael G Schwern wrote: >> Anyone who tells me I should be piping or some shit to justify this >> will be destroyed. > > Well, you could do "find . -name 'tmp.*' -exec rm '{}' ';'" > > Piping or some shit is faster. I think the find -exec invocation qualifies as "some shit".
From: Dave Hodgkinson Date: 22:13 on 14 Aug 2007 Subject: Re: Argument list too long... again. On 14 Aug 2007, at 17:11, Michael G Schwern wrote: > Oh look .ccache has gotten confused and filled up with tmp files > and disk > space is running low. That's ok, I'll just delete them. > > 0 windhund ~/.ccache$ rm tmp.* > -bash: /sw/bin/rm: Argument list too long > > Hate. > > Anyone who tells me I should be piping or some shit to justify this > will be > destroyed. You all lose. man xargs
From: Michael G Schwern Date: 01:44 on 15 Aug 2007 Subject: Re: Argument list too long... again. Dave Hodgkinson wrote: > > On 14 Aug 2007, at 17:11, Michael G Schwern wrote: > >> Oh look .ccache has gotten confused and filled up with tmp files and disk >> space is running low. That's ok, I'll just delete them. >> >> 0 windhund ~/.ccache$ rm tmp.* >> -bash: /sw/bin/rm: Argument list too long >> >> Hate. >> >> Anyone who tells me I should be piping or some shit to justify this >> will be >> destroyed. > > You all lose. > > man xargs Honestly I couldn't figure out how to do it and couldn't be arsed to figure it out. The xargs man page? NO EXAMPLES! HATE! Doubly hateful that I should have to use a hateful piece of software to work around a hateful arbitrary size limit! Ring ring! Hello! 21st century calling!
From: Ricardo SIGNES Date: 01:56 on 15 Aug 2007 Subject: Re: Argument list too long... again. * Dave Hodgkinson <davehodg@xxxxx.xxx> [2007-08-14T17:13:07] > On 14 Aug 2007, at 17:11, Michael G Schwern wrote: > >Anyone who tells me I should be piping or some shit to justify this will be > >destroyed. > > You all lose. > > man xargs ...the program that you pipe to?
From: Jarkko Hietaniemi Date: 02:08 on 15 Aug 2007 Subject: Re: Argument list too long... again. Dave Hodgkinson wrote: > On 14 Aug 2007, at 17:11, Michael G Schwern wrote: > >> Oh look .ccache has gotten confused and filled up with tmp files >> and disk >> space is running low. That's ok, I'll just delete them. >> >> 0 windhund ~/.ccache$ rm tmp.* >> -bash: /sw/bin/rm: Argument list too long >> >> Hate. >> >> Anyone who tells me I should be piping or some shit to justify this >> will be >> destroyed. > > You all lose. > > man xargs You joined the list less than two weeks ago? >
From: A. Pagaltzis Date: 10:16 on 15 Aug 2007 Subject: Re: Argument list too long... again. * Michael G Schwern <schwern@xxxxx.xxx> [2007-08-14 17:20]: > Anyone who tells me I should be piping or some shit to justify > this will be destroyed. perl -e'unlink <tmp.*>'
From: A. Pagaltzis Date: 10:17 on 15 Aug 2007 Subject: Re: Argument list too long... again. * A. Pagaltzis <pagaltzis@xxx.xx> [2007-08-15 11:16]: > perl -e'unlink <tmp.*>' Ah, I see I am too late; sorry. Regards,
Generated at 10:26 on 16 Apr 2008 by mariachi