A questions about @Files "+d"

May 24, 2010
855
0
Northlake, Il
On Wed, 09 Nov 2011 18:09:16 -0500, mathewsdw <> wrote:
Code:
v:\> set count=0

v:\> global /q /h set /a count+=1 > NUL

v:\> echo %count
20
Vince, this is another clear-cut case of "I don't understand at all.". I would think that your suggestion would work, but on my system on the Z: drive the result is "56", whereas the correct answer is (provably! I can attach said proof in a zip file in a later reply if that is anyone's desire) "156". (The difference of exactly "100" is really strange, in my opinion. Maybe it's because the "GLOBAL" command aborts when it hits ""Z:\System Volume Information"". "TCC: (Sys) Access is denied.") However, another post in this thread seems to have provided me with the answer (it uses the "dir" command's "/U2" parameter, which I was not aware of), and said answer is a user-defined function, which is exactly what I want.
 
May 20, 2008
10,573
78
Syracuse, NY, USA
Yes, GLOBAL would also need "/I" (ignore errors).

On Wed, 09 Nov 2011 21:14:47 -0500, mathewsdw <> wrote:

|---Quote (Originally by vefatica)---
|On Wed, 09 Nov 2011 18:09:16 -0500, mathewsdw <> wrote:
|
|Code:
|---------
|v:\> set count=0
|
|v:\> global /q /h set /a count+=1 > NUL
|
|v:\> echo %count
|20
|---------
|---End Quote---
|Vince, this is another clear-cut case of "I don't understand at all.". I would think that your suggest would work, but on my system on the Z: drive the result is "", whereas the correc answer is (provably! I can attach said proof in a zip file in a later reply if that is anyone's desire) "156". (The difference of exactly "100" is really strange, in my opinion. Maybe it's because the "GLOBAL" command aborts when it hits ""Z:\System Volume Information"". "TCC: (Sys) Access is denied.") However, another post in this thread seems to have provided me with the answer (it uses the "dir" command's "/U2" parameter, which I was not aware of), and said answer is a user-defined function, which is exactly what I want.
 
May 24, 2010
855
0
Northlake, Il
> this works:
Code:
--------
function subdirs=`%@word[" ",6,%@execstr[4,dir /h /u2 /s %$]]`

echo %@subdirs[]
echo %@subdirs[..]
echo %@subdirs[c:\windows]
---------
Thank you, Rexx! That is the ideal solution. I will note that Scott ("samintz") provided exactly the same solution.
 

samintz

Scott Mintz
May 20, 2008
1,414
13
Solon, OH, USA
Matthew,

I did supply that solution. Rex suggested the new %_dir_dirs variable
that's available in V13 and just quoted my earlier post.

-Scott

mathewsdw <> wrote on 11/09/2011 09:46:20 PM:

> Quote:
>
> Originally Posted by rconn [image removed]
> > this works:
> Code:
> --------
> function subdirs=`%@word[" ",6,%@execstr[4,dir /h /u2 /s %$]]`
>
> echo %@subdirs[]
> echo %@subdirs[..]
> echo %@subdirs[c:\windows]
> ---------
>
> Thank you, Rexx! That is the ideal solution. I will note that Scott
> ("samintz") provided exactly the same solution.
>
>
 
Jun 2, 2008
312
1
Newton, MA
On 11/9/2011 8:12 PM, rconn wrote:

> If you're using v13, you can use the %_dir_dirs internal variable
Where is that variable documented? It is not included on the pages with
internal variables by name or category.

OK, I just found it described under the DIR command, but shouldn't all
of the variables be referenced on the "internal variables" pages?

-- Jay
 
Thread starter Similar threads Forum Replies Date
V Support 2
C Support 66
Mezlo Support 25
S Support 2
C Support 6