Long File path Exception:The system cannot find the path specified

Vino.B via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 23 06:50:18 PDT 2017


On Wednesday, 23 August 2017 at 13:14:31 UTC, Moritz Maxeiner 
wrote:
> On Wednesday, 23 August 2017 at 13:04:28 UTC, Vino.B wrote:
>>
>> The line it complains is 
>> std.file.FileException at std\file.d(3713):even after enabling 
>> debug it points to the same
>>
>> Output:
>> D:\DScript>rdmd -debug Test.d -r  dryrun
>>
>> std.file.FileException at std\file.d(3713): 
>> N:\PROD_TEAM\TST_BACKUP\abcyf0\TST_BATS\j2ee_backup\cluster\states0\apps\bat.com\tc~bat~agent~application~e2emai~std~collectors\servlet_jsp\tc~bat~agent~application~e2emai~std~collectors\root\WEB-INF\entities\DataCollectionPushFileContentScannerTypeBuilder: The system cannot find the path specified.
>> ----------------
>> 0x00431A56
>> 0x00429801
>
> You need to compile with debug info (option `-g`), not compile 
> in debug code (option `-debug`).
> What's the (full) stack trace when compiling with debug info?

Hi,

  Please find the output and the entire program below after 
executing with option -g.

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 dFiles = dirEntries(i, 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, subdirTotalGB);
				        }
						subdirTotal = 0;
		    }	
	 }
}

/********************************************************************************************/
/* Main                                                           
                      */
/********************************************************************************************/
void main ()
{
  SizeDirList(SizeDirlst);
}

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
D:\\DScript>rdmd -g Test.d -r  dryrun
N:\PROD_TEAM\PREBACKUP                                           
97

N:\PROD_TEAM\TST_BACKUP\abcyf0\TST_BATS\j2ee_backup\cluster\states0\apps\bat.com\tc~bat~agent~application~e2emai~std~collectors\servlet_jsp\tc~bat~agent~application~e2emai~std~collectors\root\WEB-INF\entities\DataCollectionPushFileContentScannerTypeBuilder: The system cannot find the path specified.
----------------
0x00415742 in @safe bool std.file.cenforce!(bool).cenforce(bool, 
lazy const(char)[], immutable(char)[], uint)
0x0040EA79 in void std.file.DirIteratorImpl.popFront()
0x00404948 in void 
std.array.Appender!(std.file.DirEntry[]).Appender.put!(std.file.DirEntry).put(std.file.DirEntry) at C:\D\dmd2\windows\bin\..\
..\src\phobos\std\array.d(2919)
0x00404B94 in std.file.DirEntry[] 
std.array.array!(std.file.DirIterator).array(std.file.DirIterator) at C:\D\dmd2\windows\bin\..\..\src\phobos\s
td\array.d(137)
0x00402363 in void Size.SizeDirList(immutable(char)[][]) at 
D:\DScript\Test.d(26)
0x00402468 in _Dmain at D:\DScript\Test.d(46)
0x0040E323 in 
D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
0x0040E2E7 in void rt.dmain2._d_run_main(int, char**, extern (C) 
int function(char[][])*).runAll()
0x0040E1E8 in _d_run_main
0x0040DCB8 in main at D:\DScript\Test.d(7)
0x00459DA9 in mainCRTStartup
0x75CE336A in BaseThreadInitThunk
0x775F9902 in RtlInitializeExceptionChain
0x775F98D5 in RtlInitializeExceptionChain

Lines in the script.
D:\DScript\Test.d(26) : auto SdFiles = dirEntries(d, 
SpanMode.breadth).array;
D:\DScript\Test.d(46) : SizeDirList(SizeDirlst);
D:\DScript\Test.d(7) : /* Global Valiables                        
    */

From,
Vino.B



More information about the Digitalmars-d-learn mailing list