潜在的に非常に大きなディレクトリ (任意に大きい)を反復処理する必要があります。私が理解していることから、通常の関数は一致するすべてglob.globのファイル名のリストをメモリに保存しますが、関数はイテレータを使用します。したがって、通常の関数を使用することは問題外です。ディレクトリに多くのファイルが存在する可能性があるためです。glob.iglobglob.glob
My problem is that iglob iterates through the directory in a seemingly random order. I would like it to iterate through the files in alphabetical order. I cannot get a list of all the filenames at once, and just sort them, so I am wondering if there is a way to make iglob iterate through the directory in alphabetical order.