首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

怎么查看文件正被别的程序占用

2014-01-01 
如何查看文件正被别的程序占用?比如正在被拷贝,视频文件正在被播放等等,如何能查看出正在被使用?怎么能获

如何查看文件正被别的程序占用?
比如正在被拷贝,视频文件正在被播放等等,如何能查看出正在被使用?

怎么能获取对这个文件的独立访问的权限?

谢谢了
[解决办法]
linux下有lsof 
[解决办法]
grep fileName
[解决办法]
http://www.nirsoft.net/utils/opened_files_view.html
本人不出,谁与争锋?
[解决办法]
获取对文件独立访问权限很简单:

Open a file for sharing.

int _sopen( const char *filename, int oflag, int shflag [, int pmode ] );

……
The argument shflag is a constant expression consisting of one of the following manifest constants, defined in SHARE.H.

_SH_DENYRW

Denies read and write access to file

_SH_DENYWR

Denies write access to file

_SH_DENYRD

Denies read access to file

_SH_DENYNO

Permits read and write access


[解决办法]
但是实际上没必要去检查吧,你只需去访问文件试一试就知道了


stat -c "%a %n" *

热点排行