diff CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x *.rej -x *.orig -x .cvsignore -N -r -u ./config/config.h.in ./config/config.h.in
--- ./config/config.h.in	Sat Jun 25 01:49:14 2005
+++ ./config/config.h.in	Tue Jul 12 20:11:53 2005
@@ -144,3 +144,9 @@
 
 /* Define to 1 if you have jpg support in libgd. */
 #undef HAVE_GD_JPG
+
+/* Define to 1 if you have the <sys/vfs.h> header file. */
+#undef HAVE_SYS_VFS_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
diff CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x *.rej -x *.orig -x .cvsignore -N -r -u ./config/configure.in ./config/configure.in
--- ./config/configure.in	Sun Jul 10 15:28:50 2005
+++ ./config/configure.in	Tue Jul 12 20:11:53 2005
@@ -472,6 +472,8 @@
 # poll if possible
 AC_CHECK_HEADERS(sys/poll.h,,)
 AC_CHECK_FUNCS(poll,,)
+AC_CHECK_HEADERS(sys/vfs.h,,)
+AC_CHECK_HEADERS(sys/param.h,,)
 
 ZLIB=no
 AC_CHECK_LIB(z,inflate,[AC_CHECK_HEADERS(zlib.h,[ZLIB=yes],)])
diff CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x *.rej -x *.orig -x .cvsignore -N -r -u ./src/config/mingw/mlUnix.ml ./src/config/mingw/mlUnix.ml
--- ./src/config/mingw/mlUnix.ml	Sat May 28 11:43:23 2005
+++ ./src/config/mingw/mlUnix.ml	Tue Jul 12 20:11:53 2005
@@ -79,4 +79,16 @@
 
 let mini (x: int) y = if x < y then x else y
 
-let write fd s pos len = Unix.write fd s pos (mini len 16000)
\ No newline at end of file
+let write fd s pos len = Unix.write fd s pos (mini len 16000)
+
+let bsize dir = Int64.of_int (-1)
+let blocks dir = Int64.of_int (-1)
+let bfree dir = Int64.of_int (-1)
+let bavail dir = Int64.of_int (-1)
+let fnamelen dir = Int64.of_int (-1)
+let disktotal dir = Int64.of_int (-1)
+let diskfree dir = Int64.of_int (-1)
+let diskused dir = Int64.of_int (-1)
+let percentused dir = (-1)
+let percentfree dir = (-1)
+let filesystem dir = "unknown"
diff CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x *.rej -x *.orig -x .cvsignore -N -r -u ./src/config/unix/mlUnix.ml ./src/config/unix/mlUnix.ml
--- ./src/config/unix/mlUnix.ml	Sat May 28 12:20:33 2005
+++ ./src/config/unix/mlUnix.ml	Tue Jul 12 20:11:53 2005
@@ -89,3 +89,125 @@
 let write = Unix.write
 
 let set_nonblock = Unix.set_nonblock
+
+type statfs = {
+  f_type : int64;   (* type of filesystem *)
+  f_bsize : int64;  (* optimal transfer block size *)
+  f_blocks : int64; (* total data blocks in file system *)
+  f_bfree : int64;  (* free blocks in fs *)
+  f_bavail : int64; (* free blocks avail to non-superuser *)
+  f_files : int64;  (* total file nodes in file system *)
+  f_ffree : int64;  (* free file nodes in fs *)
+  f_fsid : unit;  (* See note in statfs(2) *)
+  f_fnamelen : int64; (* maximum length of filenames *)
+  f_basetype : string; (* type of filesystem - Solaris, (-1) on other systems, use f_type there *)
+  f_frsize : int64;  (* Fundamental file system block size, (-1) if not provided by system *)
+}
+
+external statfs : string -> statfs = "statfs_statfs"
+external fstatfs : Unix.file_descr -> statfs = "statfs_fstatfs"
+
+let ( ** ) x y = Int64.mul x y
+let ( ++ ) x y = Int64.add x y
+let ( -- ) x y = Int64.sub x y
+let ( // ) x y = Int64.div x y
+
+let bsize dir =
+  let s = statfs dir in
+    if s.f_frsize = Int64.zero || s.f_frsize = Int64.of_int (-1) then
+      s.f_bsize
+    else
+      s.f_frsize
+
+let blocks dir =
+  let s = statfs dir in
+    s.f_blocks
+
+let bfree dir =
+  let s = statfs dir in
+    s.f_bfree
+
+let bavail dir =
+  let s = statfs dir in
+    s.f_bavail
+
+let fnamelen dir =
+  let s = statfs dir in
+    s.f_fnamelen
+
+let disktotal dir =
+(* total disk space in bytes *)
+  let s = statfs dir in
+    ((bsize dir) ** s.f_blocks)
+
+let diskfree dir =
+(* free disk space in bytes *)
+  let s = statfs dir in
+    ((bsize dir) ** s.f_bavail)
+
+let diskused dir =
+(* used disk space in bytes *)
+  let s = statfs dir in
+    ((bsize dir) ** (s.f_blocks -- s.f_bavail))
+
+let percentused dir =
+(* percentage of used disk space *)
+  let s = statfs dir in Int64.to_int
+    (100L -- ((diskfree dir) ** 100L // (disktotal dir)))
+
+let percentfree dir =
+(* percentage of free disk space *)
+  let s = statfs dir in Int64.to_int
+    ((diskfree dir) ** 100L // (disktotal dir))
+
+let filesystem dir =
+  let s = statfs dir in
+    match s.f_type with
+(* values copied from statfs(2) manpage *)
+    | 0xadf5L -> "ADFS_SUPER_MAGIC"
+    | 0xADFFL -> "AFFS_SUPER_MAGIC"
+    | 0x42465331L -> "BEFS_SUPER_MAGIC"
+    | 0x1BADFACEL -> "BFS_MAGIC"
+    | 0xFF534D42L -> "CIFS_MAGIC_NUMBER"
+    | 0x73757245L -> "CODA_SUPER_MAGIC"
+    | 0x012FF7B7L -> "COH_SUPER_MAGIC"
+    | 0x28cd3d45L -> "CRAMFS_MAGIC"
+    | 0x1373L -> "DEVFS_SUPER_MAGIC"
+    | 0x00414A53L -> "EFS_SUPER_MAGIC"
+    | 0x137DL -> "EXT_SUPER_MAGIC"
+    | 0xEF51L -> "EXT2_OLD_SUPER_MAGIC"
+    | 0xEF53L -> "ext2/3" (* "EXT2/3_SUPER_MAGIC" *)
+    | 0x4244L -> "HFS_SUPER_MAGIC"
+    | 0xF995E849L -> "HPFS_SUPER_MAGIC"
+    | 0x958458f6L -> "HUGETLBFS_MAGIC"
+    | 0x9660L -> "ISOFS_SUPER_MAGIC"
+    | 0x72b6L -> "JFFS2_SUPER_MAGIC"
+    | 0x3153464aL -> "JFS_SUPER_MAGIC"
+    | 0x137FL -> "MINIX_SUPER_MAGIC"
+    | 0x138FL -> "MINIX_SUPER_MAGIC2"
+    | 0x2468L -> "MINIX2_SUPER_MAGIC"
+    | 0x2478L -> "MINIX2_SUPER_MAGIC2"
+    | 0x4d44L -> "FAT" (* "MSDOS_SUPER_MAGIC" *)
+    | 0x564cL -> "NCP_SUPER_MAGIC"
+    | 0x6969L -> "NFS_SUPER_MAGIC"
+    | 0x5346544eL -> "NTFS" (* "NTFS_SB_MAGIC" *)
+    | 0x9fa1L -> "OPENPROM_SUPER_MAGIC"
+    | 0x9fa0L -> "PROC_SUPER_MAGIC"
+    | 0x002fL -> "QNX4_SUPER_MAGIC"
+    | 0x52654973L -> "ReiserFS" (* "REISERFS_SUPER_MAGIC" *)
+    | 0x7275L -> "ROMFS_MAGIC"
+    | 0x517BL -> "SMB_SUPER_MAGIC"
+    | 0x012FF7B6L -> "SYSV2_SUPER_MAGIC"
+    | 0x012FF7B5L -> "SYSV4_SUPER_MAGIC"
+    | 0x01021994L -> "TMPFS_MAGIC"
+    | 0x15013346L -> "UDF_SUPER_MAGIC"
+    | 0x00011954L -> "UFS_MAGIC"
+    | 0x9fa2L -> "USBDEVICE_SUPER_MAGIC"
+    | 0xa501FCF5L -> "VXFS_SUPER_MAGIC"
+    | 0x012FF7B4L -> "XENIX_SUPER_MAGIC"
+    | 0x58465342L -> "XFS_SUPER_MAGIC"
+    | 0x012FD16DL -> "_XIAFS_SUPER_MAGIC"
+    | _ -> if s.f_basetype <> "-1" then
+	     s.f_basetype
+	   else
+	     Printf.sprintf "unknown (%Ld)" s.f_type
diff CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x *.rej -x *.orig -x .cvsignore -N -r -u ./src/config/unix/os_stubs_c.c ./src/config/unix/os_stubs_c.c
--- ./src/config/unix/os_stubs_c.c	Fri Apr 16 19:14:53 2004
+++ ./src/config/unix/os_stubs_c.c	Tue Jul 12 20:41:57 2005
@@ -114,3 +114,98 @@
 {
 
 }
+
+#ifdef HAVE_SYS_PARAM_H
+#  include <sys/param.h>
+#  if (defined(__FreeBSD__) && __FreeBSD_version >= 503001) || defined(__OpenBSD__) || defined(__NetBSD__)
+#    include <sys/mount.h>
+#    define HAVE_STATS 1
+#  endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+#  include <sys/vfs.h>
+#  define HAVE_STATS 1
+#endif
+
+#ifdef HAVE_STATS
+static value
+#if ((defined (sun) || defined (__sun__)))
+copy_statfs (struct statvfs *buf)
+#else
+copy_statfs (struct statfs *buf)
+#endif
+{
+  CAMLparam0 ();
+  CAMLlocal2 (bufv, v);
+  bufv = caml_alloc (11, 0);
+#if ((defined (sun) || defined (__sun__))) || (defined(__FreeBSD__) && __FreeBSD_version >= 503001) || defined(__OpenBSD__) || defined(__NetBSD__)
+  v = copy_int64 (-1); caml_modify (&Field (bufv, 0), v);
+#else
+  v = copy_int64 (buf->f_type); caml_modify (&Field (bufv, 0), v);
+#endif
+  v = copy_int64 (buf->f_bsize); caml_modify (&Field (bufv, 1), v);
+  v = copy_int64 (buf->f_blocks); caml_modify (&Field (bufv, 2), v);
+  v = copy_int64 (buf->f_bfree); caml_modify (&Field (bufv, 3), v);
+  v = copy_int64 (buf->f_bavail); caml_modify (&Field (bufv, 4), v);
+  v = copy_int64 (buf->f_files); caml_modify (&Field (bufv, 5), v);
+  v = copy_int64 (buf->f_ffree); caml_modify (&Field (bufv, 6), v);
+#if ((defined (sun) || defined (__sun__)))
+  v = copy_int64 (-1); caml_modify (&Field (bufv, 7), v);
+  v = copy_int64 (buf->f_namemax); caml_modify (&Field (bufv, 8), v);
+  v = copy_string (buf->f_basetype); caml_modify (&Field (bufv, 9), v);
+  v = copy_int64 (buf->f_frsize); caml_modify (&Field (bufv, 10), v);
+#else
+#if (defined(__FreeBSD__) && __FreeBSD_version >= 503001) || defined(__OpenBSD__) || defined(__NetBSD__)
+#  if defined(__OpenBSD__) || defined(__NetBSD__)
+#    include <sys/syslimits.h>
+  v = copy_int64 (NAME_MAX); caml_modify (&Field (bufv, 8), v);
+#  else
+  v = copy_int64 (buf->f_namemax); caml_modify (&Field (bufv, 8), v);
+#  endif
+  v = copy_string (buf->f_fstypename); caml_modify (&Field (bufv, 9), v);
+#else
+  v = copy_int64 (buf->f_namelen); caml_modify (&Field (bufv, 8), v);
+  v = copy_string ("-1"); caml_modify (&Field (bufv, 9), v);
+#endif
+  caml_modify (&Field (bufv, 7), Val_unit);
+  v = copy_int64 (-1); caml_modify (&Field (bufv, 10), v);
+#endif
+  CAMLreturn (bufv);
+}
+
+CAMLprim value
+statfs_statfs (value pathv)
+{
+  CAMLparam1 (pathv);
+  CAMLlocal1 (bufv);
+  const char *path = String_val (pathv);
+#if ((defined (sun) || defined (__sun__)))
+  struct statvfs buf;
+  if (statvfs (path, &buf) == -1)
+#else
+  struct statfs buf;
+  if (statfs (path, &buf) == -1)
+#endif
+    caml_failwith (strerror (errno));
+  bufv = copy_statfs (&buf);
+  CAMLreturn (bufv);
+}
+
+CAMLprim value
+statfs_fstatfs (value fdv)
+{
+  CAMLparam1 (fdv);
+  CAMLlocal1 (bufv);
+  int fd = Int_val (fdv);
+#if ((defined (sun) || defined (__sun__)))
+  struct statvfs buf;
+  if (fstatvfs (fd, &buf) == -1)
+#else
+  struct statfs buf;
+  if (fstatfs (fd, &buf) == -1)
+#endif
+    caml_failwith (strerror (errno));
+  bufv = copy_statfs (&buf);
+  CAMLreturn (bufv);
+}
+#endif
diff CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x *.rej -x *.orig -x .cvsignore -N -r -u ./src/daemon/driver/driverCommands.ml ./src/daemon/driver/driverCommands.ml
--- ./src/daemon/driver/driverCommands.ml	Mon Jul 11 01:19:16 2005
+++ ./src/daemon/driver/driverCommands.ml	Tue Jul 12 20:11:54 2005
@@ -1771,7 +1771,24 @@
         shared_check_files ();
         _s "check done"
     ), ":\t\t\t\tcheck shared files for removal";
-    
+
+    "disk", Arg_one (fun arg o ->
+        let buf = o.conn_buf in
+        Printf.bprintf buf "working on dir %s\n" arg;
+        Printf.bprintf buf "bsize %Ld\n" (MlUnix.bsize arg);
+        Printf.bprintf buf "blocks %Ld\n" (MlUnix.blocks arg);
+        Printf.bprintf buf "bfree %Ld\n" (MlUnix.bfree arg);
+        Printf.bprintf buf "bavail %Ld\n" (MlUnix.bavail arg);
+        Printf.bprintf buf "fnamelen %Ld\n" (MlUnix.fnamelen arg);
+        Printf.bprintf buf "filesystem %s\n" (MlUnix.filesystem arg);
+        Printf.bprintf buf "disktotal %Ld\n" (MlUnix.disktotal arg);
+        Printf.bprintf buf "diskfree %Ld\n" (MlUnix.diskfree arg);
+        Printf.bprintf buf "diskused %Ld\n" (MlUnix.diskused arg);
+        Printf.bprintf buf "percentused %d\n" (MlUnix.percentused arg);
+	Printf.bprintf buf "percentfree %d\n" (MlUnix.percentfree arg);
+        _s ""
+    ), ":debug command";
+
     "shares", Arg_none (fun o ->
 
         let buf = o.conn_buf in
@@ -1794,10 +1811,14 @@
 \\<tr\\>\\<td\\>";
 
             html_mods_table_header buf "sharesTable" "shares" [ 
-              ( "0", "srh ac", "Click to unshare directory", "Unshare" ) ; 
-              ( "1", "srh ar", "Priority", "P" ) ; 
+              ( "0", "srh ac", "Click to unshare directory", "Unshare" ) ;
+              ( "1", "srh ar", "Priority", "P" ) ;
               ( "0", "srh", "Directory", "Directory" ) ;
-              ( "0", "srh", "Strategy", "Strategy" ) ]; 
+              ( "0", "srh", "Strategy", "Strategy" ) ;
+              ( "1", "srh ar", "MB used", "MB used" ) ;
+              ( "1", "srh ar", "MB free", "MB free" ) ;
+              ( "1", "srh ar", "% free", "% free" ) ;
+              ( "0", "srh", "Filesystem", "FS" ) ];
             
             let counter = ref 0 in
 
@@ -1806,26 +1827,86 @@
 \\<td class=\\\"sr ar\\\"\\>0\\</td\\>\\<td title=\\\"Incoming\\\" class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>" !!incoming_directory;
 *)
 
-            List.iter (fun shared_dir -> 
+            List.iter (fun shared_dir ->
+              let dir = shared_dir.shdir_dirname in
                 incr counter;
                 Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\>
-        \\<td title=\\\"Click to unshare this directory\\\" 
-        onMouseOver=\\\"mOvr(this);\\\" 
+        \\<td title=\\\"Click to unshare this directory\\\"
+        onMouseOver=\\\"mOvr(this);\\\"
         onMouseOut=\\\"mOut(this);\\\"
         onClick=\\\'javascript:{ 
-        parent.fstatus.location.href=\\\"submit?q=unshare+\\\\\\\"%s\\\\\\\"\\\"; 
+        parent.fstatus.location.href=\\\"submit?q=unshare+\\\\\\\"%s\\\\\\\"\\\";
         setTimeout(\\\"window.location.reload()\\\",1000);}'
         class=\\\"srb\\\"\\>Unshare\\</td\\>
         \\<td class=\\\"sr ar\\\"\\>%d\\</td\\>
         \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+        \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+        \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+        \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+        \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
         \\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>"
                 (if !counter mod 2 == 0 then "dl-1" else "dl-2")
-                shared_dir.shdir_dirname
+                dir
                 shared_dir.shdir_priority
-                shared_dir.shdir_dirname
-                shared_dir.shdir_strategy;
+                dir
+                shared_dir.shdir_strategy
+                (if (MlUnix.diskused dir) = Int64.of_int (-1) then "---"
+                  else (size_of_int64 (MlUnix.diskused dir)))
+                (if (MlUnix.diskfree dir) = Int64.of_int (-1) then "---"
+                  else (size_of_int64 (MlUnix.diskfree dir)))
+                (if (MlUnix.percentfree dir) = (-1) then "---"
+                  else string_of_int(MlUnix.percentfree dir))
+                (MlUnix.filesystem dir);
             )
             !!shared_directories;
+ 
+		 incr counter;
+	       let dir = !!temp_directory in
+		 Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\>
+	 \\<td title=\\\"\\\"
+	 class=\\\"srb\\\"\\>------\\</td\\>
+	 \\<td class=\\\"sr ar\\\"\\>%d\\</td\\>
+	 \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>"
+		 (if !counter mod 2 == 0 then "dl-1" else "dl-2")
+		 0
+		 dir
+		 "temp_directory"
+	       (if (MlUnix.diskused dir) = Int64.of_int (-1) then "---"
+		 else (size_of_int64 (MlUnix.diskused dir)))
+	       (if (MlUnix.diskfree dir) = Int64.of_int (-1) then "---"
+		 else (size_of_int64 (MlUnix.diskfree dir)))
+	       (if (MlUnix.percentfree dir) = (-1) then "---"
+		 else string_of_int(MlUnix.percentfree dir))
+	       (MlUnix.filesystem dir);
+ 
+	     let dir = Sys.getcwd () in
+		 incr counter;
+		 Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\>
+	 \\<td title=\\\"\\\"
+	 class=\\\"srb\\\"\\>------\\</td\\>
+	 \\<td class=\\\"sr ar\\\"\\>%d\\</td\\>
+	 \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+	 \\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>"
+		 (if !counter mod 2 == 0 then "dl-1" else "dl-2")
+		 0
+		 dir
+		 "core_directory"
+	       (if (MlUnix.diskused dir) = Int64.of_int (-1) then "---"
+		 else (size_of_int64 (MlUnix.diskused dir)))
+	       (if (MlUnix.diskfree dir) = Int64.of_int (-1) then "---"
+		 else (size_of_int64 (MlUnix.diskfree dir)))
+	       (if (MlUnix.percentfree dir) = (-1) then "---"
+		 else string_of_int(MlUnix.percentfree dir))
+	       (MlUnix.filesystem dir);
 
             Printf.bprintf buf "\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>";
           end
