2002-01-03 Gaurav Vaish <gvaish@iitk.ac.in>
[mono.git] / mcs / class / System.Web / System.Web.Utils / FileChangesMonitor.cs
1 /**\r
2  * \r
3  * Namespace: System.Web.Utils\r
4  * Class:     FileChangesMonitor\r
5  * \r
6  * Author:  Gaurav Vaish\r
7  * Maintainer: gvaish@iitk.ac.in\r
8  * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
9  * Implementation: yes\r
10  * Status:  ??%\r
11  *\r
12  * \r
13  * (C) Gaurav Vaish (2001)\r
14  */\r
15 \r
16 using System;\r
17 using System.IO;\r
18 using System.Web;\r
19 using System.Runtime.InteropServices;\r
20 using System.Collections;\r
21 using System.Threading;\r
22 \r
23 namespace System.Web.Utils\r
24 {\r
25         internal class FileChangesMonitor\r
26         {\r
27                 private static string BIN    = "bin";\r
28                 private static string BINDIR = "bin/";\r
29                 private static int MAXLEN = 260;\r
30                 \r
31                 private FileChangeEventHandler       cbRename;\r
32                 private NativeFileChangeEventHandler cbSubDirs;\r
33                 \r
34                 private int       monitoredSubdirs;\r
35                 private string    rootDir;\r
36                 private Hashtable allDirs;\r
37                 private GCHandle  rootcbSubDirs;\r
38                 \r
39                 private ReaderWriterLock rwLock;\r
40                 \r
41                 public FileChangesMonitor()\r
42                 {\r
43                         allDirs = new Hashtable(WebHashCodeProvider.Default, WebEqualComparer.Default);\r
44                         rwLock  = new ReaderWriterLock();\r
45                 }\r
46                 \r
47                 /// <param name="file">Name of the file</param>\r
48                 /// <param name="mTime">Last modification date</param>\r
49                 /// <param name="length">Legnth of the file</param>\r
50                 public void GetFileAttributes(string file, out DateTime mTime, long length)\r
51                 {\r
52                         if(!Path.IsPathRooted(file))\r
53                         {\r
54                                 throw new HttpException(HttpRuntime.FormatResourceString("Path_must_be_rooted"));\r
55                         }\r
56                         // TODO: finish this\r
57                         mTime = DateTime.Now;\r
58                         throw new NotImplementedException();\r
59                 }\r
60         }\r
61 }\r