Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python os.path.exists无法识别C:\Windows\system32\drivers下的子目录_Python_Windows - Fatal编程技术网

Python os.path.exists无法识别C:\Windows\system32\drivers下的子目录

Python os.path.exists无法识别C:\Windows\system32\drivers下的子目录,python,windows,Python,Windows,有谁能告诉我为什么会出现这种行为: C:\...>dir C:\Windows\System32\drivers\subdir\0xDEADBEEF.008 Volume in drive C is Win7HPx64 Volume Serial Number is 04BF-EE2E Directory of C:\Windows\System32\drivers\subdir\0xDEADBEEF.008 08/11/2011 04:21 PM <DIR>

有谁能告诉我为什么会出现这种行为:

C:\...>dir C:\Windows\System32\drivers\subdir\0xDEADBEEF.008
 Volume in drive C is Win7HPx64
 Volume Serial Number is 04BF-EE2E

 Directory of C:\Windows\System32\drivers\subdir\0xDEADBEEF.008

08/11/2011  04:21 PM    <DIR>          .
08/11/2011  04:21 PM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  11,581,788,160 bytes free

C:\...>C:\Python27\python.exe
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> silo = r'C:\Windows\System32\drivers\subdir\0xDEADBEEF.008'
>>> os.path.isdir(silo)
False
>>> os.path.exists(silo)
False
所述目录上的os.stat引发WindowsError:[错误3]系统找不到指定的路径


我也尝试过使用以管理员身份运行上下文菜单启动的cmd控制台。没有骰子:


如果您在64位Windows上使用32位Python构建,那么对C:\Windows\SYSTEM32的访问将透明地重定向到C:\Windows\SYSWOW64。在64位系统上,SYSTEM32包含64位DLL,SYSWOW64包含32位DLL

要从32位Python访问real SYSTEM32目录,请使用C:\WINDOWS\SYSNATIVE


如果您在64位Windows上使用32位Python构建,那么对C:\Windows\SYSTEM32的访问将透明地重定向到C:\Windows\SYSWOW64。在64位系统上,SYSTEM32包含64位DLL,SYSWOW64包含32位DLL

要从32位Python访问real SYSTEM32目录,请使用C:\WINDOWS\SYSNATIVE


你确定它仍然存在吗?是的。我复制粘贴了所有内容,不仅是上面的屏幕,还粘贴了浏览器地址栏中的路径名。如果Python不是以管理员身份运行,它是否能够看到“C:\Windows\System32”?我也尝试了使用以管理员身份运行的上下文菜单启动的cmd控制台。没有骰子-我无法在Windows7、Python2.7和以管理员身份运行的情况下重现这一点。在没有管理员提示的情况下没有尝试过,因为我必须首先重新启用UAC。你确定它仍然存在吗?是的。我复制粘贴了所有内容,不仅是上面的屏幕,还粘贴了浏览器地址栏中的路径名。如果Python不是以管理员身份运行,它是否能够看到“C:\Windows\System32”?我也尝试了使用以管理员身份运行的上下文菜单启动的cmd控制台。没有骰子-我无法在Windows7、Python2.7和以管理员身份运行的情况下重现这一点。在没有管理员提示的情况下我没有尝试过,因为我必须首先重新启用UAC。当我没有在XP 32位机器上复制它时,我有了这个顿悟,而你刚刚确认了它!谢谢当我没有在XP 32位机器上复制它时,我有了这个顿悟,而你刚刚证实了这一点!谢谢