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

TOUCH question

Discussion in 'Support' started by Stefano Piccardi, Sep 28, 2008.

  1. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    2
    Which of c a w times of a file can TOUCH change?
    The help file, if I read correctly, says all three, but I can't get it to work.
    I'm using an NTFS-formatted USB drive, I think that's a LFN drive, isn't it?
    TCC 9.02.147 Windows XP [Version 5,1.2600]
    Code:
    C:\temp>del /q /e a & > a & for %i in (a c w) dir /M /K /H /T:%i a
    28-09-2008  16:29               0  a
    28-09-2008  16:25               0  a
    28-09-2008  16:29               0  a
    
    C:\temp>for %i in (a c w) touch /T%[i]17:01 a
    28-09-2008 17:01:00,000  C:\temp\a
    28-09-2008 17:01:00,000  C:\temp\a
    28-09-2008 17:01:00,000  C:\temp\a
    
    C:\temp>for %i in (a c w) dir /M /K /H /T:%i a
    28-09-2008  16:29               0  a
    28-09-2008  16:25               0  a
    28-09-2008  17:01               0  a
    
    According to TOUCH all of a c w times where changed - at least that's how I interpret the output, but according to DIR only w time was changed. What am I doing wrong?
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,784
    Likes Received:
    29
    On Sun, 28 Sep 2008 16:42:04 -0500, "JP Software Forums"
    <neil@jpsoft.com>,Stefano Piccardi <> wrote:




    It works here without [].

    v:\> for %i in (a c w) dir /M /K /H /T:%i a
    2008-09-28 17:01 0 a
    2008-09-28 17:01 0 a
    2008-09-28 17:01 0 a

    v:\> for %i in (a c w) touch /T%i17:04 a
    2008-09-28 17:04:00.000 V:\a
    2008-09-28 17:04:00.000 V:\a
    2008-09-28 17:04:00.000 V:\a

    v:\> for %i in (a c w) dir /M /K /H /T:%i a
    2008-09-28 17:04 0 a
    2008-09-28 17:04 0 a
    2008-09-28 17:04 0 a
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,726
    Likes Received:
    80
    Stefano Piccardi wrote:



    You cannot use the % construct for FOR variables. What you're doing
    is appending an empty string to /T, so it's defaulting to 'w' each time.

    Rex Conn
    JP Software
     
  4. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    2
    Thanks Vince and Rex, I knew it had to be something silly on my part.
     

Share This Page