Very early SevenZip WIP version

This commit is contained in:
gjefferyes
2015-03-18 08:48:48 -05:00
parent 7830068257
commit 5d9d63fb08
55 changed files with 9683 additions and 3477 deletions

View File

@@ -0,0 +1,31 @@
using System;
using TrrntSevenZip.IO;
namespace TrrntSevenZip.SupportedFiles
{
public static class DirUtil
{
public static void CreateDirForFile(string sFilename)
{
string strTemp = Path.GetDirectoryName(sFilename);
if (String.IsNullOrEmpty(strTemp)) return;
if (Directory.Exists(strTemp)) return;
while (strTemp.Length > 0 && !Directory.Exists(strTemp))
{
int pos = strTemp.LastIndexOf(Path.DirectorySeparatorChar);
if (pos < 0) pos = 0;
strTemp = strTemp.Substring(0, pos);
}
while (sFilename.IndexOf(Path.DirectorySeparatorChar, strTemp.Length + 1) > 0)
{
strTemp = sFilename.Substring(0, sFilename.IndexOf(Path.DirectorySeparatorChar, strTemp.Length + 1));
Directory.CreateDirectory(strTemp);
}
}
}
}