How to create a directory during a module install? I need to create a directory in public:// when the module is installed via file_prepare_directory(). I used this code in function mymodule_install():

$mydir = 'public://mydir';  
file_prepare_directory($mydir, FILE_CREATE_DIRECTORY);` 


Upon uninstalling, clear the cache, and installing the module it does not create mydir.
Are you sure the directory where you are creating directory is writable? 

file_prepare_directory checks that the directory exists and is writable.
You can try drupal_mkdir statement to create directory in hook_install