windows and file names > 256 bytes

Tobiah toby at tobiah.org
Tue Jul 7 17:56:00 CEST 2015


On 06/24/2015 10:45 AM, Albert-Jan Roskam wrote:
> Hi,
>
> Consider the following calls, where very_long_path is more than 256 bytes:
> [1] os.mkdir(very_long_path)
> [2] os.getsize(very_long_path)
> [3] shutil.rmtree(very_long_path)
>
> I am using Python 2.7 and [1] and [2] fail under Windows XP [3] fails
the prefix)
>
> My questions:
> 1. How can I get the file size of very long paths under XP?

As a workaround, could you use multiple calls to os.chdir()
to get to where you need to do your operations, then use
relative paths from there?

Tobiah


More information about the Python-list mailing list