用于搜索文件和目录的Filespec [英] Filespec for searching files and directories

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

问题描述

我使用的是filldirlisttotable的AllenBrowne代码。为我在访问2003中构建的媒体库管理器提供一些功能。

我有四个复选框,如果所有四个都没有打开,请提供一个应该搜索的扩展名列表。但是,当我这样做时,我没有得到任何结果。


代码效果很好。只有一个问题,我在网上找不到任何关于使用filespec选项的注释。

默认情况下它使用*。*,我可以通过只指定一个扩展名来使其工作,例如* .jpg,但是当我指定多个扩展名时会变得无用,例如* .jpg,* .gif,* .png。


显然,提供filespec的方法肯定是错误的。

有人用过这个功能吗?我在下面提供它的一部分。

甚至可能有更好的方法来做到这一点,但我已经写了大量的代码,所以我想我会在开始之前看看是否有人熟悉它处理不同的解决方案。


我有点认为,除非这些代码根本无法处理多个扩展,无论它们是如何提供的,我可能不得不重写这一部分代码。

展开 | 选择 | Wrap | 行号

解决方案

此代码只允许一个f ilter用于文件扩展名。

我建议为每个扩展名调用例程。该表将收集你的不同扩展。


Nic; o)


我想在填充之前你想要删除表zzLibScan的内容使用FileSpec结果,如果是这样的话:

展开 | 选择 | Wrap | 行号


我要决定的是如何将多个文件规范提供给功能。


一方面,我可以构建一个扩展列表并将它们解析成一个数组并循环遍历数组。这有利于程序的用户,他们会直接选择文件类型。


或者,我可以忽略filespec,并使用写入的程序并覆盖所有文件,然后丢弃(我已经有一个例程,用户不想要的文件。后者可能更耗时。


必须有更好的方法来做到这一点。如果有一个函数或例程将执行此例程正在执行的操作(只是一个字段的文件名和另一个字段的完整路径)填充在具有多个文件规范的临时表中,我将使用这两个字段用于所有其他功能,针对单个文件,例如从MP3中获取标签信息,基本文件信息以及之后的例程。


我想更好的问题是有比这更好的功能?我在哪里可以找到信息,或者如果有开源功能,我在哪里找到?


感谢您的回复。


CJ

I am using the AllenBrowne code of "filldirlisttotable" to provide some functions for a media library manager I am building in access 2003.
I have four checkboxes which if all four are not turned on, give a list of extensions that should be search for. However, when I do it that way, I get no results.

The code works great. Only one issue, I cannot find anywhere on the net any notes about using the filespec option.
By default it uses *.*, and I can make it work by specifying only one extension, such as *.jpg, but it becomes useless when I specify multiple extensions such as *.jpg, *.gif, *.png.

Obviously that must be the wrong way to provide the filespec.
Has anyone used this function? I am providing part of it below.
There may even be a better way of doing this, but I have written substantial code around this so I thought I would see if nybody was familiar with it before I started working on a different solution.

I am kind of thinking that unless this code simply cannot handle the multiple extensions regardless of how they are provided, then I may have to re-write this section of code.

Expand|Select|Wrap|Line Numbers

解决方案

This code will only allow one filter for the file name extension.
I would advise to call the routine for each extension. The table will "collect" the different extensions for you.

Nic;o)


I imagine that you would want to Delete the contents of the Table zzLibScan before populating it with your FileSpec results, if so:

Expand|Select|Wrap|Line Numbers


What I am trying to decide is how to feed the multiple file specifications to the function.

On one hand, I can build a list of extensions and parse them out into an array and loop through the array. This benefits users of the program in they would directly choose the file types.

Alternatively, I could ignore the filespec, and use the procedure as written and cappture all files, then discard (which I already have a routine for) the files that the user didn''t want. The latter is probably more time consuming.

There has to be a better way of doing this. If there a function, or routine that will do what this routine is doing (just file name to one field and the complete path to another field) being populated in a temporary table with multiple file specifications, I use the two fields for all the other functions, against the individual files, such as getting tags information from MP3s, basic file information, and such in routines afterward.

I suppose the better question is there is better function than this one? Where can I find info, or if there is an open source function, where can I locate?

Thanks for the replies.

CJ


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

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