案例insentisive文件搜索 [英] case insentisive file search

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

问题描述

Hi List,


我正在寻找一种不区分大小写搜索文件名的方法。


任何人都有一些提示?


谢谢

Henrik


pl1gcc.sourceforge.net

Hi List,

I am looking for a way to do a case insensitive search for file names.

Anybody have some hints ?

thanks
Henrik

pl1gcc.sourceforge.net

推荐答案

他*********** **@balcab.ch 写道:
he*************@balcab.ch wrote:

嗨列表,


我正在寻找一种方法对文件名进行不区分大小写的搜索。


是否有人提示?
Hi List,

I am looking for a way to do a case insensitive search for file names.

Anybody have some hints ?



我不知道列表是谁,但我会尝试回复。

对于您阅读的每个文件名,转使用tolower()进入所有较低的

,然后进行普通搜索。

I don''t know who List is but I''ll attempt a reply.
For every file name you read, turn it into all lower
using tolower() and then do an ordinary search.


他************* @ balcab.ch 写道:

嗨列表,


我正在寻找一种不区分大小写搜索文件名的方法。


任何人都有一些提示吗?
Hi List,

I am looking for a way to do a case insensitive search for file names.

Anybody have some hints ?



不是一个C问题,但为什么你不读文件名和

转换它是小写还是大写?


-

Ian Collins。

Not realy a C question, but why don''t you just read the filename and
convert it to lower or upper case?

--
Ian Collins.


Ian Collins写道:
Ian Collins wrote:
他********* ****@balcab.ch 写道:

>嗨列表,

我正在寻找一种方法做一个ca. se不敏感搜索文件名。

任何人都有一些提示?
>Hi List,

I am looking for a way to do a case insensitive search for file names.

Anybody have some hints ?



不是一个C问题,但为什么你不是读取文件名和

将其转换为大写或大写?

Not realy a C question, but why don''t you just read the filename and
convert it to lower or upper case?



ok我应该解释一下。


我正在为gcc写一个PL / I前端。 (pl1gcc.sourceforge.net)

当处理%INCLUDE语句时,它只是从

文件系统中读取文件,并将文本放在源程序中,我遇到了以及

以下问题。

语法

%INCLUDE文件名;


传统PL / I不区分大小写。

因此,当我的扫描程序/解析器搜索要包含的文件名时,它可以发生文件名为大写的
,但实际文件在

文件系统是大小写混合。


另外我试图避免扫描每个文件的整个目录

to包含。


扫描程序是使用flex编写的,解析器使用的是bison,所有必要的帮助函数都是用C语言编写的。


谢谢

Henrik

ok I should have explained a bit more.

I am writing a PL/I frontend for gcc. (pl1gcc.sourceforge.net)
When processing %INCLUDE statements, that just reads a file from the
filesystem, and places the text in the source program, I am faced with the
following problem.
Syntax
%INCLUDE filename ;

Traditionally PL/I is case insensitive.
So when my scanner/parser searches for the filename to include, it can
happen that the filename is in uppercase, but the actual file on the
filesystem is in mixed case.

Also I am trying to avoid to scan the whole directory for each file I have
to include.

The scanner is written using flex, and the parser is using bison, and all
the necessary help functions are written in C.

thanks
Henrik


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

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