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

REN bug

Discussion in 'Support' started by nickles, Mar 27, 2011.

  1. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    Using version 12.10-0.58 and trying to execute the below commands:

    mkdir x
    ren x "x [y]"


    I receive the following error message:

    TCC: (Sys) The system cannot find the file specified.
    "E:\temp\down\x"


    This doesn't happen for plain files:

    > x
    ren x "x [y]"


    E:\temp\down\x -> E:\temp\down\x [y]
    1 file renamed


    nickles
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    If you want to rename a directory and the new name contains wildcards, you'll have to use /S. See HELP REN for more info.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,784
    Likes Received:
    29
    See REN's "/S" option. Apparently it's seeing "[x]" as a wildcard.


    On Sun, 27 Mar 2011 14:25:21 -0400, nickles <> wrote:

    |Using version 12.10-0.58 and trying to execute the below commands:
    |
    |mkdir x
    |ren x "x [y]"
    |
    |I receive the following error message:
    |
    |TCC: (Sys) The system cannot find the file specified.
    | "E:\temp\down\x"
    |
    |This doesn't happen for plain files:
    |
    |> x
    |ren x "x [y]"
    |
    |E:\temp\down\x -> E:\temp\down\x [y]
    | 1 file renamed
    |
    |nickles
     
  4. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    Which it shouldn't (as it isn't). It used to work in prior versions!

    nickles
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,729
    Likes Received:
    80
    Not in anything recent -- that code hasn't changed in at least a couple of
    years. REN has *always* required a /S to rename directories, though
    sometimes (but only recently) it is able to guess that you're trying to
    rename a directory.

    There's no way for the parser to automagically know whether you want []
    characters to be wildcards or literal characters. See the help for REN when
    renaming directories to targets with wildcards.

    Rex Conn
    JP Software
     
  6. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    On the other hand, bracket wildcards make no sense in REN's new_name parm anyway. Maybe COPY's target filename too, and a few other places? Perhaps in some future version, these commands could check only for simple wildcards (question marks and asterisks) in target parameters?
     
  7. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    move works w/o problems.

    Also, the behavior is inconsistent with renaming files (see first post).
    Also - as I've used this exact syntax quite often before - I'm pretty sure (not keeping old versions) that it worked before 12.10.

    nickles
     
  8. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,729
    Likes Received:
    80
    I tried it back on versions to 8.0 and it didn't work (as expected) without the /S option on any of them.

    I suspect that either you had an alias in the past, or you weren't using the square brackets.
     
  9. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    Also - because I used to rename files instead of directories - call me a blockhead ;-)

    Sorry for that.

    But - this behavior is not consistent with cmd and - from my point of view - generally "nasty" (as unexpected):

    ren "some name" "some name [details]" would give my an error when being a directory, not however when being a file.
     
  10. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,729
    Likes Received:
    80
    The only way to make it consistent with CMD would be to eliminate extended wildcards (which CMD doesn't support).
     
  11. CaesarR

    Joined:
    Nov 3, 2010
    Messages:
    9
    Likes Received:
    0
    On Mon, 28 Mar 2011 17:35:33 -0400, rconn <>
    wrote Re RE: [Support-t-2729] Re: REN bug:


    Please don't do that.


     
  12. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    @rconn

    Move uses these too, doesn't it?

    Maybe there should be a switch allowing us to turn on/off extended wildcards?

    Is there a setdos option?

    nickles
     

Share This Page