Click here to Skip to main content
12,352,294 members (54,020 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++ Visual-Studio
I was trying to delete a text file so i use the remove();if i give only file name it works but if i use absolute path of the file the remove function fails what to do in case of absolute path.....
Posted 28-Dec-12 1:20am
Comments
jibesh 28-Dec-12 7:25am
   
what error you are getting? any exception?
Please post the failure details so that we can able to give a better solution
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

DeleteFile works with absolute paths.

Maybe you should post the code you used if you used remove() to take a look at it.
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

The remove function should work equally well with an absolute path. Perhaps your path specification is not correct. Remeber that you have to specify backslashes as double-backslashes in a strings!

If in doubt show us the code you are using, so we can have a look at it.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 28 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100