<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>detect acl (access control list) restrictions when working with NTFS directories and files</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">I want to EnumerateFiles, that is, create a list of files that match a</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=4 FACE="Calibri">wildcard,</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri"> on a drive</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=4 FACE="Calibri">or branch of it. I can do that fairly easily with code I</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">ve already go</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">t. It works reliably in most cases.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">The exception cases are when Windows has</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=4 FACE="Calibri">had some form of restriction applied using its ACL security feature. </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=4 FACE="Calibri">The</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=4 FACE="Calibri">EnumerateFiles</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri"> procedure uses FindFirst, FindNext and FindClose and can access the file attributes of the file/directory that it co</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">mes across. The mere file attributes don</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">t return enough information about the accessibility o</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">f a given directory for me to avoid trying to change to it when I</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">m not permitted by its ACL settings. </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">How ca</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=4 FACE="Calibri">n I obtain the ACL properties of a given file/directory so that I can be more fully informed?</FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-us"><FONT SIZE=4 FACE="Calibri">Stu Cox</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=4 FACE="Calibri">stuart.cox@gov.bc.ca</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN></P>
</BODY>
</HTML>