Red de conocimiento del abogados - Ley de patentes - La función Delphi-DeleteFile recorre y elimina archivos
La función Delphi-DeleteFile recorre y elimina archivos
Solo sé C++, pídele a alguien que lo traduzca
Solo eliminar archivos
BOOL RemoveDir(LPCTSTR lpszPath)
{
WIN32_FIND_DATA wfd;
HANDLE hFind;
if ((hFind = FindFirstFile(CString(lpszPath) + "\\*",&wfd)) != INVALID_HANDLE_VALUE )
{
hacer
{
if (CString(wfd.cFileName) == "." || CString(wfd .cFileName) ) == "..")
continuar;
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
RemoveDir(CString (lpszPath) + "\\*");
continuar;
}
DeleteFile(CString(lpszPath) + "\\" + wfd.cFileName );
} while(FindNextFile(hFind,&wfd);
}
else
return FALSE; p>
CloseHandle(hFind);
devuelve VERDADERO;
}