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

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

WBOY
WBOYOriginal
2016-06-07 15:36:43960Durchsuche

只读目录, 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。

 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn