Hi All,
I am not able to open file after setting offline attribute for file path greater than 1040 characters. If the file path is less than 1040 characters then everything is working fine.
After setting offline attribute ( SetFileAttributes(csFilename, (fileAttributes | FILE_ATTRIBUTE_OFFLINE));) on file (path>1040) opening that file using CreateFile(csFilename, GENERIC_READ|GENERIC_WRITE, 0, NULL, TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS, NULL); fails with error 1359 (internal error).
Has anyone face this issue before? Is there any limitation from NetApp C-Mode side on maximum characters on file path?
Following is piece of code
CString csFilename(L"\\\\?\\UNC\\adnetcm1.punecft.evault.symantec.com\\AD_Share\\Test\\NetCVol\\1stop\\long\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\1stop\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\1stop\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\1stop\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\1stop\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\pqrs\\long\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\abcd\\24.txt");
HANDLE hFile = ::CreateFile(csFilename, GENERIC_READ|GENERIC_WRITE, 0, NULL, TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
printf("Unable to open file handle on file %s, error: %ld", csFilename, GetLastError());
CloseHandle(hFile);
exit(0);
}
CloseHandle(hFile);
WIN32_FILE_ATTRIBUTE_DATA data;
DWORD fileAttributes = GetFileAttributes(csFilename);
if(INVALID_FILE_ATTRIBUTES == fileAttributes)
printf("GetFileAttributes Failed %d", GetLastError());
SetFileAttributes(csFilename, (fileAttributes | FILE_ATTRIBUTE_OFFLINE));
hFile = ::CreateFile(csFilename, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
printf("Unable to open file handle on file %s, error: %ld", csFilename, GetLastError());
CloseHandle(hFile);
exit(0);
}
CloseHandle(hFile);