listdir() - any way to limit # of file entries?

Roger Upole rupole at hotmail.com
Wed Feb 22 18:32:06 EST 2006


You can use win32file.FindFilesIterator to loop thru the files
without creating a huge list of everthing in the folder.

       hth
          Roger

"Peter A. Schott" <paschott at no.yahoo.spamm.com> wrote in message news:bunpv1pafuserji1bjft3146c7833h1pu9 at 4ax.com...
>I want to build a program that does some archiving.  We have several programs
> that have been dumping files into a folder (one folder) for some time now.  I
> want to limit the number of files returned by listdir to avoid trying to build a
> list with tons of entries.  I then want to move those files into a zip archive
> for the appropriate day/month.
>
> Is there any way to build a list of the first 1000 files or so in a folder?
>
> Running Python 2.4.2 on Win32 with Win32 extensions.
>
> Thanks.
>
> -Pete Schott 



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



More information about the Python-list mailing list