news
About Elegant Chaos
info
About me and my friends
people
Software from Elegant Chaos
software
Other stuff...
stuff

BL_AttemptBackup

Revision
Revised on

Description


Code

on BL_AttemptBackup
  -- try to backup the current stack, and a random library
  
  global BL_ConfirmBackups, BL_BackupDelay, BL_NextBackup
  global BL_LibraryToBackup
  
  -- calculate filenames needed
  put BL_PathForBackup() into backupPath
  if backupPath is not empty then
    set cursor to watch
    
    -- backup this stack
    if BL_OKToBackup(the short name of this stack) then
      BL_BackupStack FL_StackPath(),backupPath
    end if
    
    -- get list of libraries and other stacks in use
    put the stacks into libraries
    delete line 1 of libraries
    put the stacksInUse after libraries
    
    -- back up one of them too
    get the number of lines in libraries
    add 1 to BL_LibraryToBackup
    if BL_LibraryToBackup > it then
      put 1 into BL_LibraryToBackup
    end if
    get line BL_LibraryToBackup of libraries
    if BL_OKToBackup(it) then
      BL_BackupStack FL_StackPath(it),backupPath
    end if
  end if
  BL_SetNextBackup
  
end BL_AttemptBackup