CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2012
    Posts
    21

    How to get full path from WIN32_FIND_DATA member cFileName?

    I'm trying to upload files to a ftp server using WININET(windows internet). Trying to do this recursive.

    How can I get the full path of the WIN32_FIND_DATA member cFileName?

    I tried GetFullPathName..but only returns the directory my file is in and not the directory that in specified in FINDFIRSTFILE

    here is my code for my recusive function so far

    Code:
     void recursion(string sPath)
        {
          HANDLE hFind;
          WIN32_FIND_DATAA fdFind;
            
          
         
          //pcstr is a LPCSTR converted from a string that is a path of the folder to upload
          hFind = FindFirstFileA( pcstr, &fdFind );
         
          do
          {
            if( fdFind.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY )
            {
            if(IsDots(fdFind.cFileName)) 
                continue;
        	
        	
              FtpCreateDirectoryA(hIConnect,fdFind.cFileName);
        		
        	  
            //NEED A PATH FROM THE FILE..MAYBE A RECURSIVE PATH
    
    pcstr = ren.c_str();
              recursion(ren);
            }
         
            if(fdFind.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE)
              continue;
          
          }
          while(FindNextFileA( hFind, &fdFind ) );
        }
    Last edited by terryeverlast; October 19th, 2014 at 02:48 AM.

  2. #2
    Join Date
    Nov 2012
    Posts
    21

    Re: How to get full path from WIN32_FIND_DATA member cFileName?

    Nevermind, I got it with using FtpGetCurrentDirectory and FtpSetCurrentDirectory

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured