<html><head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="FileUtil" rel="Chapter" href="FileUtil.html"> <link title="FileUtilStr" rel="Chapter" href="FileUtilStr.html"> <link title="FilePath" rel="Chapter" href="FilePath.html"><title>FileUtil.int_of_permission</title> </head> <body> <code class="code"><span class="keyword">let</span> int_of_permission pr =<br> <span class="keyword">let</span> permission_int = [ <br> (pr.user.sticky, 0o4000);<br> (pr.user.exec, 0o0100);<br> (pr.user.write, 0o0200);<br> (pr.user.read, 0o0400);<br> (pr.group.sticky, 0o2000);<br> (pr.group.exec, 0o0010);<br> (pr.group.write, 0o0020);<br> (pr.group.read, 0o0040);<br> (pr.other.sticky, 0o1000);<br> (pr.other.exec, 0o0001);<br> (pr.other.write, 0o0002);<br> (pr.other.read, 0o0004)<br> ]<br> <span class="keyword">in</span><br> <span class="constructor">List</span>.fold_left (<span class="keyword">fun</span> full_perm (b,perm) <span class="keywordsign">-></span> <br> <span class="keyword">if</span> b <span class="keyword">then</span> <br> perm <span class="keyword">lor</span> full_perm <br> <span class="keyword">else</span> <br> full_perm) <br> 0o0000 permission_int</code></body></html>