[Bf-committers] Installation/file paths

Kevin Roy kiniou at gmail.com
Wed May 12 01:22:41 CEST 2010


Hello,

When I was digging into the Debian package for blender 2.5, I found the 
following patch to move temporary files into the $HOME/.blender instead 
of /tmp :

*snip*
Index: blender-2.49a+dfsg/source/blender/blenlib/intern/util.c
===================================================================
--- blender-2.49a+dfsg.orig/source/blender/blenlib/intern/util.c 
2009-05-26 19:33:17.000000000 +0100
+++ blender-2.49a+dfsg/source/blender/blenlib/intern/util.c 2009-08-06 
22:44:41.000000000 +0100
@@ -1905,6 +1905,19 @@
         /* add a trailing slash if needed */
         BLI_add_slash(fullname);
     }
+
+   /* don't use /tmp since no special care is taken about
+    * handling temporary files, rather use $HOME/.blender/
+    * instead.
+    */
+   if (strcmp(fullname, "/tmp/")==0) {
+       char *home = getenv("HOME");
+       if (home && BLI_exists(home)) {
+           strcpy(fullname, home);
+           strcat(fullname, "/.blender/");
+       }
+   }
+
  }

  /*

*snip*

It has been applied in this package build since 2.46 but I did not try 
it in 2.5 ... maybe it still works.

This proposal looks great but I have just a question about where and how 
those paths are stored, in .blend or text file?

---
Kevin Roy
http://blog.knokorpo.fr


More information about the Bf-committers mailing list