Freaky_Chris 299 Master Poster

Thanks vega i had a feeling it would come down to that, i will test it when i get home as im currently in college. But i am testing is on a memory stick and i have set up my script so that as it iterates through the files it changes the current working dir to that of the file im retrieving the size of, then i retrieve the size and finally return to the original dir of the python script ready to output results to the text file.
This is done if an exception is thrown, other wise i just call os.path.getsize() on the whole file location.

It seems to work fine i just need a long file to test it on.

Chris

Mark Carlson commented: Hi Chris, Found LongPathTool program useful +0
Freaky_Chris 299 Master Poster

Hey, im having a problem retrieving information about some files due to the fact either the file name or the extension is too long.

For example i want to retrieve the size of a file only i call

os.path.getsize("somelongfilename.txt")

Note that it may not be a .txt extension, but it normall no longer than a 3 character extension.

And i get the following error

WindowsError: [Error 206] The filename or extension is too long:

Is there away around this?

Thanks,
Chris

Mark Carlson commented: great post +0