mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ArchiveTools, TGZTest] Correct TGZ write, add test project (temp)
This commit is contained in:
33
TGZTest/TGZTest.cs
Normal file
33
TGZTest/TGZTest.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user