Thanks Tim and Rob... this works really well!
--
http://mail.python.org/mailman/listinfo/python-list
rick <[EMAIL PROTECTED]> wrote:
> Georg Brandl wrote:
>
>> Which application needs to walk over ALL files? Normally, you just
>> have a starting path and walk over everything under it.
>
> Searching for a file by name. Scanning for viruses. Etc. There are
> lots of legitimate reason to walk all
Jonathan Hartley wrote:
> Georg Brandl wrote:
> >> Which application needs to walk over ALL files?
>
> How about 'updatedb' for starters, the index-maintainer for the common
> *nix command-line utility 'locate'.
>
> I'm pretty sure that os.walk( ) deals with symbolic links (by not
> visiting t
rick wrote:
> Georg Brandl wrote:
>
>> Which application needs to walk over ALL files? Normally, you just have a
>> starting path and walk over everything under it.
>
> Searching for a file by name. Scanning for viruses. Etc. There are lots
> of legitimate reason to walk all paths from a central
Georg Brandl wrote:
>> Which application needs to walk over ALL files?
How about 'updatedb' for starters, the index-maintainer for the common
*nix command-line utility 'locate'.
I'm pretty sure that os.walk( ) deals with symbolic links (by not
visiting them) and ' /proc' type complexities by
Tim Golden wrote:
> [Rick]
> | Searching for a file by name. Scanning for viruses. Etc.
> | There are lots
> | of legitimate reason to walk all paths from a central
> | starting point, no???
>
> Well, to get you started, I think this is the kind
> of thing you'll want. Uses ctypes, which is bui
Tim Golden wrote in news:mailman.119.1160403292.11739.python-
[EMAIL PROTECTED] in comp.lang.python:
> [Rick]
>| Searching for a file by name. Scanning for viruses.
> Etc.
>| There are lots
>| of legitimate reason to walk all paths from a centra
> l
>| starting point, no???
>
> Well, to get y
Fredrik Lundh wrote:
> what's the difference between a "starting path" and a "starting point" ?
None. What starting path or point would you suggest under Windows? Is
there something obvious that I'm missing? I see no starting point under
windows as my initial question clearly stated.
--
http://
"rick" <[EMAIL PROTECTED]> wrote:
>> Which application needs to walk over ALL files? Normally, you just have a
>> starting path and walk over everything under it.
>
> Searching for a file by name. Scanning for viruses. Etc. There are lots
> of legitimate reason to walk all paths from a central sta
[Rick]
| Searching for a file by name. Scanning for viruses. Etc.
| There are lots
| of legitimate reason to walk all paths from a central
| starting point, no???
Well, to get you started, I think this is the kind
of thing you'll want. Uses ctypes, which is built-in
to Python 2.5 so presumably
Georg Brandl wrote:
> Which application needs to walk over ALL files? Normally, you just have a
> starting path and walk over everything under it.
Searching for a file by name. Scanning for viruses. Etc. There are lots
of legitimate reason to walk all paths from a central starting point, no???
-
[Georg Brandl]
| rick wrote:
| > In Windows, the file system is disjointed and there is now
| real 'root'
| > At least none that I can see. It looks more like this:
| >
| > | | | | | | |
| > |_|_|_|_|_|_|
| > A B C D E F G
| >
| > How do you guys handle this when working with scripts that
| n
rick wrote:
> In Unix, the file system hierarchy is like a tree that has a base or
> 'root' that exposes objects (files and folders) that can easily be
> iterated over.
>
>
> \ \ | / /
> \ \ | / /
>\ \|/ /
> \ | /
> \|/
> |
> |
> Root
>
> So, when I do os.chdi
Gerrit Holl wrote:
> The very least you can try:
>
> import string
> string.ascii_uppercase
>
> for c in string.ascii_uppercase:
> if os.path.isdir('%s:/' % c):
> ...
>
> etc.
> But I suppose there should be a better way.
Oh yes, I do that. I spelled out the example very explicitly
On 2006-10-09 14:45:35 +0200, rick wrote:
> import os.path
>
> paths = []
>
> if os.path.isdir('A:/'):
> paths.append('A:/')
>
> if os.path.isdir('B:/'):
> paths.append('B:/')
>
> ...
>
> That's a kludge, but it works OK. I'm sure WMI may have a function that
> returns mounted volumes
15 matches
Mail list logo