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

TCC dir /s command not showing all folders

Discussion in 'Support' started by erpomik, Oct 28, 2010.

  1. erpomik

    Joined:
    Aug 19, 2009
    Messages:
    7
    Likes Received:
    0
    TCC and TCC/LE version 11.0.x and the new version 12.0.32 seems to have a general problem when using dir /s to search for a specific folder name.

    If I search for a specific folder without using wildcards like 'dir /s foldername' and an empty folder with that specific name exists, the folder is not listed. The reason for this, I believe, is that TCC and TCC/LE thinks that I want the contents of this specific folder to be listed and not the folder itself. This is even if I specify the /a:d switch. CMD.exe seems to do this right (IMO ;)).

    To illustrate the problem, I've created a script that creates a couple of directories and then executes dir commands with different switches and search patterns. The script is attached together with the result from TCC 11.00.52 and TCC 12.00.32. If you run the script, you'll see that the folder named 'folder2' is never listed unless wildcards are used in the search pattern.

    Best regards
    Ernst Mikkelsen
    EM-Soft
     

    Attached Files:

  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    WAD. TCC (and 4NT and 4DOS all the way back to the beginning) have always behaved this way. The reasoning is that expanding the argument name first (to resolve things like "....\foo", extended wildcards, directory wildcards, URLs, etc.) was more important than having DIR behave differently depending on whether the specified directory was in the current directory or a subdirectory. (A rather dubious CMD behavior, and one I've never actually seen documented.)
     
  3. erpomik

    Joined:
    Aug 19, 2009
    Messages:
    7
    Likes Received:
    0
    Okay, so doing a "dir /bsa:d C:\Desktop" giving an empty result is not considered an error in your opinion?

    Example:
    dir /bsa:d C:\Users\Desktop
    <empty result="">[Empty List]

    dir /bsa:d C:\Users\Deskto?
    C:\Users\All Users\Desktop
    C:\Users\Default\Desktop
    C:\Users\EPM\Desktop
    C:\Users\Public\Desktop

    I will try to twist my mind, and try remembering to always replace the last character with a question mark when searching for a specific directory.;)

    Best regards
    Ernst Mikkelsen
    EM-Soft</empty>
     
  4. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    Pretty interesting! I never considered that this is how DIR /S works in TCC.

    Well, it will show the sub-directories of desktop if there are any. ;) I had quite a few.

    But the "replace last char with ?" trick works quite well. Thanks for that tip! Might come in handy some time.
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    No, it's not. Certainly not enough to remove a half-dozen more important features in order to support this. (Apparently it's also not that important to anybody else, as this is the first time this issue has come up in 20 years!)

    CMD behaving differently depending on whether the target is in the current directory or a subdirectory isn't considered an error in your opinion?
     
  6. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,304
    Likes Received:
    39
    If you only want to find subdirectories named "Desktop" and not "DeskTo1", "DesktoA", "Deskto_" and so on, add a pair of brackets instead:

    Code:
    dir /b /s /a:d c:\users\desktop[]
    
    That's a wildcard too, just a more restrictive one.
     
  7. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    For what it's worth, my timedir has a switch that will enable the behavior
    you want. By default I behave the same way as TCC does.

    D:\JPtest>timedir /b /s folder2

    D:\JPtest>timedir /b /s folder2 /\
    D:\JPtest\JPsoft\folder2

    You can find my timedir at jcook.net/timedir in case it proves useful to
    you.

    On Thu, Oct 28, 2010 at 11:42, erpomik <> wrote:




    --
    Jim Cook
    2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Monday.
     

Share This Page