Thread: Finding out the name of a file, and changing directory

  1. #16
    Registered User truthADjuster's Avatar
    Join Date
    Jun 2004
    Posts
    3
    Just for clarification, do you also need to rename every directory aside from the files?

  2. #17
    C n00b
    Join Date
    Jun 2004
    Posts
    8
    nope.

    @exarath: I did that... I placed one at every line, and it won't show up.

  3. #18
    Registered User
    Join Date
    Jun 2004
    Posts
    722
    Quote Originally Posted by nindoja
    @exarath: I did that... I placed one at every line, and it won't show up.
    You placed one what?? printf()??
    Do the breakpoints thing. Where does the renameFiles() function return?? Is the full path dir name valid?? does the directory exists in your PC??

    Change this
    Code:
    if(hTheFiles==INVALID_HANDLE_VALUE) return;
    with this
    Code:
    if(hTheFiles==INVALID_HANDLE_VALUE){
    	fprintf(stderr, "ERROR: no files at dir %s", startingDir);
    	return;
    }

    With your last posted source I got this, with a dir created just for testing:
    c:\test\
    FILE: c:\test\New Flash Document.fla renamed
    c:\test\New Folder\
    hahahahahahahahahahahahahac:\test\New Folder (2)\
    hahahahahahahahahahahahahaFILE: c:\test\New Text Document.txt renamed
    FILE: c:\test\New WinZip File.zip renamed
    Press any key to continue
    Last edited by xErath; 06-23-2004 at 04:10 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  3. Deleting / Changing a record in a text file
    By clearrtc in forum C Programming
    Replies: 9
    Last Post: 08-21-2006, 12:09 AM
  4. String parser
    By sand_man in forum C Programming
    Replies: 13
    Last Post: 08-13-2005, 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