-
October 19th, 2014, 02:45 AM
#1
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.
-
October 19th, 2014, 06:16 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|