Obtaining the attributes and properties of a folder recursively.

venutaurus539 at gmail.com venutaurus539 at gmail.com
Sun Mar 22 23:13:07 EDT 2009


On Mar 21, 3:05 pm, Tim Golden <m... at timgolden.me.uk> wrote:
> venutaurus... 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
> > Characters?
>
> > 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:
>
> <code>
> import os
> 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")
>
> f.close ()
> os.startfile ("arabic-files.txt")
>
> </code>
>
> Thanks
> TJG

This is the output for your code Sir. But I think os.stat is
sufficient to satisfy all my requirements. May be we just have to make
the path itself a Unicode path.

Arabicְדזךמאּשּׁתּפּפֿשּﭏכּטּךּאָשּׁבֿפֿװײ״טצתא
Arabicְדזךמאּשּׁתּפּפֿשּﭏכּטּךּאָשּׁבֿפֿװײ״טצתא.doc
Arabicְדזךמאּשּׁתּפּפֿשּﭏכּטּךּאָשּׁבֿפֿװײ״טצתאnew.doc
الأبجدي.txt
تعلم اللغة الإيطالية مجان.doc
دروس مجانية في اللغة الإنجليزي.txt
دروس مجانية في اللغة الإنجليزي1.txt

Thank you,
Venu


More information about the Python-list mailing list