anchor.diff:      }
   
       return result;
  +  }
   
  +  static bool checkDirExistsSync(String path, {bool createWhenNotExist: false}) {
  +    bool result = false;
  +    Directory dir = new Directory(path);
  +
  +    if (!dir.existsSync() && createWhenNotExist) {
  +      try {
  +        dir.createSync(recursive: true);
  +        result = true;
  +      } catch(e) {
  +        PinLogger.instance.warning('[PinUtility] checkDirExistsSync: Create dir failed: ${path} with Exception: ${e}');
  +      }
  +    } else {
  +      result = true;
  +    }
  +
  +    return result;
  +  }
  +
  +  static Future<bool> createDir(String path) {
  +    final completer = new Completer();
  +    Directory dir = new Directory(path);
  +
  +    dir.exists().then((bool exists) {
  +      if (exists) {
  +        completer.complete(true);
  +      } else {
  +        dir.create(recursive: true).then(() {
  +          completer.complete(true);
  +        }).catchError((e) {
  +          handleError(e);
  +          completer.complete(false);
  +        });
  +      }
  +    });
  +  }
  +
  +  static void handleError(e) {
  +    PinLogger.instance.shout('Error: ${e}');
     }
   
   }
positive.code:     if (file.existsSync()) {
        fileContent = new File(path).readAsStringSync();
      } else {
        PinLogger.instance.warning('[PinUtility] readJsonFileSync: Target file does not exist or is not file: {$path}');
      }
  
      if (fileContent.isNotEmpty) {
        try {
          data = JSON.decode(fileContent);
        } catch (e) {
          PinLogger.instance.shout('[PinUtility] readJsonFileSync: Error in JSON parsing file: {$path}, content: {$fileContent}');
        }
      }
  
      return data;
    }
  
    static Future<File> writeJsonFile(String path, Object json) {
      final completer = new Completer();
      String jsonStr = '';
  
      try {
        jsonStr = JSON.encode(json);
      } catch (e) {
        PinLogger.instance.shout('[PinUtility] writeJsonFile: Error in encoding JSON obj: {$json}');
        completer.complete(null);
      }
  
  
negative.code:   static void setCwdToRoot([String relative = '']) {
      String root = LibPath.join(LibPath.dirname(Platform.script.toFilePath()), relative);
  
      PinLogger.instance.fine('[PinUtility] Set "Directory.current" to: ${root}');
  
      Directory.current = root;
    }
  