1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Minor problem. Incorrect value internal var _dir_files

Discussion in 'Support' started by djspits, Jul 26, 2014.

  1. djspits

    Joined:
    Apr 13, 2010
    Messages:
    189
    Likes Received:
    2
    When using option /Nm:1, DIR returns the correct output but the internal variable _dir_files is zero.

    The same variable has the correct value if this option is not used.

    I added a screen shot with an example.

    Cheers, DJ
     

    Attached Files:

    #1 djspits, Jul 26, 2014
    Last edited: Jul 27, 2014
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,888
    Likes Received:
    30
    Hmmm! With /Nm:1, I'd expect you'd only see one directory (namely ".") and no files. That's how it works here, and that makes me wonder how it might be used.

    If you're talking about _dir_dirs, I see what you mean. _dir_dirs is 0 when /n:m is used.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,809
    Likes Received:
    82
    Not reproducible here. Do you have an alias for DIR?
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,888
    Likes Received:
    30
    Code:
    v:\> *dir /nm:5 i*
    
     Volume in drive V is DATA  Serial number is c007:d3e4
     Directory of  V:\i*
    
    2014-06-16  21:19  <DIR>  InternetRegistries
    2012-06-05  01:46  <DIR>  ip2c
    2014-06-03  12:38  <DIR>  ipalloc
    2014-05-27  17:01  178  iconshow.btm
    2014-06-03  12:34  25,091  ipalloc.txt
      6,475,681,792 bytes free
    
    v:\> echo %_dir_dirs
    0
    
    v:\> echo %_dir_files
    0
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,888
    Likes Received:
    30
    V: is a SUBST'd drive. It works better on a real one.
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,809
    Likes Received:
    82
    Not reproducible here.
     
  7. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,888
    Likes Received:
    30
    Hmmm! Compare these two, one of which worked, one of which didn't. Notice that the tolals line is missing from the second one.
    Code:
    p:\> *dir /nm:10 v:\i* & echo %_dir_dirs & echo %_dir_files
    
    Volume in drive V is DATA  Serial number is c007:d3e4
    Directory of  V:\i*
    
    2014-06-16  21:19  <DIR>  InternetRegistries
    2012-06-05  01:46  <DIR>  ip2c
    2014-06-03  12:38  <DIR>  ipalloc
    2014-05-27  17:01  178  iconshow.btm
    2014-06-03  12:34  25,091  ipalloc.txt
    2013-10-20  01:26  244  ipconfigall.btm
    2013-11-02  17:10  617  ipcountry.btm
    2013-11-03  14:48  831  ipcountry2.btm
    2014-06-03  12:36  17,567  ipreg.txt
      44,528 bytes in 6 files and 3 dirs  65,536 bytes allocated
      6,475,677,696 bytes free
    3
    6
    
    p:\> *dir /nm:5 v:\i* & echo %_dir_dirs & echo %_dir_files
    
    Volume in drive V is DATA  Serial number is c007:d3e4
    Directory of  V:\i*
    
    2014-06-16  21:19  <DIR>  InternetRegistries
    2012-06-05  01:46  <DIR>  ip2c
    2014-06-03  12:38  <DIR>  ipalloc
    2014-05-27  17:01  178  iconshow.btm
    2014-06-03  12:34  25,091  ipalloc.txt
      6,475,677,696 bytes free
    0
    0
     
  8. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,888
    Likes Received:
    30
    When I ask for fewer than exist, it fails. No SUBST involved here.
    Code:
    s:\> *dir /nm:129 c:\windows\system32\i* | grep allocated & echo %_dir_dirs & echo %_dir_files
    0
    0
    
    s:\> *dir /nm:130 c:\windows\system32\i* | grep allocated & echo %_dir_dirs & echo %_dir_files
      57,448,217 bytes in 125 files and 5 dirs  57,655,296 bytes allocated
    5
    125
    
    s:\> *dir /nm:131 c:\windows\system32\i* | grep allocated & echo %_dir_dirs & echo %_dir_files
      57,448,217 bytes in 125 files and 5 dirs  57,655,296 bytes allocated
    5
    125
     

Share This Page