Obtaining the attributes and properties of a folder recursively.
mail at timgolden.me.uk
Sat Mar 21 11:05:07 CET 2009
venutaurus539 at gmail.com wrote:
> Thank you Sir for your reply. It is working for me. But is failing if
> I have Unicode characters in my path. I tried giving a 'u' in front of
> the path but still it fails at f.createdat. Does it support Unicode
> This the traceback which I got while running the above python script
> on my data:
> \\?\C:\JPDump\AGIT_FSDM\Unicode\Arabic files\ArabicÖ°××××ï¬°ï¬¬ï
In fact, to give me something to test against, would you
be able to send me the result of running this code, please?
It's just listing the names of the files under that particular
directly, encoded as utf8 so they'll survive transit:
from winsys import fs
PATH = r"\\?\C:\JPDump\AGIT_FSDM\Unicode\Arabic files"
f = open ("arabic-files.txt", "wb")
for filename in fs.listdir (PATH):
f.write (filename.encode ("utf8") + "\r\n")
More information about the Python-list