             filesystems (map (fn [name] (vfs/make-filesystem system name))
                              (sys/get-filesystems-for-section system section))]
         (->FSWorkerService rmq-settings rmq-prefix filesystems (:thread-pool system))))))
-



(defn entry-is-type-ok?
  [type entry]
  (and
   (not (:error entry))
   (= (get-in entry [:stat :type]) type)))

(def entry-is-directory-ok? (partial entry-is-type-ok? "directory"))
(def entry-is-file-ok? (partial entry-is-type-ok? "file"))


(defn assoc-permissions-for-entry
  [fs directory {relpath :relpath :as entry}]
  (assoc entry "permissions"
         (vfs/get-permissions fs (vfs/join fs [directory relpath]))))


(defn safe-assoc-permissions-for-file-entry
  [fs directory entry]
  (if (entry-is-file-ok? entry)
    (try
      (assoc-permissions-for-entry fs directory entry)
      (catch Exception err
        (if (vfs/access-denied-exception? fs err)
          nil
          (assoc entry
            :error (str err)))))
    entry))



(defn get-permissions
  [fs directory entries]
  (remove nil?
          (map

            [brainbot.nozzle.inihelper :as inihelper]
            [brainbot.nozzle.dynaload :as dynaload]
            [brainbot.nozzle.worker :as worker]
            [brainbot.nozzle.sys :as sys])
  (:require [langohr.basic :as lb]
            [langohr.shutdown :as lshutdown]
            [langohr.exchange  :as le]
