Script to count files in a folder

Fredrik Lundh fredrik at pythonware.com
Mon Oct 23 09:11:57 EDT 2006


umut.tabak at student.kuleuven.be wrote:

> A batch file creates this file and deletes that file in the same loop.
> This file is intended to start the reading of an input file. After it
> is read batch file deletes this file automatically and on the next loop
> it  will be written and deleted again. With this script I have to count
> the occurences of the file on this specific folder.

what does "count" mean here?

do you want to check if the file is there, or how many times a file with
that name has been created ?

the former is easy (just use the os.path.isfile() function), the latter is not
really possible.

</F> 






More information about the Python-list mailing list