Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. what is the "TOUCH" (UNIX) equivalent for windows?

what is the "TOUCH" (UNIX) equivalent for windows?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++comtools
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nandu_77b
    wrote on last edited by
    #1

    Is there any way to perform "TOUCH" (like TOUCH in UNIX) in windows, with out installing any tools? From the site : "http://support.microsoft.com/kb/69581, I came to know that we can use COPY command to perform TOUCH like operation. and tried the below command. but I got the error "The system cannot find the file specified." system ( "/COPY C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt /B +"); So please help to fix this. Below are the different options I tried, but no clue. 1) I Have executed the below command from command prompt it works fine. C:\Documents and Settings\ms56106\.tdm> COPY /B "C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt" + 1 file(s) copied. And if try the same from different folder it fails, C:\Documents and Settings\ms56106> COPY /B "C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt" + The system cannot find the file specified. 0 file(s) copied. What should I do to run for a different folder? 2) I want the same command to be used in C++ source, for this I tried the same with system(), but it is not working. Please correct me. tem = C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt system ( "/COPY tem /B +"); Thanks, Nandu

    L A 2 Replies Last reply
    0
    • N Nandu_77b

      Is there any way to perform "TOUCH" (like TOUCH in UNIX) in windows, with out installing any tools? From the site : "http://support.microsoft.com/kb/69581, I came to know that we can use COPY command to perform TOUCH like operation. and tried the below command. but I got the error "The system cannot find the file specified." system ( "/COPY C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt /B +"); So please help to fix this. Below are the different options I tried, but no clue. 1) I Have executed the below command from command prompt it works fine. C:\Documents and Settings\ms56106\.tdm> COPY /B "C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt" + 1 file(s) copied. And if try the same from different folder it fails, C:\Documents and Settings\ms56106> COPY /B "C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt" + The system cannot find the file specified. 0 file(s) copied. What should I do to run for a different folder? 2) I want the same command to be used in C++ source, for this I tried the same with system(), but it is not working. Please correct me. tem = C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt system ( "/COPY tem /B +"); Thanks, Nandu

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I'm suddenly having Déjà vu[^], I believe that I've read this post before.

      1 Reply Last reply
      0
      • N Nandu_77b

        Is there any way to perform "TOUCH" (like TOUCH in UNIX) in windows, with out installing any tools? From the site : "http://support.microsoft.com/kb/69581, I came to know that we can use COPY command to perform TOUCH like operation. and tried the below command. but I got the error "The system cannot find the file specified." system ( "/COPY C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt /B +"); So please help to fix this. Below are the different options I tried, but no clue. 1) I Have executed the below command from command prompt it works fine. C:\Documents and Settings\ms56106\.tdm> COPY /B "C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt" + 1 file(s) copied. And if try the same from different folder it fails, C:\Documents and Settings\ms56106> COPY /B "C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt" + The system cannot find the file specified. 0 file(s) copied. What should I do to run for a different folder? 2) I want the same command to be used in C++ source, for this I tried the same with system(), but it is not working. Please correct me. tem = C:/Documents and Settings/ms56106/.tdm/CookieSession_Details.txt system ( "/COPY tem /B +"); Thanks, Nandu

        A Offline
        A Offline
        Ahmed Charfeddine
        wrote on last edited by
        #3

        http://tp.lc.ehu.es/jma/win32/touch.html[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups