<div><div>
I am using latest manage-ontap-sdk-3 dated March 26, 2008, Windows XP Service Pack 2, Visual Studio 2005.
</div>
<div>
I am using FAS250 with version "NetApp Release 7.1.2.1: Sun Mar 18 20:52:21 PDT 2007" as well as version
</div>
<div>
"NetApp Release 7.3X9: Fri Nov 23 23:46:25 PST 2007"
</div>
I found there is a problem with the Win32 calls:
FindFirstFile() & FindNextFile()
The problems occur as follows:
1.if filer has folder 3 folders, the Win32 call will only return 2 folders
2.if filer has folder 2 folders, the Win32 call will only return 1 folder
2.if filer has folder 1 folder, the Win32 call will only return 0 folder
That implies the Win32 call will only return 1 foler less.
If I use the Windows server (CIFS) with the same codes, I will consistently get all folders. So I can conclude that Ontap is doing something different than Windows servers. Could anybody help me out with this issue?
Thanks.
Ken
</div>
Could you post the relevant part of your code?
Here are the relevant codes:
CString strPathFiles;
TCHAR test = strPathFiles.GetAt(len - 1);
if (test != BACK_SLASH) // BACK_SLASH same as "\"
strPathFiles += BACK_SLASH;
path = strPathFiles;
len = lstrlenW(strPathFiles);
strPathFiles.GetBufferSetLength(len);
strPathFiles += _T("*");
hFind = FindFirstFile(strPathFiles, &find);
if (hFind == INVALID_HANDLE_VALUE)
{
return -1;
}
else
{
while (FindNextFile(hFind, &find) != 0)
{
if ((find.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY ) &&
(IsDots(find.cFileName) == FALSE))
{
temp = find.cFileName;
allPaths += temp;
allPaths += _T(";");
}
}
DWORD dwError = GetLastError();
if (dwError == ERROR_NO_MORE_FILES)
{
FindClose(hFind);
}
}
Window server over CIFS, I am consistently getting all folders,. but I will have one less folder if I use filer.
Thanks.
I believe you are ignoring the first file, which is returned when you call FindFirstFile. (Right after calling FindFirstFile, you call FindNextFile without using the information that FindFirstFile put in the "file" structure.)
You are right. But on a side note, Windows server and filer behave a little bit differently.
Windows server return the folder ".", but not filer.
Thanks for your help.