Index: config/gen/platform/generic/stat.c
===================================================================
RCS file: /cvs/public/parrot/config/gen/platform/generic/stat.c,v
retrieving revision 1.3
diff -u -d -r1.3 stat.c
--- config/gen/platform/generic/stat.c	8 Oct 2004 09:45:03 -0000	1.3
+++ config/gen/platform/generic/stat.c	8 Oct 2004 15:11:14 -0000
@@ -78,18 +78,10 @@
     result = statbuf.st_rdev;
     break;
   case STAT_PLATFORM_BLOCKSIZE:
-#if defined(WIN32)
-    internal_exception(1, "STAT_PLATFORM_BLOCKSIZE not implemented");
-#else
     result = statbuf.st_blksize;
-#endif
     break;
   case STAT_PLATFORM_BLOCKS:
-#if defined(WIN32)
-    internal_exception(1, "STAT_PLATFORM_BLOCKS not implemented");
-#else
     result = statbuf.st_blocks;
-#endif
     break;
   }
   
@@ -157,18 +149,10 @@
     result = statbuf.st_rdev;
     break;
   case STAT_PLATFORM_BLOCKSIZE:
-#if defined(WIN32)
-    internal_exception(1, "STAT_PLATFORM_BLOCKSIZE not implemented");
-#else
     result = statbuf.st_blksize;
-#endif
     break;
   case STAT_PLATFORM_BLOCKS:
-#if defined(WIN32)
-    internal_exception(1, "STAT_PLATFORM_BLOCKS not implemented");
-#else
     result = statbuf.st_blocks;
-#endif
     break;
   }
 
Index: config/gen/platform/win32/stat.c
===================================================================
RCS file: config/gen/platform/win32/stat.c
diff -N config/gen/platform/win32/stat.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ config/gen/platform/win32/stat.c	8 Oct 2004 15:11:14 -0000
@@ -0,0 +1,172 @@
+/*
+ * File stat stuff
+ */
+
+PMC *
+Parrot_stat_file(Parrot_Interp interpreter, STRING *filename)
+{
+  return NULL;
+}
+
+PMC *
+Parrot_stat_info_pmc(Parrot_Interp interpreter, STRING *filename, INTVAL thing)
+{
+  return NULL;
+}
+
+INTVAL
+Parrot_stat_info_intval(Parrot_Interp interpreter, STRING *file, INTVAL thing)
+{
+  struct stat statbuf;
+  char *filename;
+  INTVAL result = -1;
+  int status;
+
+  /* Get the name of the file as something we can use */
+  filename = string_to_cstring(interpreter, file);
+
+  /* Everything needs the result of stat, so just go do it */
+  status = stat(filename, &statbuf);
+
+  switch (thing) {
+  case STAT_EXISTS:
+    result = (status == 0);
+    break;
+  case STAT_FILESIZE:
+    result = statbuf.st_size;
+    break;
+  case STAT_ISDIR:
+    result = S_ISDIR(statbuf.st_mode);
+    break;
+  case STAT_ISDEV:
+    result = S_ISCHR(statbuf.st_mode) || S_ISBLK(statbuf.st_mode);
+    break;
+  case STAT_CREATETIME:
+    result = -1;
+    break;
+  case STAT_ACCESSTIME:
+    result = statbuf.st_atime;
+    break;
+  case STAT_MODIFYTIME:
+    result = statbuf.st_mtime;
+    break;
+  case STAT_CHANGETIME:
+    result = statbuf.st_ctime;
+    break;
+  case STAT_BACKUPTIME:
+    result = -1;
+    break;
+  case STAT_UID:
+    result = statbuf.st_uid;
+    break;
+  case STAT_GID:
+    result = statbuf.st_gid;
+    break;
+  case STAT_PLATFORM_DEV:
+    result = statbuf.st_dev;
+    break;
+  case STAT_PLATFORM_INODE:
+    result = statbuf.st_ino;
+    break;
+  case STAT_PLATFORM_MODE:
+    result = statbuf.st_mode;
+    break;
+  case STAT_PLATFORM_NLINKS:
+    result = statbuf.st_nlink;
+    break;
+  case STAT_PLATFORM_DEVTYPE:
+    result = statbuf.st_rdev;
+    break;
+  case STAT_PLATFORM_BLOCKSIZE:
+    internal_exception(1, "STAT_PLATFORM_BLOCKSIZE not supported");
+    break;
+  case STAT_PLATFORM_BLOCKS:
+    internal_exception(1, "STAT_PLATFORM_BLOCKS not supported");
+    break;
+  }
+  
+  string_cstring_free(filename);
+  return result;
+}
+
+INTVAL
+Parrot_fstat_info_intval(Parrot_Interp interpreter, INTVAL file, INTVAL thing)
+{
+  struct stat statbuf;
+  INTVAL result = -1;
+  int status;
+
+  /* Everything needs the result of stat, so just go do it */
+  status = fstat(file, &statbuf);
+
+  switch (thing) {
+  case STAT_EXISTS:
+    result = (status == 0);
+    break;
+  case STAT_FILESIZE:
+    result = statbuf.st_size;
+    break;
+  case STAT_ISDIR:
+    result = S_ISDIR(statbuf.st_mode);
+    break;
+  case STAT_ISDEV:
+    result = S_ISCHR(statbuf.st_mode) || S_ISBLK(statbuf.st_mode);
+    break;
+  case STAT_CREATETIME:
+    result = -1;
+    break;
+  case STAT_ACCESSTIME:
+    result = statbuf.st_atime;
+    break;
+  case STAT_MODIFYTIME:
+    result = statbuf.st_mtime;
+    break;
+  case STAT_CHANGETIME:
+    result = statbuf.st_ctime;
+    break;
+  case STAT_BACKUPTIME:
+    result = -1;
+    break;
+  case STAT_UID:
+    result = statbuf.st_uid;
+    break;
+  case STAT_GID:
+    result = statbuf.st_gid;
+    break;
+  case STAT_PLATFORM_DEV:
+    result = statbuf.st_dev;
+    break;
+  case STAT_PLATFORM_INODE:
+    result = statbuf.st_ino;
+    break;
+  case STAT_PLATFORM_MODE:
+    result = statbuf.st_mode;
+    break;
+  case STAT_PLATFORM_NLINKS:
+    result = statbuf.st_nlink;
+    break;
+  case STAT_PLATFORM_DEVTYPE:
+    result = statbuf.st_rdev;
+    break;
+  case STAT_PLATFORM_BLOCKSIZE:
+    internal_exception(1, "STAT_PLATFORM_BLOCKSIZE not supported");
+    break;
+  case STAT_PLATFORM_BLOCKS:
+    internal_exception(1, "STAT_PLATFORM_BLOCKS not supported");
+    break;
+  }
+
+  return result;
+}
+
+FLOATVAL
+Parrot_stat_info_floatval(Parrot_Interp interpreter, STRING *filename, INTVAL thing)
+{
+  return -1;
+}
+
+STRING *
+Parrot_stat_info_string(Parrot_Interp interpreter, STRING *filename, INTVAL thing)
+{
+  return NULL;
+}
