I may have mentioned before that the internal hard disk partitions on this laptop are becoming full enough (currently 98.3% in use for the C: partition, 96.7% for the D: partition) that this is starting to become a real problem. So to try to figure out what file(s) I could safely archive to my external hard drive or get rid of entirely I (attempted!) to write a .btm file that went through all of the directories on a given hard drive and report the total file size and total file allocated size for each directory plus each directory and its subdirectories. This batch file started at the "leaves" of each given directory and then worked its way "upward". (You'll understand why this is the best approach if you think about it.) Well, I got said batch file written and tested for my Z: drive (RAM disk) where the directory structure does not go that "deep". However, when I attempted to run it on my C: drive, it bombed. So I wrote a batch file to test specifically that. Here are the complete contents of said batch file:
and here are the complete results of running said batch file:
Well, it is documented that there is a maximum nesting level for Gosub's, but it's also clear that the directory structure on my C: drive is "deeper" than what that limit allows.
So, second try using "@ExecStr" instead of "Gosub":
And here are the (somewhat surprising to me!) results (in ExecStrWithinExeStr.txt) of running the above batch file:
Notice that at level 6 the "@ExecStr" function evidently failed given that there was no output of any kind.
And, just to be complete, here is the complete TCC session:
Since this is a high-priority task, I will next attempt to do it using the "Start" command, and I don't see any reason in advance why that won't work (although I don't know, off of the top of my head, what the proper parameters to the "Start" command will be so I will have to do some research/experimentation). But I tend to think that, at minimum, the Gosub "nesting" level should be increased.
Code:
@Echo Off
On Error Goto ShowLevel
SetLocal
Gosub NestedGosub 1
EndLocal
Quit 0
:ShowLevel
@Echo Final Level: %Level
EndLocal
Quit 8
:NestedGosub [Level]
If %Level GT 200 ^
Return
@Echo Nested Level: %Level
Gosub NestedGosub %@Inc[%Level]
Return
Code:
Tue Nov 29, 2011 3:51:46p
ISO8601 plugin v1.1.1 loaded.
SafeChars plugin v1.5.7 loaded.
TCC 12.11.76 Windows 7 [Version 6.1.7601]
Copyright 2011 Rex Conn & JP Software Inc. All Rights Reserved
Registered to Daniel Mathews
[Z:\]NestedGosub
Nested Level: 1
Nested Level: 2
Nested Level: 3
Nested Level: 4
Nested Level: 5
Nested Level: 6
Nested Level: 7
Nested Level: 8
Nested Level: 9
Nested Level: 10
Nested Level: 11
Nested Level: 12
Nested Level: 13
Nested Level: 14
Nested Level: 15
Nested Level: 16
Nested Level: 17
Nested Level: 18
Nested Level: 19
Nested Level: 20
Nested Level: 21
Nested Level: 22
Nested Level: 23
Final Level:
[Z:\]
So, second try using "@ExecStr" instead of "Gosub":
Code:
@Echo Off
If Not Exist %2 ^
Type NUL: >%2
Echo Level: %1 Output File: %2 >>!%2
If %1 GT 5 ^
Quit 0
On Error Goto ReachedLimit
Echo @ExecStr[Z:\ExecStrWithinExecStr %@Inc[%1] %2] >>!%2
Echo @ExecStr: %@ExecStr[Z:\ExecStrWithinExecStr %@Inc[%1] %2] >>!%2
Echo Level: %1 Output File: %2
Quit 0
:ReachedLimit
@Echo Reached the limit of %1 >CON:
Quit 8
Code:
Level: 1 Output File: ExecStrWithinExecStr.txt
@ExecStr[Z:\ExecStrWithinExecStr 2 ExecStrWithinExecStr.txt]
Level: 2 Output File: ExecStrWithinExecStr.txt
@ExecStr[Z:\ExecStrWithinExecStr 3 ExecStrWithinExecStr.txt]
Level: 3 Output File: ExecStrWithinExecStr.txt
@ExecStr[Z:\ExecStrWithinExecStr 4 ExecStrWithinExecStr.txt]
Level: 4 Output File: ExecStrWithinExecStr.txt
@ExecStr[Z:\ExecStrWithinExecStr 5 ExecStrWithinExecStr.txt]
Level: 5 Output File: ExecStrWithinExecStr.txt
@ExecStr[Z:\ExecStrWithinExecStr 6 ExecStrWithinExecStr.txt]
Level: 6 Output File: ExecStrWithinExecStr.txt
@ExecStr:
@ExecStr: Level: 5 Output File: ExecStrWithinExecStr.txt
@ExecStr: Level: 4 Output File: ExecStrWithinExecStr.txt
@ExecStr: Level: 3 Output File: ExecStrWithinExecStr.txt
@ExecStr: Level: 2 Output File: ExecStrWithinExecStr.txt
And, just to be complete, here is the complete TCC session:
Code:
Tue Nov 29, 2011 5:03:30p
ISO8601 plugin v1.1.1 loaded.
SafeChars plugin v1.5.7 loaded.
TCC 12.11.76 Windows 7 [Version 6.1.7601]
Copyright 2011 Rex Conn & JP Software Inc. All Rights Reserved
Registered to Daniel Mathews
[Z:\]ExecStrWithinExecStr 1 ExecStrWithinExecStr.txt
Level: 1 Output File: ExecStrWithinExecStr.txt
[Z:\]