Example #1
0
        static void Main(string[] args)
        {
            var source = new DirectoryInfo(@"/mnt/virtual/shareroot/ToSort/TestRarring/SourceFolder/");
            var target = new DirectoryInfo(@"/mnt/virtual/shareroot/ToSort/TestRarring/TargetFolder/");
            var targetName = "RarFilename";

            var rarWrapper = new RarWrapper(5);

            rarWrapper.Compress(source, target, targetName, 15*1000*1000);

            #if DEBUG       //VS does not halt after execution in debug mode.
            Console.WriteLine("Finished");
            Console.ReadKey();
            #endif
        }
Example #2
0
        private void MakeRarAndParFiles(FileSystemInfo toPost, String nameWithoutExtension,
            DirectoryInfo processedFolder, String password)
        {
            Int64 size = toPost.Size();
            var rarSizeRecommendation = configuration.RarNParSettings
                .Where(rr => rr.FromSize < size)
                .OrderByDescending(rr => rr.FromSize)
                .First();
            var rarWrapper = new RarWrapper(configuration.InactiveProcessTimeout, configuration.RarLocation);
            rarWrapper.Compress(
                toPost,
                processedFolder,
                nameWithoutExtension,
                Settings.DetermineOptimalRarSize(rarSizeRecommendation.RarSize,
                    configuration.YEncLineSize, configuration.YEncLinesPerMessage),
                password);

            var parWrapper = new ParWrapper(configuration.InactiveProcessTimeout, configuration.ParLocation);
            parWrapper.CreateParFilesInDirectory(
                processedFolder, nameWithoutExtension, configuration.YEncPartSize, rarSizeRecommendation.Par2Percentage);
        }
Example #3
0
        private void MakeRarAndParFiles(FileSystemInfo toPost, String nameWithoutExtension,
            DirectoryInfo processedFolder)
        {
            Int64 size = toPost.Size();
            var rarSizeRecommendation = configuration.RecommendationMap
                .Where(rr => rr.FromFileSize < size)
                .OrderByDescending(rr => rr.FromFileSize)
                .First();
            var rarWrapper = new RarWrapper(configuration.InactiveProcessTimeout, configuration.RarLocation);
            rarWrapper.Compress(
                toPost, processedFolder, nameWithoutExtension, rarSizeRecommendation.ReccomendedRarSize);

            var parWrapper = new ParWrapper(configuration.InactiveProcessTimeout, configuration.ParLocation);
            parWrapper.CreateParFilesInDirectory(
                processedFolder, nameWithoutExtension, configuration.YEncPartSize, rarSizeRecommendation.ReccomendedRecoveryPercentage);
        }