Needing a WinXP Python variant of a line of code

Tim Golden tim.golden at viacom-outdoor.co.uk
Mon Jan 30 12:37:29 EST 2006


[Ron Rogers Jr.]

| I have this line of code that's written with Linux in mind:
| 
| path_to_nethack_logfile = os.popen("locate logfile | grep 
| nethackdir").read()
| 
| and I'm wanting a Windows equivalent, any suggggestions?

Well, you could obviously use os.walk to write something 
(cross-platform) which would search the entire filesystem 
for a filename matching the pattern you're after.

But there's no universal Windows equivalent to the Unix
locate database. More recent Wins do offer you the system
indexing catalog (or whatever it's called) and I'm sure
there are existing apps to do the same sort of thing with
more or less flair and automation, but there's nothing
which is guaranteed to be there.

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list