Revision: 384
          http://rpy.svn.sourceforge.net/rpy/?rev=384&view=rev
Author:   warnes
Date:     2007-11-29 16:40:17 -0800 (Thu, 29 Nov 2007)

Log Message:
-----------
Add appropriate cleanup shell command for Win32

Modified Paths:
--------------
    trunk/rpy/src/RPy.h
    trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/RPy.h
===================================================================
--- trunk/rpy/src/RPy.h 2007-11-29 16:12:07 UTC (rev 383)
+++ trunk/rpy/src/RPy.h 2007-11-30 00:40:17 UTC (rev 384)
@@ -80,7 +80,7 @@
 /* Missing definitions from Rinterface.h or RStartup.h */
 # define CleanEd               Rf_CleanEd
 extern void CleanEd(void);
-extern int     R_CollectWarnings; 
+extern int  R_CollectWarnings; 
 # define PrintWarnings         Rf_PrintWarnings
 extern void PrintWarnings(void);
 /****/

Modified: trunk/rpy/src/rpymodule.c
===================================================================
--- trunk/rpy/src/rpymodule.c   2007-11-29 16:12:07 UTC (rev 383)
+++ trunk/rpy/src/rpymodule.c   2007-11-30 00:40:17 UTC (rev 384)
@@ -1691,8 +1691,14 @@
     CleanEd();              
     KillAllDevices();       
     if((tmpdir = getenv("R_SESSION_TMPDIR"))) {          
-      snprintf((char *)buf, 1024, "rm -rf %s", tmpdir); 
-      R_system((char *)buf);                            
+
+#ifdef _WIN32
+      snprintf((char *)buf, 1024, "rmdir /S /Q %s", tmpdir); 
+#else
+      snprintf((char *)buf, 1024, "rm -rf %s", tmpdir);
+#endif
+
+      R_system((char *)buf);
     }
 
     PrintWarnings();   /* from device close and .Last */
@@ -1842,7 +1848,7 @@
   /* run as "interactive", so server won't be killed after an error */
   Rp->R_Slave = Rp->R_Verbose = 0;
   Rp->R_Interactive = TRUE;
-  Rp->RestoreAction = SA_RESTORE; /* no restore */
+  Rp->RestoreAction = SA_NORESTORE; /* no restore */
   Rp->SaveAction    = SA_NOSAVE;  /* no save */
   
 #if R_VERSION < 0x20000   // pre-R-2.0.0
@@ -1973,15 +1979,13 @@
   // I/O routines
   init_io_routines();
 
-
-
   rpy = PyImport_ImportModule("rpy");
   rpy_dict = PyModule_GetDict(rpy);
   //  r_lock = PyDict_GetItemString(rpy_dict, "_r_lock");
   //  PyObject_Print(r_lock, stderr, Py_PRINT_RAW);
   r_lock = NULL;
 
-  if( Py_AtExit(       r_finalize ) )
+  if( Py_AtExit( r_finalize ) )
     {
       fprintf(stderr, "Warning: Unable to set R finalizer.");
       fflush(stderr);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to