         replica-accessors (vec (map (fn [n] (let [file-path (str base-path n ".dat")
                                                   file-ins (File. file-path)]
                                               (when-not (.exists file-ins) (.createNewFile file-ins))
-                                              (BufferedRandomAccessFile. file-path "rw")))
+                                              (BufferedRandomAccessFile. file-path "rw" (Trunk/getSegSize))))
                                      (range trunks)))
-        ;log-appenders (vec (map (fn [n] (atom (io/output-stream
-        ;                                        (str base-path n "-" timestamp ".mlog"))))
-        ;                         (range trunks)))
         sync-timestamps (vec (map (fn [_] (atom 0)) (range trunks)))
         log-switches (vec (map (fn [_] (ReentrantLock.)) (range trunks)))
         pending-chan (a/chan 500)

  (reset! defed-path path)
  (reset! data-path (str path "/" start-time "/"))
  (when keep-imported? (remove-imported @data-path))
  (println "Starting backup server at:" @data-path)
  #_(a/go-loop [] (apply collect-log (a/<! pending-logs))))

(defn convert-server-name-for-file [^String str] (.replace str ":" "-"))


           (java.util UUID)
           (java.util.concurrent.locks ReentrantLock)
           (java.io OutputStream File DataOutputStream)
           (org.apache.commons.io FileUtils)
           (org.shisoft.neb Trunk)))

(def start-time (System/currentTimeMillis))
(def data-path (atom nil))
