hooks call order and hooks dependency I try to implement hook_menu() in a module and the code inside of this hook depends on another hook implemented in the same module Example:

function mymodule_menu() {
   $streamwrapper = file_stream_wrapper_get_instance_by_scheme('myscheme');
   if($streamwrapper !== false) {
      $directory = $streamwrapper-&gt;getDirectoryPath();
       .....
   }
}


and another hook function in the same (mymodule) module

function mymodule_stream_wrappers() {
  retunr array( 'myscheme' =&gt; array(...)
}


Apparently, hook_stream_wrappers() is called after hook_menu(), and file_stream_wrapper_get_instance_by_scheme() returns false during module installation process. 

So, the whole idea works because Drupla will call hook_menu eventually and by that time stream wrapper will be in place and ready, but it seems too unreliable, IMHO. 

Anyway, is it possible to control hooks order somehow? Or is there a better way to achieve desired result - retrieve stream wrapper in hook_menu after is has been known by the system?
Your problem is actually the opposite of what you're thinking. A call to file_stream_wrapper_get_instance_by_scheme triggers hook_stream_wrappers() if it hasn't been called already.

However, the problem is that the stream wrapper hook was already called before your module was enabled and the information from that is statically cached. So you need to clear the static cache to get your own stream wrapper:

drupal_static_reset('file_get_stream_wrappers');