[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23986] trunk/blender/source/blender/ blenlib/intern/BLI_bfile.c: Rearrange includes, and more fill_paths code.
gsr b3d
gsr.b3d at infernal-iceberg.com
Tue Oct 20 04:20:08 CEST 2009
Revision: 23986
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23986
Author: gsrb3d
Date: 2009-10-20 04:20:00 +0200 (Tue, 20 Oct 2009)
Log Message:
-----------
Rearrange includes, and more fill_paths code.
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/BLI_bfile.c
Modified: trunk/blender/source/blender/blenlib/intern/BLI_bfile.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_bfile.c 2009-10-20 00:45:51 UTC (rev 23985)
+++ trunk/blender/source/blender/blenlib/intern/BLI_bfile.c 2009-10-20 02:20:00 UTC (rev 23986)
@@ -27,12 +27,12 @@
#include <string.h>
#include <stdlib.h>
#ifndef WIN32
- #include <unistd.h>
+ #include <unistd.h>
+ #include <sys/param.h>
#else
- #include <io.h>
- #include "BLI_winstuff.h"
+ #include <io.h>
+ #include "BLI_winstuff.h"
#endif
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -465,13 +465,16 @@
*/
void fill_paths(BFILE *bfile, const char *path) {
char* source_path = NULL;
+ char* temp_path = NULL;
int bflags = bfile->uflags;
if(bflags & BFILE_NORMAL || bflags & BFILE_RAW) {
// bfile->fpath is path with // replaced
}
if(bflags & BFILE_TEMP) {
-// bfile->fpath is tempdir+path
+ temp_path = MEM_mallocN(MAXPATHLEN, "bfile-fpath-1");
+ snprintf(temp_path, MAXPATHLEN, "%s/%s", getenv("BLENDER_TEMP"), path);
+ bfile->fpath = temp_path;
}
if(bflags & BFILE_CONFIG) {
// bfile->fpath is userdir+version+path
@@ -482,7 +485,9 @@
if(bfile->classf & BCF_WRITE && !(bflags & BFILE_RAW)) {
/* Generate temp path */
- // bfile->tpath is fpath+randstring
+ temp_path = MEM_mallocN(MAXPATHLEN, "bfile-fpath-2");
+ snprintf(temp_path, MAXPATHLEN, "%s.XXXXXX", path);
+ bfile->tpath = mkdtemp(temp_path);
if(!(bfile->classf & BCF_DISCARD)) {
/* Copy data to tpath */
if(source_path) {
More information about the Bf-blender-cvs
mailing list