diff -r -c org/src/DB.cs cdcollect-0.6.0/src/DB.cs
*** org/src/DB.cs 2006-11-24 18:12:13.000000000 +0100
--- cdcollect-0.6.0/src/DB.cs 2008-03-27 23:29:43.000000000 +0100
***************
*** 212,217 ****
--- 212,218 ----
dir = new DirectoryInfo(dirname);
int nfiles = 0;
+ try{
if (dir.Exists) {
DirectoryInfo [] dirs = dir.GetDirectories();
***************
*** 223,228 ****
--- 224,231 ----
nfiles += files.Length;
}
+ }catch{
+ }
return(nfiles);
}
-------------------------------------------------------
I found that cdcollect hanged (stopped indexing) on
many CDs (log below). I created the patch above and it helped for the problem.
Please apply to 0.6 version.
Thanks,
Piotr Tabor
-------------------------------------------------------
** (CDCollect:32612): WARNING **: FindNextFile: Bad encoding for '/mnt/cdrom/Polska/Plany Miast/Gorz\xf3w Wielkopolski.GIF'
Consider using MONO_EXTERNAL_ENCODINGS
** (CDCollect:32612): WARNING **: FindNextFile: Bad encoding for '/mnt/cdrom/Polska/Plany Miast/Krakow/Krakow-satellit_png_Ozi/Krak\xf3w_satellit.map'
Consider using MONO_EXTERNAL_ENCODINGS
** (CDCollect:32612): WARNING **: FindNextFile: Bad encoding for '/mnt/cdrom/Polska/Plany Miast/Krakow/Krakow-satellit_png_Ozi/Krak\xf3w_satellit.png'
Consider using MONO_EXTERNAL_ENCODINGS
Unhandled Exception: System.IO.IOException: Win32 IO returned ERROR_NO_MORE_FILES. Path: /mnt/cdrom/Polska/Plany Miast/Krakow/Krakow-satellit_png_Ozi
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String pattern, FileAttributes mask, FileAttributes attrs) [0x00000]
at System.IO.Directory.GetDirectories (System.String path, System.String pattern) [0x00000]
at System.IO.DirectoryInfo.GetDirectories (System.String pattern) [0x00000]
at System.IO.DirectoryInfo.GetDirectories () [0x00000]
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:GetDirectories ()
at CDDatabase.count_files (System.String dirname) [0x00000]
at CDDatabase.count_files (System.String dirname) [0x00000]
at CDDatabase.count_files (System.String dirname) [0x00000]
at CDDatabase.count_files (System.String dirname) [0x00000]
at CDDatabase.count_files (System.String dirname) [0x00000]
at ImportCDWindow.importcd_thread () [0x00000]
at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()
Delete imported CD if key!=1 (key=-10)
Logged In: YES
user_id=2047869
Originator: YES
Corrected patch:
diff -rc org/src/DB.cs cdcollect-0.6.0/src/DB.cs
*** org/src/DB.cs 2006-11-24 18:12:13.000000000 +0100
--- cdcollect-0.6.0/src/DB.cs 2008-03-27 23:47:33.000000000 +0100
***************
*** 212,217 ****
--- 212,218 ----
dir = new DirectoryInfo(dirname);
int nfiles = 0;
+ try{
if (dir.Exists) {
DirectoryInfo [] dirs = dir.GetDirectories();
***************
*** 223,228 ****
--- 224,231 ----
nfiles += files.Length;
}
+ }catch{
+ }
return(nfiles);
}
***************
*** 237,246 ****
int i,j;
DirectoryInfo dir = new DirectoryInfo (dirname);
Hashtable filelist = new Hashtable ();
-
if (dir.Exists) {
!
! DirectoryInfo [] dirs = dir.GetDirectories();
for (i=0; i<dirs.Length; i++) {
/* Create path of current file */
--- 240,252 ----
int i,j;
DirectoryInfo dir = new DirectoryInfo (dirname);
Hashtable filelist = new Hashtable ();
if (dir.Exists) {
! DirectoryInfo [] dirs;
! try{
! dirs = dir.GetDirectories();
! }catch{
! return(filelist);
! }
for (i=0; i<dirs.Length; i++) {
/* Create path of current file */