Thread: Trying to write a recursive directory listing

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    10

    Trying to write a recursive directory listing

    figured it out
    Last edited by crazeinc; 04-28-2005 at 12:28 AM.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    unfamiliar with the error......perhaps it's a symlink or something...

    about the original problem, i didn't go thru the logic, but it seems that you called mydirlist recursivly with the value ".." which then appended "." to it and tried to read the dir/file named "..."
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    10
    Quote Originally Posted by misplaced
    unfamiliar with the error......perhaps it's a symlink or something...

    about the original problem, i didn't go thru the logic, but it seems that you called mydirlist recursivly with the value ".." which then appended "." to it and tried to read the dir/file named "..."
    Yea, i noticed that, I've updated my code so it won't do that anymore.

  4. #4
    Registered User
    Join Date
    Apr 2005
    Posts
    10
    when the recursion is on it's way back up, it appears that the while((dirt = readdir(dirp)) != NULL) condition is failing even though that isn't the case. The /root/code folder also has a hw2/ folder in it and a text file.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    well, i need to see some code

    print out the path before the dirt != NULL line see what it says
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Finding files in a directory
    By smarta_982002 in forum C Programming
    Replies: 1
    Last Post: 01-25-2008, 10:10 AM
  2. Directory listing
    By brif in forum C++ Programming
    Replies: 1
    Last Post: 10-10-2002, 06:44 AM
  3. Directory Listing
    By Angelus in forum C++ Programming
    Replies: 5
    Last Post: 09-09-2002, 09:32 AM
  4. How to change recursive loop to non recursive loop
    By ooosawaddee3 in forum C Programming
    Replies: 1
    Last Post: 06-24-2002, 08:15 AM
  5. The Site Directory
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 01-22-2002, 08:19 PM