Is there a function to search the HD

Jeremy Sanders jeremy+plusnews at jeremysanders.net
Tue Sep 28 12:27:04 CEST 2004


On Tue, 28 Sep 2004 10:37:07 +0200, Peter Jensen wrote:

> I was wondering if there is an inbuild function in python to search your
> harddrives ( Harddisk's) for a file of a speciel type. I mean can I write
> a command with 2 parameters ( one being the filetype, and the other the
> location on the harddisk where I want to search for the specific file type
> )

On Unix, you may want to call locate to do the searching. This is a lot
faster than walking the file system yourself. You can use os.system to
call locate (see man locate for details).

Jeremy




More information about the Python-list mailing list