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

Redirect bug?

Discussion in 'Support' started by nickles, Feb 12, 2012.

  1. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    New one. Tried this:

    > `"àsdf%23%39.pdf"`

    got this:

    TCC: (Sys) The system cannot find the file specified.
    ""

    However, this worked:

    > adsfas
    ren adsfas `"àsdf%23%39.pdf"`

    as:

    E:\temp\down\adsfas -> E:\temp\down\àsdf%23%39.pdf
    1 file renamed
     
  2. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    Any chances to get this fixed?
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    This isn't a bug, it's the way the TCC parser works. It could be changed, but there would be a significant amount of parser rewriting involved (and an as-yet-unknown number of new compatibility issues that would arise).

    Redirection occurs before back quotes are processed and removed. (Back quotes are removed after the command name and type (internal or external) is parsed and just before control is passed to the command.) So TCC is looking for the output file name for the redirection, and scans everything up to the first invalid filename character (which in this case is immediate, as the first character is the backquote). So you wind up with an empty filename, and TCC complains.

    I'll look and see if it's possible to add a simple hack to check to see if a redirected filename begins with a ` and strip it then.
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    Note that the "normal" way of doing this in TCC would be to escape the special characters in the output filename, not back quote it.
     
  5. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    That's good news!

    Escaping (I think you meant ^?) will not work (my findings...) as soon there's a space character in the file name, and, to quote I would have to find all the special characters in my string, where when using `s I only would have to "embrace" it (not a big deal though...).
     

Share This Page