     parentPath.pop()
     return parentPath.join('/')
 
+  removeBrokenSymlinksUnder:(path)->
+    kiteController = KD.getSingleton('kiteController')
+    escapeFilePath = FSHelper.escapeFilePath
+    kiteController.run "stat #{escapeFilePath path}", (err)->
+      if not err
+        kiteController.run "find -L #{escapeFilePath path} -type l -delete", noop
+
+  wait: (duration, fn) ->
+    if "function" is typeof duration
+      fn = duration
+      duration = 0
+    setTimeout fn, duration
+
   defer:do ->
     # this was ported from browserify's implementation of "process.nextTick"
     queue = []

      suffix    = options.suffix     ? '...'

      longTextLength  = Encoder.htmlDecode(longText).length
      # longTextLength  = longText.length

      return longText if longTextLength < minLength or longTextLength < maxLength


      (fn) -> queue.push fn; window.postMessage "kd-tick", "*"
    else
      (fn) -> setTimeout fn, 1

  killWait:(id)-> clearTimeout id

