1
0

Path fixes

This commit is contained in:
Scott E. Graves
2017-03-23 01:09:08 -05:00
parent d0b43261ed
commit 7d7ae6d886
5 changed files with 24 additions and 13 deletions

View File

@@ -221,7 +221,7 @@ private:
else // File (cache and/or Sia operation)
{
// Formulate Sia path and cache path
SString siaPath = CSiaApi::FormatToSiaPath(FilePath(FileName).RemoveFileName()); // Strip drive letter to get Sia path
SString siaPath = CSiaApi::FormatToSiaPath(FilePath(FileName).SkipRoot()); // Strip drive letter to get Sia path
if (siaPath.Length())
{
// If cache file already exists and is a directory, requested file operation isn't valid
@@ -393,19 +393,18 @@ private:
auto siaFileTree = _siaFileTree;
if (siaFileTree)
{
SString siaQuery = CSiaApi::FormatToSiaPath(FilePath(FileName).RemoveFileName());
SString siaQuery = CSiaApi::FormatToSiaPath(FilePath(FileName).SkipRoot());
FilePath cachePath;
FilePath cachePath = GetCacheLocation();;
FilePath rootPath = siaQuery;
if (FilePath::DirSep == FileName)
{
cachePath = GetCacheLocation();
siaQuery += L"/*.*";
}
else
{
cachePath.Append(&FileName[1]);
if (::GetFileAttributes(&cachePath[0]) & FILE_ATTRIBUTE_DIRECTORY)
if (cachePath.IsDirectory())
{
siaQuery += L"/*.*";
}