function file = dump_module(fileName,file,objectId,location)

   switch(location)
   case 'source'
      isSource = 1;
   case 'header'
      isSource = 0;
   otherwise
      error('why');
   end
   
   fclose(file);
   sf('Cg','dump_module',fileName,objectId,isSource);
   file = fopen(fileName,'At');
   if file<3
       construct_coder_error([],getString(message('Stateflow:sfprivate:error_FailedToCreateFile',fileName)),1);
       return;
   end             
   return;  
   
