Message 10255 - Python tracker (original) (raw)

Logged In: YES user_id=1152606

I came across this suggestion while googling... and I would have expected it to work, but this code:

import os

os.chdir("\\ussvs- \radpubs\wip\zStaging\translation\D10 \previous_test\cumulative\Common\Reference\API\Borland .Eco.Persistence.Configuration\classes\PersistenceMapper DefinitionCollection\Methods") for filename in os.listdir("."): print filename infile = file(filename)

gives me

C:\Documents and Settings\snorton\Desktop\h2build\buildtools>test.py PersistenceMapperDefinitionCollection.AddRange.xml PersistenceMapperDefinitionCollection.Assign.xml PersistenceMapperDefinitionCollection.FindByName.xml PersistenceMapperDefinitionCollection.NameExists.xml PersistenceMapperDefinitionCollection.PersistenceMapperDefi nitionCollection.xml Traceback (most recent call last): File "C:\Documents and Settings\snorton\Desktop\h2build\buildtools\test.py", line 6, in ? infile = file(filename) IOError: [Errno 2] No such file or directory: 'PersistenceMapperDefinitionCollection.Persistence MapperDefinitionCollection.xml'

... funny that the file with the long path comes up in listdir() but isn't found with file()...