Thread: get the file names

  1. #1
    Compiling
    Join Date
    Jun 2003
    Posts
    69

    get the file names

    Can I get the file names of the current directory using c++?
    I need the filenames in order to covert their format (images).
    If not, may be I just write a bash script to do that.
    thx!

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Sent from my iPadŽ

  3. #3
    Compiling
    Join Date
    Jun 2003
    Posts
    69
    no, linux, g++

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    getcwd?

    opendir / readdir / closedir - to read all the filenames in a directory

    stat() to tell you about each entry - like whether it's a file or a directory

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. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM