python 2.7.12 on Linux behaving differently than on Windows

Steve D'Aprano steve+python at pearwood.info
Tue Dec 6 21:22:09 EST 2016


On Tue, 6 Dec 2016 06:08 pm, Gregory Ewing wrote:

>> And if there's an error in an option, you may have to abort, which means
>> throwing away that list of files which, in some cases, can run into
>> millions.
> 
> This "millions of files" thing seems to be an imaginary
> monster you've invented to try to scare people. I claim
> that, to a very good approximation, it doesn't exist.
> I've never encountered a directory containing a million
> files, and if such a thing existed, it would be pathological
> in enough other ways to make it a really bad idea.

I didn't read Bart's "millions" as *literally* 2*10**6 or more, I read it
as "a very large number of files". But it is conceivable that it is
millions.

ReiserFS can apparently handle up to approximately 4 billion files in a
single directory; even FAT32 can take up to 268 million files in total,
although there is a per-directory limit of 65535.

Here's a true story of a fellow who ended up with 8 million files in a
single directory:

http://be-n.com/spw/you-can-list-a-million-files-in-a-directory-but-not-with-ls.html


There are system dependent limits on globbing expansion and the number of
arguments you can pass to a program:

http://stackoverflow.com/questions/4185017/maximum-number-of-bash-arguments-max-num-cp-arguments

http://www.in-ulm.de/~mascheck/various/argmax/





-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.



More information about the Python-list mailing list