extracting file names

This is a discussion on extracting file names within the C Programming forums, part of the General Programming Boards category; hi folks, Could any of you tell me how to extract the names of the files in a specific folder? ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    4

    extracting file names

    hi folks,

    Could any of you tell me how to extract the names of the files in a specific folder?

    my problem is that i have a folder containing 2000 image files and i need to create a text file with all of their names in it.

    (compiling with visual c++)

    thanks in advance,
    Cathal

  2. #2
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    Posts
    317
    http://faq.cprogramming.com/cgi-bin/...&id=1044780608
    This should help.

    if you don't need to do it programmatically
    if you are using windows and can bring up a command prompt you can just pipe the contents to a file by typing

    dir *.jpg >>filename.ext
    Last edited by manofsteel972; 08-19-2004 at 09:11 AM.
    "Knowledge is proud that she knows so much; Wisdom is humble that she knows no more."
    -- Cowper

    Operating Systems=Slackware Linux 9.1,Windows 98/Xp
    Compilers=gcc 3.2.3, Visual C++ 6.0, DevC++(Mingw)

    You may teach a person from now until doom's day, but that person will only know what he learns himself.

    Now I know what doesn't work.

    A problem is understood by solving it, not by pondering it.

    For a bit of humor check out xkcd web comic http://xkcd.com/235/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File being filled with NULLs
    By Tigers! in forum Windows Programming
    Replies: 2
    Last Post: 06-30-2009, 05:28 PM
  2. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  4. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  5. Passing file names
    By PJYelton in forum C++ Programming
    Replies: 1
    Last Post: 12-27-2002, 11:08 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21