Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

A questions about @Files "+d"

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.
 
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.
 
> 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.
 
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.
>
>
 
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
 

Similar threads

Back
Top