python 2.7.12 on Linux behaving differently than on Windows
torriem at gmail.com
Tue Dec 6 17:58:00 EST 2016
On 12/06/2016 03:35 PM, Nathan Ernst wrote:
> One other consideration in regards to globbing in the argument list:
> there's a static limit to the byte length of argv. On windows, it's 8191
> bytes (I'm assuming a null-terminator brings that to 8192, which is a weird
> 2**13). For Linux, as of kernal 2.6.25, apparently, the limit is 131072
> bytes, an equally odd choice of 2**17 bytes.
> I'm not sure if globs directly to commands bypass these restrictions, but
> I've seen real world issues with build systems with thousands of files that
> attempted to pass all dependencies to a target that blew up spectacularly
> (one of the reasons cl & link on windows accept argument files as input
> instead of just command line arguments).
Applications that can do their own globbing do avoid this command-line
length limit for sure, at least in these situations. Instead of
excepting one or more filenames on the command-line, it could accept a
filespec, a single field. So one million files would just be "foo *.*".
This is part of what Bart really likes about the windows way of doing
things. And it is an advantage of that scheme.
Anyway, I'm interested to hear Bart's opinion of PowerShell, which is
set to be the default shell for the Windows Console starting very soon.
cmd.exe will still be available for a while, but I imagine in a couple
of windows versions it will disappear entirely. I've little experience
with PowerShell, so I don't know whether it will bring about a new level
of argument interpretation that will get Bart all upset or if it will be
the cat's meow. Some parts of it look awfully unix-like such as cat and
nice looping constructs. Other parts bear little resemblance to anything
I've used before. Seems a little verbose to me (it is a shell that
wraps a complete object system).
More information about the Python-list