1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System.IO.Enumeration;
- using FSE = (bool isDir, string path, long size, System.DateTimeOffset lastWrited);
- namespace FNZCM2.ProofOfConcept;
- internal static class PocFolderScanByFileSystemEnumerable
- {
- public static void RunPoc()
- {
- var fse = new FileSystemEnumerable<FSE>(
- "library",
- (ref FileSystemEntry p) => new(
- p.IsDirectory,
- p.ToFullPath(),
- p.Length,
- p.LastWriteTimeUtc
- ),
- new()
- {
- RecurseSubdirectories = true,
- });
- var lst = new List<FSE>();
- foreach (var entry in fse)
- {
- if (entry.isDir) continue;
- lst.Add(entry);
- int bp = 0;
- // by file type
- // - read tags
- // - make cache model
- }
- var allSize = lst.Sum(p => p.size);
- var fmt = allSize.ToString("N0");
- //SUCCESS
- }
- }
|