Esempio n. 1
0
        static void MoveBackups(string src, string dst)
        {
            for (int i = 1; ; i++)
            {
                string oldDir = LevelInfo.BackupPath(src, i.ToString());
                string newDir = LevelInfo.BackupPath(dst, i.ToString());

                if (File.Exists(oldDir + src + ".lvl"))
                {
                    Directory.CreateDirectory(newDir);
                    File.Move(oldDir + src + ".lvl", newDir + dst + ".lvl");
                    if (DirectoryEmpty(oldDir))
                    {
                        Directory.Delete(oldDir);
                    }
                }
                else
                {
                    if (DirectoryEmpty(Server.backupLocation + "/" + src + "/"))
                    {
                        Directory.Delete(Server.backupLocation + "/" + src + "/");
                    }
                    break;
                }
            }
        }