When enumerating a folder's contents, don't resolve aliases, and don't return hidden files/folders.

This commit is contained in:
rjc%netscape.com 1999-08-27 03:42:23 +00:00
Родитель b10f20d8ff
Коммит 0e42aabae7
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -47,7 +47,7 @@ nsDirectoryIndexStream::Init(const nsFileSpec& aDir)
// Sigh. We have to allocate on the heap because there are no
// assignment operators defined.
mIter = new nsDirectoryIterator(mDir, PR_TRUE);
mIter = new nsDirectoryIterator(mDir, PR_FALSE); // rjc: don't resolve aliases
if (! mIter)
return NS_ERROR_OUT_OF_MEMORY;
@ -153,6 +153,9 @@ nsDirectoryIndexStream::Read(char* aBuf, PRUint32 aCount, PRUint32* aReadCount)
nsFileSpec current = mIter->Spec();
++(*mIter);
// rjc: don't return hidden files/directories!
if (current.IsHidden()) continue;
PRFileInfo fileinfo;
PRStatus status = PR_GetFileInfo(nsNSPRPath(current), &fileinfo);
if (status != PR_SUCCESS)