def command_mkdir(args):
 errors = 0
 for directory in args.dirs:
  if os.path.exists(directory):
   if (not os.path.isdir(directory)):
    sys.stdout.write(('mkdir: %s\n' % directory))
    sys.stdout.write('ERROR: Exists already, but as file...\n')
    errors += 1
  else:
   assert (not os.path.isdir(directory))
   sys.stdout.write(('mkdir: %s\n' % directory))
   os.makedirs(directory)
 return errors

def command_mkdir ( args ) : errors = 0 for directory in args . dirs : if os . path . exists ( directory ) : if ( not os . path . isdir ( directory ) ) : sys . stdout . write ( ( 'mkdir: %s\n' % directory ) ) sys . stdout . write ( 'ERROR: Exists already, but as file...\n' ) errors += 1 else : assert ( not os . path . isdir ( directory ) ) sys . stdout . write ( ( 'mkdir: %s\n' % directory ) ) os . makedirs ( directory ) return errors
create a non-existing directory .