mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
34 lines
670 B
C#
34 lines
670 B
C#
|
|
using System.IO;
|
|||
|
|
using SabreTools.Helper;
|
|||
|
|
|
|||
|
|
namespace SabreTools
|
|||
|
|
{
|
|||
|
|
public class TGZTest
|
|||
|
|
{
|
|||
|
|
public static void Main(string[] args)
|
|||
|
|
{
|
|||
|
|
Logger logger = new Logger(true, "tgztest.log");
|
|||
|
|
logger.Start();
|
|||
|
|
|
|||
|
|
foreach (string arg in args)
|
|||
|
|
{
|
|||
|
|
string temparg = arg.Replace("\"", "").Replace("file://", "");
|
|||
|
|
|
|||
|
|
if (File.Exists(temparg))
|
|||
|
|
{
|
|||
|
|
ArchiveTools.WriteTorrentGZ(temparg, "tgz", logger);
|
|||
|
|
}
|
|||
|
|
else if (Directory.Exists(temparg))
|
|||
|
|
{
|
|||
|
|
foreach (string file in Directory.EnumerateFiles(temparg, "*", SearchOption.AllDirectories))
|
|||
|
|
{
|
|||
|
|
ArchiveTools.WriteTorrentGZ(file, "tgz", logger);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
logger.Close();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|