python - error in os.makedirs for windows long path name handling -
I am writing a function where the folder was created according to the path that was provided by the user in Python 2.6.
import os src = 'E: \\ abc' #abc does not exist src = u "\\\\? \\" + src osmakers (src) After the drive name, the name of the folder is straight and the "\\? \" Is added to the path to handle the long path: I 123] file name, directory name or volume label syntax Wrong: U '\\'
If you have not been added to the "\\? \" Path then this error has not been seen; is there a way to fix the error?
Thanks in advance.
I 'with Python 2.5.4 first) and I've found that for the least path The root folder which is '\\\\? \\ ' with the prefix must be present for the OS to work. For example, if you have os.makedirs ('\\\\\' \\ '+ r'C: \ test \ Very \ long \ path \ ") , at least" C : \ Test "should be present Now, it is being said, this is not a problem in Python 2.7.9, so perhaps it was decided that the way improving. < / Div>
Comments
Post a Comment