Using Remove()

Discussion in 'C' started by sinner, Mar 21, 2007.

  1. sinner

    sinner New Member

    Joined:
    Mar 21, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    I am somewhat new to C and wanted to know how to implement a program to delete temp files. I have been unsuccessful in all my attempts. What am I doing wrong? ( I have included the appropriate headers)

    Here is a sample of the operation i am trying to perform:

    remove("C:\tempfile.tmp")

    My syntax must be wrong!

    Any help appreciated.
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    My crystal is in the shop for "ball" joints, but an ordinary mortal guess suggests that you need two backslashes. Check your documentation regarding escape characters. While you're checking, may as well look up how you overcome spaces in the path name, should you encounter those.
     
  3. sinner

    sinner New Member

    Joined:
    Mar 21, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Thanks,

    That worked
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice