Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: remove or _unlink using wildcard?

Reply
Thread Tools

Re: remove or _unlink using wildcard?

 
 
yangyong
Guest
Posts: n/a
 
      06-27-2003

"news.tele.dk" <(E-Mail Removed)> 写入邮件
news:3efc0c16$0$32469$(E-Mail Removed) k...
> 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 http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Thomas Matthews
Guest
Posts: n/a
 
      06-27-2003
yangyong wrote:
> "news.tele.dk" <(E-Mail Removed)> 写入邮件
> news:3efc0c16$0$32469$(E-Mail Removed) k...
>
>>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

 
Reply With Quote
 
 
 
 
Alexander Terekhov
Guest
Posts: n/a
 
      06-27-2003

Thomas Matthews wrote:
[...]
> > 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Httpmodule still executed even if remove using <remove> config entry Simon-Pierre Jarry ASP .Net 2 08-10-2005 11:22 AM
How to remove items from add/remove list please Caractucus Potts Computer Support 5 07-03-2005 10:31 PM
Re: Why I can not remove all dialers after "remove"-I have two anti-dialers programs Joseph Ladovic Computer Security 3 05-26-2005 03:00 AM
Add/Remove Program Glitch: Asks If I Want To To Remove Wrong Program ? Robert11 Computer Support 6 08-02-2004 09:02 PM
[OT]Re: remove or _unlink using wildcard? Artie Gold C++ 0 06-27-2003 04:31 PM



Advertisments