[Typo3-dev] create folders on filesystem recursively

franz ripfel typo3 at abezet.de
Wed Jun 29 10:43:10 CEST 2005


Hi all,

i searched for a function in TYPO3 to export special data from the  
pagetree into a folder structure according to the pagetree.
I found only the t3lib_div::mkdir($strPath), which allows to create one  
new folder in the current folder.

If you need similar functionality with missing levels on your filesystem  
(e.g. exporting) you could use a function like this:

/**
  * creates missing folders for given path recursively
  *
  * @param	string		absolute path for needed folder
  * @return	boolean
  */
function mkdirs($strPath) {
   if (is_dir($strPath)) return true;
   $pStrPath = dirname($strPath);
   if (!$this->mkdirs($pStrPath)) return false;
   return t3lib_div::mkdir($strPath);
}

does it make sense to add this functionality on to t3lib_div or some other  
class?

best wishes

Franz




More information about the TYPO3-dev mailing list