delete,copy,rename files and directories in WINAPI ..?

Posted by Kristian on Stack Overflow See other posts from Stack Overflow or by Kristian
Published on 2010-06-02T07:37:07Z Indexed on 2010/06/02 7:44 UTC
Read the original article Hit count: 163

Filed under:
|

hi I made a code that search in a givin path for a certain file name or folder and print the value BUT now how can i modify it to instead of printing its name perform on of the operations ( delete,copy,rename ) I searched on google and found nothin.

#include "stdafx.h"
#include <windows.h>


int _tmain(int argc, _TCHAR* argv[])
{
    TCHAR *fn;
    fn=L"d:\\*";
    HANDLE f;

    WIN32_FIND_DATA data;

    f=FindFirstFile(fn,&data);
    if(f==INVALID_HANDLE_VALUE){
        printf("not found\n");
        return 0;
    }
    else{


        _tprintf(L"found this file: %s\n",data.cFileName);
        }
        while(FindNextFile(f,&data)){

        {
        _tprintf(L"found this file: %s\n",data.cFileName);
        }

        }
    }

    FindClose(f);
    return 0;
}

© Stack Overflow or respective owner

Related posts about c++

Related posts about winapi