 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
yangyong Guest
|
Posted: Fri Jun 27, 2003 9:47 am Post subject: Re: remove or _unlink using wildcard? |
|
|
"news.tele.dk" <jn (AT) online (DOT) stofanet.dk> дÈëÓʼþ
news:3efc0c16$0$32469$edfadb0f (AT) dread16 (DOT) news.tele.dk...
| Quote: | Hi There,
I have been trying to delete several files by using wildcard using either
remove or _unlink, but non of them seems to work.
char temp_files[MAX_PATH];
strcpy(temp_files, "c:\tmp*.*");
_unlink(temp_files); // doesn't work
remove(temp_files); // doesn't work either
Can someone please tell me how I delete several files using wildcard?
Thanks in regards,
Jess
---
Jess Nielsen, HND/C
Systems Developer
"I don't want to be a pie, I don't like gravy!"
|
Windows: you can FindFirstFile, FindNextFile loop.
---
Posted via news://freenews.netfront.net
Complaints to [email]news (AT) netfront (DOT) net[/email]
|
|
| Back to top |
|
 |
Thomas Matthews Guest
|
Posted: Fri Jun 27, 2003 2:16 pm Post subject: Re: remove or _unlink using wildcard? |
|
|
yangyong wrote:
| Quote: | "news.tele.dk" <jn (AT) online (DOT) stofanet.dk> дÈëÓʼþ
news:3efc0c16$0$32469$edfadb0f (AT) dread16 (DOT) news.tele.dk...
Hi There,
I have been trying to delete several files by using wildcard using either
remove or _unlink, but non of them seems to work.
char temp_files[MAX_PATH];
strcpy(temp_files, "c:\tmp*.*");
_unlink(temp_files); // doesn't work
remove(temp_files); // doesn't work either
Can someone please tell me how I delete several files using wildcard?
Thanks in regards,
Jess
---
Jess Nielsen, HND/C
Windows: you can FindFirstFile, FindNextFile loop.
|
But what if I'm not using windows?
O.P.:
The remove() function is for removing a single file.
You will need to use operating system functions for
deleting more than one file at a time.
You could use the system() function and specify
the OS command for deleting many files.
For more information about deleting many files,
please consult a newsgroup about your platform.
See the FAQs and Welcome.txt listed below.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
|
|
| Back to top |
|
 |
Alexander Terekhov Guest
|
Posted: Fri Jun 27, 2003 2:42 pm Post subject: Re: remove or _unlink using wildcard? |
|
|
Thomas Matthews wrote:
[...]
| Quote: | Windows: you can FindFirstFile, FindNextFile loop.
But what if I'm not using windows?
|
Felony. $250,000 fine and five years in prison (ten
years on a second offense).
regards,
alexander.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|