Read subdirectiories problem

This is a discussion on Read subdirectiories problem within the C++ Programming forums, part of the General Programming Boards category; Hello, I am attempting to write a c++ program to read all of the subdirectories withing a directory. I'm rather ...

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    59

    Question Read subdirectiories problem

    Hello,

    I am attempting to write a c++ program to read all of the subdirectories withing a directory. I'm rather new to this so I'm having a great deal of difficulty.

    For some reason it keeps reading the current directory name.

    I keep comparing mine with the example at:
    http://msdn.microsoft.com/library/de..._Functions.asp

    I followed it pretty close.

    I can't figure out what is wrong after a whole afternoon of research. I'm sure its something real simple I missed.

    Could someone help. I've attached my cpp file.
    Attached Files Attached Files
    " . . . and I lay awake, big dreamers never sleep." - David Lee Roth

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    > if((sHand = _findfirst(curPath, &findStruct)) == -1L)
    Try

    if((sHand = _findfirst("*.*", &findStruct)) == -1L)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem of read file in C++
    By rosicky2005 in forum C++ Programming
    Replies: 3
    Last Post: 11-27-2006, 04:25 AM
  2. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  3. data read problem
    By Supra in forum C Programming
    Replies: 0
    Last Post: 02-03-2002, 06:02 PM
  4. problem with output
    By Garfield in forum C Programming
    Replies: 2
    Last Post: 11-18-2001, 07:34 PM
  5. Uh-oh! I am having a major switch problem!
    By goodn in forum C Programming
    Replies: 4
    Last Post: 11-01-2001, 03:49 PM

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