1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How To Search Files Using Part Of Their Name In C + non-ascii characters reading

Discussion in 'C' started by Manarg, Jul 25, 2007.

  1. Manarg

    Manarg New Member

    Joined:
    Jun 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    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!
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    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".
     
  3. Manarg

    Manarg New Member

    Joined:
    Jun 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    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...
     
  4. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    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.
     
  5. Manarg

    Manarg New Member

    Joined:
    Jun 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    how can i change the system code pages?

    those functions suit me perfectly, thanx!
     
  6. Manarg

    Manarg New Member

    Joined:
    Jun 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    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?
     

Share This Page