+2006-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * FAMWatcher.cs: add new directories to the hashtable after start
+ monitoring them, otherwise the ReqNum is not set. Fixes bug #78029.
+
2006-01-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* FAMWatcher.cs: fix arraylist access when a new directory is added and
string full = fsw.FullPath;
string datadir = data.Directory;
if (datadir != full) {
- string reldir = datadir.Substring (full.Length + 1);
+ int len = full.Length;
+ int slash = 1;
+ if (len > 1 && full [len - 1] == Path.DirectorySeparatorChar)
+ slash = 0;
+ string reldir = datadir.Substring (full.Length + slash);
datadir = Path.Combine (datadir, filename);
filename = Path.Combine (reldir, filename);
} else {
- datadir = Path.Combine (fsw.FullPath, filename);
+ datadir = Path.Combine (full, filename);
}
if (fa == FileAction.Added && Directory.Exists (datadir)) {
fd.Enabled = true;
newdirs.Add (fd);
newdirs.Add (data);
- requests [fd.Request.ReqNum] = fd;
}
}
FAMData newdir = (FAMData) newdirs [n];
FAMData parent = (FAMData) newdirs [n + 1];
StartMonitoringDirectory (newdir);
+ requests [newdir.Request.ReqNum] = newdir;
lock (parent) {
parent.SubDirs [newdir.Directory] = newdir;
}