win32file.createFile“系统找不到指定的路径" [英] win32file.createFile "The System cannot find the specified path"

查看:212
本文介绍了win32file.createFile“系统找不到指定的路径"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 win32file.CreateFile()打开在进程资源管理器中看到的文件".有问题的文件是(如在proc Explorer的句柄和dlls视图中所示):"\ Device \ ccSet _ {}"

I'm using win32file.CreateFile() to open up "file" that I see in process explorer. The file in question is (as seen in proc explorer's handles and dlls view) : "\Device\ccSet_{}"

Q1.任何人都可以阐明 \ Device \<文件名> 的含义.我相信这些文件显然不是存储在某处硬盘上的文件.除非我错了,否则它们是什么?

Q1. Can anyone shed light on what is \Device\<file name> . I believe these are obviously not files stored on the hard-disks somewhere. Unless I am wrong, what are they ?

Q2.当我尝试使用原样的路径时,在 win32file.CreateFile()中,它给我一个错误系统找不到指定的路径或文件".我要去哪里错了.

Q2. When I try to use the path AS IS, in win32file.CreateFile() , it gives me an error "The system cannot find the specified path or file". Where am I going wrong.

Q3.给定上述文件对象的地址(同样来自proc Explorer),我可以在不指定路径的情况下读取文件吗?

Q3. Given an address of the above file object (again from proc explorer), can I read the file without specifying the path ?

我正在使用的单行代码是:

the single line of code I am using is :

>>> win32file.CreateFile("Device\<filename>",w
in32con.GENERIC_READ|win32con.GENERIC_WRITE,win32con.FILE_SHARE_READ|win32con.FI
LE_SHARE_WRITE,None,win32con.OPEN_EXISTING,0,0)

推荐答案

  1. \ Device \ XXX名称是内部Windows NT设备名称.
  2. \\.\ 前缀将访问Win32设备名称空间,而不是Win32文件名称空间.例如,要打开COM10,您需要使用 \\.\ COM10 .
  3. 该句柄仅在打开它的进程内有效.
  1. The \Device\XXX names are the internal Windows NT device names.
  2. The \\.\ prefix will access the Win32 device namespace instead of the Win32 file namespace. For instance, to open COM10, you would need to use \\.\COM10.
  3. The handle is only valid inside the process that opened it.

这篇关于win32file.createFile“系统找不到指定的路径"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆