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

touch sensitive to order of options

Discussion in 'Support' started by hlhelman, Jan 3, 2011.

  1. hlhelman

    Joined:
    Mar 20, 2009
    Messages:
    32
    Likes Received:
    0
    I tested a directory date change via touch with the /n option
    TCC showed the proposed change. When I removed the /n the change failed. I had to put the /a:d option first and remove the \ from the directory name. See below:

    C:\...d\AppData\Local\Temp>md testdater

    C:\...d\AppData\Local\Temp>touch /n /d01-10-2000 /a:d testdater\
    1/10/2000 13:06:53.193 C:\Users\Howard\AppData\Local\Temp\testdater\

    C:\...d\AppData\Local\Temp>touch /d01-10-2000 /a:d testdater\
    TCC: (Sys) The system cannot find the file specified.
    "C:\Users\Howard\AppData\Local\Temp\testdater\"

    C:\...d\AppData\Local\Temp>touch /a:d /d01-10-2000 testdater\
    TCC: (Sys) The system cannot find the file specified.
    "C:\Users\Howard\AppData\Local\Temp\testdater\"

    C:\...d\AppData\Local\Temp>touch /a:d /d01-10-2000 testdater
    1/10/2000 13:07:34.939 C:\Users\Howard\AppData\Local\Temp\testdater

    C:\...d\AppData\Local\Temp>
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,092
    Likes Received:
    85
    The problem isn't with the order of the options, it is with the trailing \ on the directory name, which the Windows API is choking on. (Most of the Windows APIs accept a trailing \ on a directory name, but not this one.)

    The /N option doesn't actually call the change date/time API, so it won't fail with a trailing \.

    You don't have to put the /A:D first:

    touch /d01-10-2000 /a:d testdater
    works fine.
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    ---- Original Message ----
    From: rconn
    | The problem isn't with the order of the options, it is with the
    | trailing \ on the directory name, which the Windows API is choking
    | on. (Most of the Windows APIs accept a trailing \ on a directory
    | name, but not this one.)

    The next release of TCC might truncate trailing \ from names passed to this particular API, thus allowing TCC users to treat all commands uniformly in this respect(be better than the API). Not a high priority, since directory dates (except creation) are automatically updated whenever directory content changes (modification date) or the directory is accessed. Rex, do not bother to respond to this suggestion. If you do it, it will be in "What's New", if you don't, we will live with it as we had for many years.
    --
    Steve
     

Share This Page