944,153 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 51027
  • C++ RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jun 17th, 2003
0

Re: Syntax for deleting specified file ( in C++)

What do you mean at closing? When you close your program? If so, just make it one of your last lines.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
Jan 26th, 2004
0

Re: Syntax for deleting specified file ( in C++)

Use the remove function ..ok BOB.. but how do i use it ,, syntax etc...
please bob, it's an emergancy.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sixtOnePercent is offline Offline
1 posts
since Jan 2004
Jan 31st, 2004
0

Re: Syntax for deleting specified file ( in C++)

In header <cstdio>:
int remove(const char* filename)

Probably too late for you by now, as you needed an answer urgently. I hope you had the sense to look up remove() in your C++ book, or do a Google search.
Bob
Team Colleague
Reputation Points: 15
Solved Threads: 2
Junior Poster
Bob is offline Offline
129 posts
since Feb 2003
Mar 23rd, 2004
0

Re: Syntax for deleting specified file ( in C++)

Quote originally posted by Mr Gates ...
Ebil cscgal

Anyway, how would I do that so it deleted the file at closing?
you can register a function that will be called when the program terminates with the atexit() function. this func could tehn call remove() on the file.
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Jan 11th, 2012
0

remove vs del ??

what is the difference between remove and del ?

Go easy on me. I'm trying to teach myself c++ and its a slow go for me. Just me, my book, and Google.

FYI... im wanting to write a program that goes through and deletes files of a certain extension. (sort of a janitor utility)

some proprietary software makes these files and will eventually fill up a hard drive. i just want a simple program I can run to clean the directory.

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
brainysmurf0316 is offline Offline
1 posts
since Jan 2012
Message:
Previous Thread in C++ Forum Timeline: fgets() keep skipping a line after cout.
Next Thread in C++ Forum Timeline: offsetting sprites in c++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC