.net 3.5 - Compact framework - cannot read directory contents - winioerror -
i have many windows ce 5 devices in field, running our software.
part of duty zip directories, , send server.
on 3 (of several hundred) devices, error, consistently, when trying zip directory. zipping process involves descending through every subdirectory , adding files.
system.io.ioexception: ioexception @ system.io.__error.winioerror(int32 errorcode, string str) @ system.io.directory.internalgetfiledirectorynames(string fullpath, boolean file) @ system.io.directory.internalgetdirectories(string path, string searchpattern) @ system.io.directory.getdirectories(string path, string searchpattern) this happens every time on device - not random.
copying directory contents development device, , running same (on same directory contents) not cause error. not have actual device debug interactively.
of course, winioerror not useful in terms of determining actual cause. can give me hints cause cf fail spectacularly when trying read directory contents?
as can see below, common things directory no longer existing handled specific exception effect - not generic winioerror.
many clues.
below disassembled function:
// system.io.directory internal static string[] internalgetfiledirectorynames(string fullpath, bool file) { char c = fullpath[fullpath.length - 1]; if (c == path.directoryseparatorchar || c == path.altdirectoryseparatorchar || c == path.volumeseparatorchar) { fullpath += '*'; } string[] array = new string[10]; int num = 0; hostnative.find_data find_data = new hostnative.find_data(); if (!directory.exists(path.getdirectoryname(fullpath))) { throw new directorynotfoundexception(); } int handle; int num2 = pal.file_openandreaddir(fullpath, out handle, find_data); if (num2 != 0) { if (num2 == -2147479552 || num2 == -2147479545) { return new string[0]; } __error.winioerror(num2, path.getdirectoryname(fullpath)); } int num3 = 0; { bool flag; if (file) { flag = (0 == (find_data.dwfileattributes & 16)); } else { flag = (0 != (find_data.dwfileattributes & 16)); if (flag && (find_data.cfilename.equals(".") || find_data.cfilename.equals(".."))) { flag = false; } } if (flag) { num3++; if (num == array.length) { string[] array2 = new string[array.length * 2]; array.copy(array, 0, array2, 0, num); array = array2; } array[num++] = find_data.cfilename; } num2 = pal.file_readdir(handle, find_data); } while (num2 == 0); pal.file_closedir(handle); if (num2 != 0 && num2 != -2147479545) { __error.winioerror(num2, path.getdirectoryname(fullpath)); } if (!file && num3 == 1 && (find_data.dwfileattributes & 16) != 0) { return new string[] { find_data.cfilename }; } if (num == array.length) { return array; } string[] array3 = new string[num]; array.copy(array, 0, array3, 0, num); return array3; }
physically broken storage media might cause this. low quality sd card, chance?
Comments
Post a Comment