View Single Post
  #5  
Old 05-09-2018, 10:43 AM
gmatelich's Avatar
gmatelich gmatelich is offline
Registered User
 
Join Date: Oct 2002
Location: Bellevue, WA, USA
Posts: 396
Re: Super Fast Autosave

AutoSaveBaseline is looking pretty good
Code:
(defun AutoSaveBaseline ()
  (setf *AutoSaveBaseLocation* (format nil "~AAutosave/~A" (sd-inq-temp-dir) (get-universal-time)))						;Establish autosave location
  (sd-make-directory *AutoSaveBaseLocation*)																			;Create autosave location
  (sd-display-alert "Beginning Autosave" :icon :info :auto-close-time 5)												;Popup toast warning user what's up
  (sd-with-current-working-directory *AutoSaveBaseLocation*																;Remember CWD, change dir, run these things, revert to CWD
    (save_sd :OVERWRITE :CWD_CHANGED :SELECT :all_at_top) 																;Save all items using .sd format 
    (sd-sys-background-job (format nil "xcopy ..\\~A ..\\~ABaseCopy /I" (subseq valve::*AutoSaveBaseLocation* (- (length valve::*AutoSaveBaseLocation*) 10)) (subseq valve::*AutoSaveBaseLocation* (- (length valve::*AutoSaveBaseLocation*) 10))))
    (sd-display-alert (format nil "Autosaved to ~A" *AutoSaveBaseLocation*) :icon :info :auto-close-time 5)						;Popup toast showing location saved to
  )
)
Reply With Quote