FileChangesMonitor.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. *
  3. * Namespace: System.Web.Utils
  4. * Class: FileChangesMonitor
  5. *
  6. * Author: Gaurav Vaish
  7. * Maintainer: [email protected]
  8. * Contact: <[email protected]>, <[email protected]>
  9. * Implementation: yes
  10. * Status: ??%
  11. *
  12. *
  13. * (C) Gaurav Vaish (2001)
  14. */
  15. using System;
  16. using System.IO;
  17. using System.Web;
  18. using System.Web.Utils;
  19. using System.Runtime.InteropServices;
  20. namespace System.Web.Utils
  21. {
  22. internal class FileChangesMonitor
  23. {
  24. private static string BIN = "bin";
  25. private static string BINDIR = "bin/";
  26. private static string MAXLEN = 260;
  27. private FileChangeEventHandler cbRename;
  28. private NativeFileChangeEventHandler cbSubDirs;
  29. private int monitoredSubdirs;
  30. private string rootDir;
  31. private Hashtable allDirs;
  32. private GCHandle rootcbSubDirs;
  33. private ReaderWriterLock rwLock;
  34. public FileChangesMonitor()
  35. {
  36. allDirs = new Hashtable(WebHashcodeProvider.Default, WebEqualComparer.Default);
  37. rsLock = new ReaderWriterLock();
  38. }
  39. /// <param name="file">Name of the file</param>
  40. /// <param name="mTime">Last modification date</param>
  41. /// <param name="length">Legnth of the file</param>
  42. public void GetFileAttributes(string file, out DateTime mTime, long length)
  43. {
  44. if(!Path.IsRooted(file))
  45. {
  46. throw new HttpException(HttpRuntime.FormatResourceString("Path_must_be_rooted"));
  47. }
  48. mTime = File.
  49. }
  50. }
  51. }