<?xml version="1.0"?><phpdoc><class name="Bs_Dir" extends="Bs_FileSystem" undoc="false" access="private" package="file"><file>C:/usr/local/lib/php/blueshoes-4.2/core/file/Bs_Dir.class.php</file><doc><author>andrej arn &amp;lt;andrej at blueshoes dot org&amp;gt;</author><author>sam blume &amp;lt;sam at blueshoes dot org&amp;gt;</author><inherited src="Array"/><overriden src="Array"/><description>dependencies: bs_filesystem,bs_file (may be used for returning in getFileList())</description><shortdescription>Directory Class.</shortdescription><version>4.0-$id$</version><copyright>blueshoes.org</copyright></doc><function name="Bs_Dir" undoc="false" access="public"><doc><parameter name="$workingDir" default="NULL" type="string">(default=&amp;quot;&amp;quot;). The path to a file or dir.</parameter><return type="void"/><description>NOTE: Fullpath may be of any format. E.g. dir, dir/, dir/file, ./dir/dir/file, /dir ...crap is: if setFullPath in here fails, then you won&amp;apos;t know. so if you want to be surethen you better call the constructor without params and then do setFullPath() yourself.</description><shortdescription>Constructor.</shortdescription></doc></function><function name="setFullPath" undoc="true" access="public"><doc><parameter name="$workingDir" type="string">a path</parameter><return name="" type="bool"/><overriden src="Bs_FileSystem"/><description>If it&amp;apos;s not the same dir as we were looking at before, free the resourcesand open a new view to the new dir.uses parent method.</description><shortdescription>Set our view to the directory passed by &amp;apos;$workingDir&amp;apos;.</shortdescription></doc></function><function name="mkpath" undoc="false" access="public"><doc><parameter name="$path" type="string"/><return name="" type="bool"> (TRUE on success, FALSE on failure.)</return><description>example: mkpath(&amp;apos;c:/your/path/whatever&amp;apos;);even if c:\your already exists, but not path/whatever.you can use foreslashes or backslashes.got this from: http://www.php.net/manual/en/function.mkdir.phporiginal name: ForceDirectories()gjukema@jukeware.com 22-Jan-2001 06:40I needed a clean ForceDirectories function as used in Delphi.  I grabbedthe source and converted to PHP.  Just pass in a $path like&amp;quot;/tmp/dir1/dir2&amp;quot;, and all &amp;quot;/tmp/dir1/dir2&amp;quot; will becreated if they don&amp;apos;t exist - permissions allowed of coarse :).if the method fails, not everything (maybe parts) has been created.errors are suppressed.</description><shortdescription>creates the given path, not just the last directory.</shortdescription></doc></function><function name="_open" undoc="false" access="private"><doc><see type="function">dir()</see><return name="" type="boolean">TRUE on success; FALSE otherwise</return><description>closes a previously opened one before, no matter if this method succeeded or not.</description><shortdescription>Open a PHP&amp;apos;s pseudo-Directory-Object used to scan the file system.</shortdescription></doc></function><function name="_close" undoc="false" access="private"><doc><see type="function">dir()</see><return type="void"/><description/><shortdescription>Try to close the PHP&amp;apos;s pseudo-Directory-Object used to scan the file system</shortdescription></doc></function><function name="getFileList" undoc="false" access="public"><doc><parameter name="$params" default="array()" type="array">a hash than can have these elements:&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;fullPath&amp;apos;]    =&amp;gt; string Starting point. The absolute path. Default: $this-&amp;gt;_fullPath&#x0a;If *NOT* set we take the fullPath of this object (if given). Otherwise we throw an exception.&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;regFunction&amp;apos;] =&amp;gt; (&amp;apos;ereg&amp;apos;|&amp;apos;preg_match&amp;apos;)  Default: &amp;apos;ereg&amp;apos;.&#x0a;You may set the PHP regex-function to use. Just pass function name as string.&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;regEx&amp;apos;]       =&amp;gt; regEx-string   Default: &amp;apos;&amp;apos;;&#x0a;The regular expresion is matched with the found file names without path by default.&#x0a;If you want the path to be part of the match used the next param [&amp;apos;regWhere&amp;apos;].&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;regWhere&amp;apos;]    =&amp;gt; (&amp;apos;file&amp;apos;|&amp;apos;dir&amp;apos;)  Default: &amp;apos;file&amp;apos;.&#x0a;See [&amp;apos;regEx&amp;apos;] above&#x0a;file = use reg expression on file only&#x0a;dir  = use reg expression on whole path&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;depth&amp;apos;]        =&amp;gt; int  Default: BS_DIR_UNLIM_DEPTH.&#x0a;How many directory levels the Dir should follow.&#x0a;0 = Do not follow any dir. (= Use only current dir given by the path).&#x0a;n = Go max n levels in depth.&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;fileDirLink&amp;apos;]  =&amp;gt; hash of flags. Default: all flags are set to TRUE (&amp;apos;file&amp;apos;=&amp;gt;TRUE, &amp;apos;dir&amp;apos;=&amp;gt;TRUE, &amp;apos;filelink&amp;apos;=&amp;gt;TRUE, &amp;apos;dirlink&amp;apos;=&amp;gt;TRUE)&#x0a;Control if files and/or dirs are to be fetched.&#x0a;! On iX mashines (NOT on Windows) you can also fetch file-LINKS and/or dir-LINKS.&#x0a;E.g. passing $params[&amp;apos;fileDirLink&amp;apos;] = array(&amp;apos;dir&amp;apos;=&amp;gt;FALSE) would ignor dirs.&#x0a;[&amp;apos;fileDirLink&amp;apos;][&amp;apos;file&amp;apos;]     : real files    [&amp;apos;fileDirLink&amp;apos;][&amp;apos;dir&amp;apos;]     : file links&#x0a;[&amp;apos;fileDirLink&amp;apos;][&amp;apos;filelink&amp;apos;] : real dirs     [&amp;apos;fileDirLink&amp;apos;][&amp;apos;dirlink&amp;apos;] : dir links&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;followLinks&amp;apos;]  =&amp;gt; bool   Default: FALSE (Only iX mashines NOT available on Windows)&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;sort&amp;apos;]         =&amp;gt; bool   Default: FALSE&#x0a;Sort the files and dirs that are returnd. You may wish to turn this feature&#x0a;on but it will use CPU (Tested with 3000 files: With sort it&amp;apos;s 4x slower)&#x0a;-----------------------------------------------------------------------------------------------------&#x0a;[&amp;apos;returnType&amp;apos;]   =&amp;gt; (&amp;apos;fullpath&amp;apos;|&amp;apos;subpath&amp;apos;|&amp;apos;nested&amp;apos;|&amp;apos;fulldir/file&amp;apos;|&amp;apos;subdir/file&amp;apos;|&amp;apos;subdir/file2&amp;apos;|&amp;apos;object&amp;apos;)&#x0a;Default: &amp;apos;fullpath&amp;apos;&#x0a;Control how to format the return.&#x0a;Sample:    /root&#x0a;------        +-/subdir            &amp;lt;--- starting Dir&#x0a;|  + A.txt&#x0a;|  + B.txt&#x0a;+--/emptydir&#x0a;&#x0a;NOTE: return order is system dependent!! DON&amp;apos;T look at order !!&#x0a;&#x0a;[&amp;apos;fullpath&amp;apos;]     : return a vector filled with fullPath&amp;apos;s + files e.g.&#x0a;[0] =&amp;gt; &amp;apos;/root/subdir/&amp;apos;&#x0a;[1] =&amp;gt; &amp;apos;/root/subdir/A.txt&amp;apos;&#x0a;[2] =&amp;gt; &amp;apos;/root/subdir/B.txt&amp;apos;&#x0a;[3] =&amp;gt; &amp;apos;/root/subdir/emptydir/&amp;apos;&#x0a;[&amp;apos;subpath&amp;apos;]      : return a vector filled with rel-paths (relative from the current path) to the files and dirs.&#x0a;[0] =&amp;gt; &amp;apos;subdir/&amp;apos;&#x0a;[1] =&amp;gt; &amp;apos;subdir/A.txt&amp;apos;&#x0a;[2] =&amp;gt; &amp;apos;subdir/B.txt&amp;apos;&#x0a;[3] =&amp;gt; &amp;apos;subdir/emptydir/&amp;apos;&#x0a;[&amp;apos;nested&amp;apos;]       : return a nested hash. the key is always the fullpath, the value is false for files and a hash for dirs&#x0a;[&amp;apos;subdir&amp;apos;] =&amp;gt; [A.txt]  =&amp;gt; FALSE&#x0a;[B.txt]  =&amp;gt; FALSE&#x0a;[&amp;apos;emptydir&amp;apos;] =&amp;gt; array()&#x0a;[&amp;apos;nested2&amp;apos;]       : return a nested hash. the key is always the subpath, the value is false for files and a hash for dirs&#x0a;[&amp;apos;subdir&amp;apos;] =&amp;gt; [0]      =&amp;gt; &amp;apos;A.txt&amp;apos;&#x0a;[1]      =&amp;gt; &amp;apos;B.txt&amp;apos;&#x0a;[&amp;apos;emptydir&amp;apos;] =&amp;gt; array()&#x0a;[&amp;apos;fulldir/file&amp;apos;] : return a vector filled with a 2-key hash : &amp;apos;dir&amp;apos; and &amp;apos;file&amp;apos;&#x0a;[0] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;/root/subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;&amp;apos;)&#x0a;[1] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;/root/subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;A.txt&amp;apos;)&#x0a;[2] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;/root/subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;B.txt&amp;apos;)&#x0a;[3] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;/root/subdir/emptydir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;&amp;apos;)&#x0a;[&amp;apos;subdir/file&amp;apos;]  : return a vector filled with a 2-key hash : &amp;apos;dir&amp;apos; and &amp;apos;file&amp;apos;&#x0a;[0] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;&amp;apos;)&#x0a;[1] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;A.txt&amp;apos;)&#x0a;[2] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;B.txt&amp;apos;)&#x0a;[3] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;subdir/emptydir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;&amp;apos;)&#x0a;[&amp;apos;subdir/file2&amp;apos;] : return a vector filled with a 2-key hash : &amp;apos;dir&amp;apos; and &amp;apos;file&amp;apos;&#x0a;Same as [&amp;apos;subdir/file&amp;apos;] but when a dir is found, the last path part is stored in &amp;apos;file&amp;apos; also.&#x0a;[0] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;&amp;apos;,        &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;subdir&amp;apos;)&#x0a;[1] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;A.txt&amp;apos;)&#x0a;[2] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;B.txt&amp;apos;)&#x0a;[3] =&amp;gt; (&amp;apos;dir&amp;apos;=&amp;gt;&amp;apos;subdir/&amp;apos;, &amp;apos;file&amp;apos;=&amp;gt;&amp;apos;emptydir&amp;apos;)&#x0a;[&amp;apos;object&amp;apos;]       : return a vector holding objects of Bs_File and Bs_Dir&#x0a;[0] =&amp;gt; new Bs_Dir(&amp;apos;/root/subdir/&amp;apos;)&#x0a;[1] =&amp;gt; new Bs_File(&amp;apos;/root/subdir/A.txt&amp;apos;)&#x0a;[2] =&amp;gt; new Bs_File(&amp;apos;/root/subdir/B.txt&amp;apos;)&#x0a;[3] =&amp;gt; new Bs_Dir(&amp;apos;/root/subdir/emptydir/&amp;apos;)</parameter><return type="void"/><throws>exception</throws><description>calls itself recursively.To set the start dir use the [&amp;apos;fullPath&amp;apos;]. If omitted the start dir is the dirthis object is currently pointing at. ( See $this-&amp;gt;setFullPath() )The other fields are all optional. See the defaults in the text below.</description><shortdescription>Get a list of files and dirs.</shortdescription></doc></function><function name="emptyDir" undoc="false" access="public"><doc><parameter name="$recursive" default="FALSE," type="string">(default is FALSE)</parameter><parameter name="$regExp" default="NULL" type="string">(if given then the files need to match (perl-style) regExp in order to be deleted.)</parameter><return name="" type="bool">TRUE </return><throws>bs_exception</throws><description>links won&amp;apos;t be followed, but deleted.$Bs_Dir-&amp;gt;emptyDir() will give the same result as &amp;quot;rm *&amp;quot; in linux.</description><shortdescription>removes files from the directory. keeps the directory.</shortdescription></doc></function><function name="destruct" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="dir" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="clearCache" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="getFreeDiskSpace" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="rm" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="isEmpty" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="cp" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="mv" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="create" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="search" undoc="true" access="private"><doc><return type="void"/></doc></function><function name="searchAndReplace" undoc="true" access="private"><doc><return type="void"/></doc></function><variable name="$_dirObj" access="private" type="unknown"><doc><description/><shortdescription>PHP&amp;apos;s pseudo-Directory-Object used to scan the file system.</shortdescription></doc></variable><constant name="BS_DIR_VERSION" undoc="true" access="private" case="default: case sensitive">4.0.$x$<doc></doc></constant><constant name="BS_DIR_UNLIM_DEPTH" undoc="true" access="private" case="default: case sensitive">-99<doc></doc></constant><inherited src="Bs_FileSystem" type="functions"><element>bs_filesystem</element><element>getfileattr</element><element>standardizepath</element><element>getcwd</element><element>getrealpath</element><element>realpath</element><element>getrealpathsplit</element><element>realpathsplit</element><element>getfullpath</element><element>getpathstem</element><element>getfilename</element><element>getfileextension</element><element>basename</element><element>isvalidfilename</element><element>isvalidpath</element><element>isvalidfullpath</element><element>islink</element><element>clearstatcache</element><element>move</element></inherited><inherited src="Bs_Object" type="functions"><element>isex</element><element>isexception</element><element>tostring</element><element>tohtml</element><element>persist</element><element>unpersist</element><element>bs_object</element><element>bbsetoutput</element><element>bbawake</element><element>bbisawake</element><element>bbxmsg</element><element>bbxfunctionstart</element><element>bbxfunctionend</element><element>bbxecho</element><element>bbxvar</element><element>bbxvardump</element><element>bbforcetrace</element><element>bbbufferstart</element><element>bbbufferget</element><element>bbbufferendflush</element><element>bbbufferendclean</element></inherited><inherited src="Bs_FileSystem" type="variables"><element>$_lastfetchedpath</element><element>$_bs_system</element><element>$_fullpath</element><element>$_lastfetchedfileattr</element></inherited><inherited src="Bs_FileSystem" type="consts"><element>bs_filesystem_version</element></inherited><inherited src="Bs_Object" type="consts"><element>bs_object_version</element></inherited><path><parent>Bs_FileSystem</parent><parent>Bs_Object</parent></path><baseclass>Bs_Object</baseclass></class></phpdoc>