如何查看文件正被别的程序占用?
比如正在被拷贝,视频文件正在被播放等等,如何能查看出正在被使用?
怎么能获取对这个文件的独立访问的权限?
谢谢了
[解决办法]
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" *