[TYPO3-dev] mkdir and mkdir_deep

Jigal van Hemert jigal at xs4all.nl
Mon Feb 20 14:08:35 CET 2012


Hi,

On 20-2-2012 13:06, Oliver Salzburg wrote:
> So t3lib_div.mkdir doesn't seem to provide recursive folder generation
> at all. So that is out of the question. t3lib_div.mkdir_deep sounds
> exactly like what I need.
>
> But why do I need to supply 2 directories? And the first directory is
> the "base" and it *has* to exist? So I need to split up the path that I
> want, make sure the first part of that split is already existing and
> then pass both parts to mkdir_deep()? That can't be right.

t3lib_div::mkdir_deep() is what you're looking for.
The first parameter is the directory path you want to create.
The second parameter is optional and kept for backwards compatibility (= 
it was used in the past but we don't want to break code which still uses it)

The difference with PHP mkdir is that the TYPO3 version not only sets 
the mask to the value in the Install Tool ['BE']['folderCreateMask'], 
but also makes sure the group is set to the Install Tool setting 
['BE']['createGroup'].

Just use t3lib_div::mkdir_deep() and forget about the second parameter.

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert.



More information about the TYPO3-dev mailing list