no dir creation at getting info

This commit is contained in:
2018-07-30 09:41:41 +02:00
parent 0b268d0289
commit 119d772ec4

View File

@ -36,12 +36,15 @@ namespace Yavsc.ViewModels.UserFiles
dInfo = new DirectoryInfo(
userReposPath+FileSystemConstants.RemoteDirectorySeparator+finalPath);
if (!dInfo.Exists) dInfo.Create();
Files = dInfo.GetFiles().Select
( entry => new RemoteFileInfo { Name = entry.Name, Size = entry.Length,
CreationTime = entry.CreationTime, LastModified = entry.LastWriteTime }).ToArray();
SubDirectories = dInfo.GetDirectories().Select
( d=> new DirectoryShortInfo { Name= d.Name, IsEmpty=false } ).ToArray();
if (dInfo.Exists) {
Files = dInfo.GetFiles().Select
( entry => new RemoteFileInfo { Name = entry.Name, Size = entry.Length,
CreationTime = entry.CreationTime, LastModified = entry.LastWriteTime }).ToArray();
SubDirectories = dInfo.GetDirectories().Select
( d=> new DirectoryShortInfo { Name= d.Name, IsEmpty=false } ).ToArray();
}
}
}