-
fie info
Somewhere in the code below is causing this error(ACCESS TO $RECYCLE.BIN$ WAS DENIED), not letting me get file info TO populate a list control.
Code:
pFILEINFO fiInfo = new( FILEINFO );
HANDLE hFile = CreateFile(fdFind.cFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, 0, NULL);
GetLastWriteTimes( hFile, szBuf, MAX_PATH );
pFile = new CFile(fdFind.cFileName,
CFile::modeRead);
LONGLONG dwLength = pFile->GetLength();
BOOL bWorking = finder.FindFile(fdFind.cFileName);
bWorking = finder.FindNextFile();
finder.GetCreationTime(tempTime);
str2 = tempTime.Format(_T("%c"));
CString str;
str.Format(_T("%I64u KB"), dwLength /1024 );
finder.GetCreationTime(tempTime );
lvItem.iItem = iNum;
lvItem.iImage = siInfo.iIcon;
lvItem.lParam = ( LPARAM )fiInfo;
int nIndex = m_list.InsertItem(&lvItem);
m_list.SetItemText(nIndex,1,szBuf);
m_list.SetItemText(nIndex,2,str);
m_list.SetItemText(nIndex,3,str2);
I type a directory in a edit control..ex(c:/users) crontol then hit a button to populate the list control..........to be precise of what im doing.
-
Re: fie info
I narrowed it down...
Code:
pFile = new CFile(fdFind.cFileName,
CFile::modeRead);
that is the problem.i tried messing with the access..no luck
-
Re: fie info
$RECYCLE.BIN$ is a special folder with very restrictive access. In fact it makes a part of Recycle Bin functionality. It's usually hidden in Windows Explorer, and should be ignored/hidden in any kind of third party listing. Same to System Volume Information folder that is another system folder with very restrictive access.