i need to control if a folder defined by a path is full of folders, if those folders are too much i need to delete, for example half of them, from the older one the newest one. Practically i need to make space for future folders.
void fCID(long pThreadId)
{
ULARGE_INTEGER rFreeBytesAvailable, rTotalNumberOfBytes, rTotalNumberOfFreeBytes;
if(sc.LB.TMCI && sc.LB.ISM == 1)
{
for(10000000000;10000000000 > sd;sd--) //wrong, i'm looking for it
{
if (::GetDiskFreeSpaceEx (NULL, &rFreeBytesAvailable, &rTotalNumberOfBytes,
&rTotalNumberOfFreeBytes))
{
if (rFreeBytesAvailable.QuadPart > 10000000000) //10gb
{
fAFOZA("C:\\S\\H1\\CA"); //function zip
}
else
{
sd=sd - 50% of (LA); //sd = space disposable
}
}
}
}
else
{
fDFOP(where.Trace_C_P); //not interesting
fDFOP(where.Trace_C_CL_P); //not interesting
}
}
This code is only an idea
ULARGE_INTEGER rFreeBytesAvailable, rTotalNumberOfBytes,
rTotalNumberOfFreeBytes;
if(sc.LB.TMCI && sc.LB.ISM == 1)
{
if (::GetDiskFreeSpaceEx ("C:\\S\\H1\\CA\\LA", &rFreeBytesAvailable, &rTotalNumberOfBytes, &rTotalNumberOfFreeBytes))
{
do
{
fDFOP("C:\\S\\H1\\CA\\LA"); //this function deletes what's inside the path
}while(rFreeBytesAvailable.QuadPart == 10000000000)
if (rFreeBytesAvailable.QuadPart > 10000000000) //10gb
{
fAFOZA("C:\\S\\H1\\CA");//this one makes a zip
}
}
}
this is another possible implementation maybe