python Windows os.stat три точки сложить не удалось

Например, у вас есть файл a.txtin G:

For example, you have a file a.txt in G:1... (from linux,or md G:1...):

os.listdir(r'G:1...')  
[]  
os.stat(r'G:1...')  
Traceback (most recent call last):  
  File "<stdin>", line 1, in <module>  
WindowsError: [Error 2] : 'G:\1...'  

I want to know how can I get information of such fold (also I can't os.stat(r'G:1...file') when it copied from linux.

...(from linux,или md G:

For example, you have a file a.txt in G:1... (from linux,or md G:1...):

os.listdir(r'G:1...')  
[]  
os.stat(r'G:1...')  
Traceback (most recent call last):  
  File "<stdin>", line 1, in <module>  
WindowsError: [Error 2] : 'G:\1...'  

I want to know how can I get information of such fold (also I can't os.stat(r'G:1...file') when it copied from linux.

...):

os.listdir(r'G:

For example, you have a file a.txt in G:1... (from linux,or md G:1...):

os.listdir(r'G:1...')  
[]  
os.stat(r'G:1...')  
Traceback (most recent call last):  
  File "<stdin>", line 1, in <module>  
WindowsError: [Error 2] : 'G:\1...'  

I want to know how can I get information of such fold (also I can't os.stat(r'G:1...file') when it copied from linux.

...')
[]
os.stat(r'G:

For example, you have a file a.txt in G:1... (from linux,or md G:1...):

os.listdir(r'G:1...')  
[]  
os.stat(r'G:1...')  
Traceback (most recent call last):  
  File "<stdin>", line 1, in <module>  
WindowsError: [Error 2] : 'G:\1...'  

I want to know how can I get information of such fold (also I can't os.stat(r'G:1...file') when it copied from linux.

...')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
WindowsError: [Error 2] : 'G:1...'

Я хочу знать, как я могу получить информацию о такой складке (также я не могуos.stat(r'G:

For example, you have a file a.txt in G:1... (from linux,or md G:1...):

os.listdir(r'G:1...')  
[]  
os.stat(r'G:1...')  
Traceback (most recent call last):  
  File "<stdin>", line 1, in <module>  
WindowsError: [Error 2] : 'G:\1...'  

I want to know how can I get information of such fold (also I can't os.stat(r'G:1...file') when it copied from linux.

...file'), когда она скопирована с linux.

1 ответ

  1. Так же, как комментарий @eryksun:

    обработка обычного пути удаляет только конечные точки из последнего компонента пути

    os.stat(u'\\?\G:\1...') 
    nt.stat_result(st_mode=16895, st_ino=0L, st_dev=0L, st_nlink=0, st_uid=0, st_gid=0, st_size=0L, st_atime=1482739662L, st_mtime=1482739662L, st_ctime=1482739662L)
    

    BTW: любая деталь знает препроцесс пути в windows, и сообщение будет оценено.