Click here to Skip to main content
11,438,226 members (78,693 online)
Rate this: bad
good
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 2:20am
Comments
jibesh at 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)



Advertise | Privacy | Mobile
Web02 | 2.8.150506.1 | Last Updated 28 Dec 2012
Copyright © CodeProject, 1999-2015
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