Is there a function to search the HD
Max M
maxm at mxm.dk
Tue Sep 28 04:55:53 EDT 2004
Peter Jensen wrote:
> Hi all.
>
> 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 )
>
> Thank for all input...
6.1 os -- Miscellaneous operating system interfaces
This module provides a more portable way of using operating system
dependent functionality than importing a operating system dependent
built-in module like posix or nt.
6.1.4 Files and Directories
walk( top[, topdown=True [, onerror=None]])
walk() generates the file names in a directory tree, by walking the tree
either top down or bottom up. For each directory in the tree rooted at
directory top (including top itself), it yields a 3-tuple (dirpath,
dirnames, filenames).
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
More information about the Python-list
mailing list