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

WAD DO /S ... all dirs wind up in the history!

Discussion in 'Support' started by vefatica, Sep 20, 2012.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    When I do this:
    Code:
    do f in /s * ( echos x )
    every folder entered by DO winds up in the dirhistory list. I do have "Save directory on entry" checked but I wouldn't expect it to behave like that. "FOR /R" doesn't do that.
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    I raised the same issue relative to COPY /S in the past and was informed WAD. I would like the directory history to include only those directories that have been entered explicitly, via CD/CDD/PUSHD or via the "implied directory change" available at the command prompt. The issue for me is that I often do "copy /s /uf" from a directory which has hundreds of subdirectories, and they all end up in dirhist... making previously entered directories virtually invisible.
    --
    Steve
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    I don't recall that and it would seem that it no longer happens. It did not do it in this test.
    Code:
    copy /s /u /f p:\4Utils\* v:\4utilscopy\
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    WAD (and unavoidable) when "Save directory on entry" is set. (One of the reasons I really didn't want to offer that option.)

    The only way around it is a substantial parser rewrite; IMO it isn't worth the considerable effort and risk involved.
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    Really too bad. If it's not a bug, it's poor design. I've suggested it be changed in a future version. I am stuck with a hard-to-use dirhistory list (corrupted, IMHO) until I manually clean it out.
     
  6. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,190
    Likes Received:
    11
    Vince,
    If you are executing that DO command from the command line, there aren't many workarounds. But if you are doing it from within a batch script, you can save your dirhistory to a file prior to executing the command and then restore it afterwards.

    Of course, you could do that from the command line too. It's just more of a PITA.
     
  7. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,190
    Likes Received:
    11
    Rex,

    Does this issue only happen when "Save directory on entry" is set? If so, can't you temporarily just turn that option off?
     
  8. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    IMO it's not a poor design; it's a poor decision by a few users to demand that feature (and all its myriad associated problems) be added to an existing long-standing design that has no provision for it.

    (You can bolt your lawnmower to your car, but it's probably not fair to then complain that your car does a lousy job mowing the lawn ...)
     
  9. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    We users are not familiar with the limitations imposed by the long-standing design. From our point of view (I hope I speak for others) the request seems quite reasonable.
     
  10. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    You *should* be, given that it was discussed for many months before I was forced to implement it (and I had warned of the problems that would ensue)! :eek:
     
  11. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    Apparently you did change that behavior in build 38. Thanks!
     
  12. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    I added a dreadful hack (for DO only). I can't do anything about the general issue until I have a couple of weeks to rewrite the parser.
     
  13. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    I don't see it as general. FOR /R and COPY /s don't do it. Where else can it happen?
     

Share This Page