August 25, 2017
On Thursday, 24 August 2017 at 18:02:24 UTC, vino wrote:
>   Thanks for your support, was able to resolve this issue.

Hello.
IMHO, it will be better, if you will share your solution for other peoples :)
August 25, 2017
On Friday, 25 August 2017 at 09:08:44 UTC, zabruk70 wrote:
> On Thursday, 24 August 2017 at 18:02:24 UTC, vino wrote:
>>   Thanks for your support, was able to resolve this issue.
>
> Hello.
> IMHO, it will be better, if you will share your solution for other peoples :)

Hi,

 Please find the solution below, basically i converted the path to UNC path as below

Solution:
auto unc = "\\\\?\\"~i;
   auto dFiles = dirEntries(unc, SpanMode.shallow).filter!(a => a.isDir && !globMatch(a.baseName, "*DND*")).array;

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Program:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
import std.file: dirEntries, isFile, SpanMode, remove, rmdirRecurse, exists, mkdir;
import std.stdio: writeln, writefln, File;
import std.algorithm: filter;
import std.array: array;
import std.path: globMatch, baseName;
/**********************************************/
/* Global Valiables                           */
/**********************************************/
int SizeDir = 10;

/**********************************************/
/* Folder Lists                               */
/**********************************************/
auto SizeDirlst = [ "N:\\PROD_TEAM", "P:\\TEAM" ];
/******************************************/
/* Function : Size of Non DND Dir List    */
/******************************************/
void SizeDirList (string[] SzDNDlst)
{
 ulong subdirTotal = 0;
 foreach (string i; SzDNDlst[0 .. $])
 {
   auto unc = "\\\\?\\"~i;
   auto dFiles = dirEntries(unc, SpanMode.shallow).filter!(a => a.isDir && !globMatch(a.baseName, "*DND*")).array;
foreach (d; dFiles)
{
  auto SdFiles = dirEntries(d, SpanMode.breadth).array;
  foreach (f; SdFiles)
  {
   subdirTotal += f.size;
  }
ulong subdirTotalGB = (subdirTotal/1024/1024/1024);
if (subdirTotalGB > SizeDir)
  {
   writefln("%-63s %s", d[0].replace("\\\\?\\", ""), subdirTotalGB);
 }
subdirTotal = 0;
 }	
}
}

/********************************************************************************************/
/* Main
                     */
/********************************************************************************************/
void main ()
{
 SizeDirList(SizeDirlst);
}
1 2
Next ›   Last »