Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   How To Search Files Using Part Of Their Name In C + non-ascii characters reading (http://www.go4expert.com/forums/search-files-using-part-c-ascii-t5468/)

Manarg 25Jul2007 23:39

How To Search Files Using Part Of Their Name In C + non-ascii characters reading
 
Hello everybody. Do you know which function i must use to "search" for files using a part of their name?
i want a func similar to fopen but it must not take the full name as argument....
thanx in advance!

ps:i think that's no good to open a new thread moments after this thread, so just another question: does anybody know how i can read non - ascii characters? thanx again!

DaWei 26Jul2007 00:27

Re: How To Search Files Using Part Of Their Name In C + non-ascii characters reading
 
Look up "findfirstfile" and "findnextfile".

There's no problem reading non-ascii characters. Characters are just integer values. What those values represent is a matter of interpretation or presentation. You might wish you represent them as characters or you might just wish to use them as numbers. Interpretation for your desired representation is the key, and is not implicit in the binary value.

A lot of people have trouble understanding that binary values are just that: absolute values. How you treat them (as ints or floats or characters or whatever) is a matter of choice; the microprocessor knows no such "realities".

Manarg 26Jul2007 04:21

Re: How To Search Files Using Part Of Their Name In C + non-ascii characters reading
 
thanx dawei, these commands can do what i wnat, but they're not applicable in any non-windows systems, right? Do you know any command that works, independent from the OS?
Also, for my second question, i know that characters are all integers for the microprocessor, but let me be more specific. That's the case: i want to read and write some greek characters, which are not included in the ascii coding. How can i handle them so that the system when it "meets" such characters will not "look" in ascii table but in a unicode table or sth like this?
for example the greek character M is not included in the ascii-table, and when i try to print it something like Ě is shown at the screen...

DaWei 26Jul2007 04:30

Re: How To Search Files Using Part Of Their Name In C + non-ascii characters reading
 
Again, characters are just a shape representing some assigned value. Some systems handle that by using "code pages", which one can change. It's also a matter of "locale", I'm sure you've heard the term, and you can change it on many modern systems. It's strictly implementation and setting dependent. If you don't quite understand that, ask yourself what a teletype would print. It wouldn't, without help and changing of keys and such. You're going to have to do that with software or settings.

Look up opendir, readdir, and closedir. Those are POSIX functions.

Manarg 26Jul2007 04:46

Re: How To Search Files Using Part Of Their Name In C + non-ascii characters reading
 
how can i change the system code pages?

those functions suit me perfectly, thanx!

Manarg 26Jul2007 04:52

Re: How To Search Files Using Part Of Their Name In C + non-ascii characters reading
 
error. these functions need the fullname of a directory to open it. How this can help me to get a stream to a file without knowing its full name?


All times are GMT +5.5. The time now is 15:36.