在窗口中的进程打开的文件的名称? [英] Name of files opened by a process in window?

查看:126
本文介绍了在窗口中的进程打开的文件的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何打印在窗口中的一些过程(PID)打开的文件的名字吗?或所有进程(PID)目前打开一个文件。结果
    的Process Explorer 是一种实用工具适用于相同的。 但是,它是如何工作没有提到?
    所有的 / proc文件系统的一种在Windows事情present的?

 我们能读到的任何窗口的注册?
我想要写一个程序code和我在Windows上很少使用。

有两个解决方案的Python:结果
    1.进口psutil结果
    2.进口WIN32API,win32con,win32process

但它仍然是我的问题!结果
    1.如何做这些库上运行?结果
    2.任何寄存器,内存或虚拟文件系统保存这些信息?


  

如果它有可能在窗口的为什么这个信息不是任务管理器present?



解决方案

下面是用Python独立于平台的解决方案。

 进口psutil
   P = psutil.Process(os.getpid())#或进程的PID
   p.open_files()

所以我请您 psutil 打包它具有获取信息太出色功能上运行的进程

How to print name of file open by some process (PID) in window? Or All Processes (PID) currently open a file.
Process Explorer is a utility works for same. But how does it work not mentioned? Any /proc filesystem kind of thing present in windows?

Can we read any Window's Registry?  
I wants to write a programming code And I rarely work on windows. 

Got two solutions in Python:
1. import psutil
2. import win32api, win32con, win32process

But it is still a question to me!
1. How does these libraries works?
2. Any register, memory or virtual file system keeps this information?

If its possible in window, Why this information not present in TasK-Manager?

解决方案

Here is the platform independent solution in python.

   import psutil
   p = psutil.Process(os.getpid()) # or PID of process
   p.open_files()

So i refer you psutil package it has too good functions for getting information on running processes

这篇关于在窗口中的进程打开的文件的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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