View Single Post
Old 07-15-2011, 12:19 PM   #4
Halo
Connoisseur
Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.
 
Halo's Avatar
 
Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
Quote:
Originally Posted by kovidgoyal View Post
The path length is limited to 75 characters. If it were made longer then the path to individual book files would become too long for windows.
Windows supports paths of up to 32,767 characters if you prefix the path with "\\?\". For example, "\\?\D:\very long path". See the following web pages for reference:
  1. http://www.codinghorror.com/blog/200...-too-long.html
  2. http://msdn.microsoft.com/en-us/library/Aa365247

I successfully used this method last year when I was writing scripts to clean up files on a file server at work.

It works fine in Python. I think calibre can fix this limitation:

Code:
import os
p = "\\\\?\\" + os.getcwdu()
for i in range(10):
    p = os.path.join(p, 'x' * 100)
    os.mkdir(p)
    os.stat(p)
print len(p)

Last edited by Halo; 07-15-2011 at 12:29 PM.
Halo is offline   Reply With Quote