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

touch /c one;two creates only two

Discussion in 'Support' started by Christian Albaret, Mar 2, 2010.

  1. Christian Albaret

    Joined:
    Jul 1, 2008
    Messages:
    154
    Likes Received:
    1
    The command:
    touch /c one;two
    creates only the file two.

    Not what I expected, but harmless and inessential.

    TCC 11.00.39 Windows XP [Version 5.1.2600]
     
  2. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    Since the TOUCH help says it works with include lists, and the include list
    help shows the semicolon ought to (in this case) be an include list
    separator, I think there is a bug as reported.

    In my test, I also tried the following, and it created two in the
    otherfolder, but did not create one:
    touch /c d:\otherfolder\one;two

    On Tue, Mar 2, 2010 at 8:32 AM, Christian Albaret <>wrote:




    --
    Jim Cook
    2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Monday.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    Definitely what I would expect -- include lists are intended for retrieving
    existing files, not creating new ones.

    What's happening is that TOUCH is looking for the file "one", can't find it,
    and then looks for the file "two". It can't find that one either, so then
    it checks to see if you're trying to create a file, and it duly creates
    "two". The "one" is long gone, and indeed never even seen by TOUCH as it
    was eaten by the "find file" routine.

    But since you can simply remove the ; to get the desired result, it's not
    much of a loss ...

    Rex Conn
    JP Software
     
  4. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    On Tue, Mar 2, 2010 at 4:46 PM, rconn <> wrote:




    I understand what you're saying about the include list and file creation,
    but the way I always use the include list is when I have a folder with
    several files, like trying to create one and two in folder:

    touch /c folder\one;two

    In this case, removing the semicolon creates folder\one and two, but two is
    now in the wrong place.

    Since the include list is clearly designed for existing files, perhaps an
    additional note with touch /c to indicate that neither wildcards nor include
    lists may be used would be sufficient.

    --
    Jim Cook
    2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Monday.
     

Share This Page