首页  >  文章  >  数据库  >  VS2005中,access对只读目录的属性判断不准确

VS2005中,access对只读目录的属性判断不准确

WBOY
WBOY原创
2016-06-07 15:36:43960浏览

只读目录, C:/attrib +A +S +H +R testdir C:/attrib testdir A SHR C:/testdir (1)VC6.0的执行结果: ***********test stat*********************** file [c:/testdir] exists! file [c:/testdir] is directory! file [c:/testdir] can be read! file [c:/

只读目录,
C:/>attrib +A +S +H +R testdir
C:/>attrib testdir
A  SHR     C:/testdir

 

(1)VC6.0的执行结果:
***********test stat***********************
file [c:/testdir] exists!
file [c:/testdir] is directory!
file [c:/testdir] can be read!
file [c:/testdir] can not be writed!

***********test access***********************
file [c:/testdir] exists!
file [c:/testdir] can not be writed!
file [c:/testdir] can be read!

 

(2)VS2005的执行结果
***********test stat***********************
file [c:/testdir] exists!
file [c:/testdir] is directory!
file [c:/testdir] can be read!
file [c:/testdir] can not be writed!

***********test access***********************
file [c:/testdir] exists!
file [c:/testdir] can be writed!
file [c:/testdir] can be read!

 

结论:在VS2005中,使用access判断的只读目录却有【写入】的属性。

         有什么高招,欢迎解答。


建议,在VS2005中对文件、目录进行权限校验时,最好不要用access。

 

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn