Thread: search for particular extention file using C

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    146

    search for particular extention file using C

    Sorry for posting it in C++ board, I'm unable to delete the thread, I request mods to do that

    Hi all,

    I have to make an application which lists all files with .mp3 extention in given directory. How can I search for that using file commands in C?

    Regards,
    Edesign
    Last edited by edesign; 03-30-2009 at 03:51 AM.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    That is OS-dependent - you can see how to list files in the FAQ. Depending on how you do it, you will either specify that you want files called .mp3 or you have to match the name you get back against "ending with .mp3".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    146
    Thanks, I found findfirst in FAQ, that will do the work I guess..

    Thanks,
    Edesign

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  2. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM