Click here to Skip to main content
12,953,865 members (46,974 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
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
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.
Rate this: bad
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.

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
OriginalGriff 6,429
CHill60 3,490
Maciej Los 3,103
ppolymorphe 2,020
Jochen Arndt 1,975

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