in simpleProviderManaged/SimpleProvider.cs [208:249]
protected IEnumerable<ProjectedFileInfo> GetChildItemsInLayer(string relativePath)
{
string fullPathInLayer = GetFullPathInLayer(relativePath);
DirectoryInfo dirInfo = new DirectoryInfo(fullPathInLayer);
if (!dirInfo.Exists)
{
yield break;
}
foreach (FileSystemInfo fileSystemInfo in dirInfo.GetFileSystemInfos())
{
// We only handle files and directories, not symlinks.
if ((fileSystemInfo.Attributes & FileAttributes.Directory) == FileAttributes.Directory)
{
yield return new ProjectedFileInfo(
fileSystemInfo.Name,
fileSystemInfo.FullName,
size: 0,
isDirectory: true,
creationTime: fileSystemInfo.CreationTime,
lastAccessTime: fileSystemInfo.LastAccessTime,
lastWriteTime: fileSystemInfo.LastWriteTime,
changeTime: fileSystemInfo.LastWriteTime,
attributes: fileSystemInfo.Attributes);
}
else
{
FileInfo fileInfo = fileSystemInfo as FileInfo;
yield return new ProjectedFileInfo(
fileInfo.Name,
fileSystemInfo.FullName,
size: fileInfo.Length,
isDirectory: false,
creationTime: fileSystemInfo.CreationTime,
lastAccessTime: fileSystemInfo.LastAccessTime,
lastWriteTime: fileSystemInfo.LastWriteTime,
changeTime: fileSystemInfo.LastWriteTime,
attributes: fileSystemInfo.Attributes);
}
}
}