基于Mask的搜索和删除文件 [英] Search and Delete Files Based on Mask

查看:86
本文介绍了基于Mask的搜索和删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,

我正在寻找一种基于模式

掩码搜索和删除文件的方法。例如,搜索方法会发现所有符合

的文件都包含通配符(例如* FILE29 * .TXT)。我正在寻找一种

方式来实现Visual Basic或C(++)。谢谢!

Greetings,
I am looking for a way to search for and delete files based on a pattern
mask. For example, the search method would find all files matching a
certain pattern containing wildcards (e.g. *FILE29*.TXT). I''m looking for a
way to do this in either Visual Basic or C(++). Thanks!

推荐答案

Ben写道:
Ben wrote:
问候,
我正在寻找一种方式基于
模式
掩码搜索和删除文件。例如,搜索方法会找到所有与包含通配符的某些模式匹配的文件(例如* FILE29 * .TXT)。我正在寻找一种在Visual Basic或C(++)中执行此操作的方法。谢谢!
Greetings,
I am looking for a way to search for and delete files based on a
pattern
mask. For example, the search method would find all files matching a
certain pattern containing wildcards (e.g. *FILE29*.TXT). I''m looking for
a
way to do this in either Visual Basic or C(++). Thanks!




查找Windows SDK函数FindFirstFile(),FindNextFile(),

FindClose()和WIN32_FIND_DATA类型。 />

微软一次又一次地改变解析文件的首选方式,所以如果你的代码被认为是古老的,比如说,a b $ b不要感到惊讶一年或

两个。 (有没有人记得使用INT 21 sub 4E和sub 4F来填充DTA?

当然不是/那个/很久以前,不是吗?)


-

Richard Heathfield: bi****@eton.powernet.co.uk

Usenet是一个奇怪的地方。 - Dennis M Ritchie,1999年7月29日。

C FAQ: http://www.eskimo.com/~scs/C-faq/top.html

K& R答案,C书等:< a rel =nofollowhref =http://users.powernet.co.uk/etontarget =_ blank> http://users.powernet.co.uk/eton



Look up the Windows SDK functions FindFirstFile(), FindNextFile(),
FindClose() and the WIN32_FIND_DATA type.

Every now and again, Microsoft change the preferred way to parse files, so
don''t be surprised if your code is considered archaic in, say, a year or
two. (Does anyone remember filling the DTA using INT 21 sub 4E and sub 4F?
Surely it wasn''t /that/ long ago, was it?)

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton


2004年2月21日星期六09:15:10 +0000,Richard Heathfield

< in ***** @ address.co.uk。无效>写道:
On Sat, 21 Feb 2004 09:15:10 +0000, Richard Heathfield
<in*****@address.co.uk.invalid> wrote:
Ben写道:
Ben wrote:
问候,
我正在寻找一种基于a搜索和删除文件的方法
图案
面具。例如,搜索方法会找到所有与包含通配符的某些模式匹配的文件(例如* FILE29 * .TXT)。我正在寻找一种在Visual Basic或C(++)中执行此操作的方法。谢谢!
Greetings,
I am looking for a way to search for and delete files based on a
pattern
mask. For example, the search method would find all files matching a
certain pattern containing wildcards (e.g. *FILE29*.TXT). I''m looking for
a
way to do this in either Visual Basic or C(++). Thanks!



查找Windows SDK函数FindFirstFile(),FindNextFile(),
FindClose()和WIN32_FIND_DATA类型。

现在每一个再次,微软改变了解析文件的首选方式,所以如果您的代码在一年或两年内被认为是过时的,那么不要感到惊讶。 (有没有人记得使用INT 21 sub 4E和sub 4F来填充DTA?
当然不是/那个/很久以前,是吗?)



Look up the Windows SDK functions FindFirstFile(), FindNextFile(),
FindClose() and the WIN32_FIND_DATA type.

Every now and again, Microsoft change the preferred way to parse files, so
don''t be surprised if your code is considered archaic in, say, a year or
two. (Does anyone remember filling the DTA using INT 21 sub 4E and sub 4F?
Surely it wasn''t /that/ long ago, was it?)




Yup - 而且我还记得恢复DTA的重要性...


对于OP - 最好编写自己的匹配算法

- ''FILE29 * .TXT'中的前导''''非常不标准



Yup - and I also remember how essential it was to restore the DTA ...

To the OP - it would be best to write your own ''matching'' algorithm
- that leading ''*'' in ''*FILE29*.TXT'' is very non-standard


#>我正在寻找一种基于

#>搜索和删除文件的方法。模式

#>面具。例如,搜索方法会找到所有符合

#>的文件。某些包含通配符的模式(例如* FILE29 * .TXT)。我在找

#> a

#>在Visual Basic或C(++)中执行此操作的方法。谢谢!


基本命令是

find
# > I am looking for a way to search for and delete files based on a
# > pattern
# > mask. For example, the search method would find all files matching a
# > certain pattern containing wildcards (e.g. *FILE29*.TXT). I''m looking for
# > a
# > way to do this in either Visual Basic or C(++). Thanks!

The basic command is
find


这篇关于基于Mask的搜索和删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆