Hi!!
I'm developing a module, i create my files without any problem, but i'd like create folders into my private area. My code in order to create files are:
$fs = get_file_storage();
$contextuser = context_user::instance($USER->id);
// Prepare file record object
$fileinfo = array(
'contextid' => $contextuser->id, // ID of context
'component' => 'user', // usually = table name
'filearea' => 'private', // usually = table name
'itemid' => 0, // usually = ID of row in table
'filepath' => '/', // any path beginning and ending in /
'filename' => $filename); // any filename
$fs->create_file_from_string($fileinfo, $content);
I have read that if you want a directory 'filename' must be '.' .
Thanks in advance