View Single Post
Old 10 January 2007, 05:13   #44
thor
Registered User
thor's Avatar
 
Join Date: Mar 2006
Location: Germany
Posts: 898
Fix for not being able to write the temp file (for x and z commands) under Windows in xdms.c as there is no /tmp:

add (needs to be before #include "cdata.h")
Code:
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
because of that you'll need to change FILE_END to something else in your files (or try to get MS change it in theirs )

and replace
Code:
			strcpy(tname, "/tmp/xdmsXXXXXX");
with
Code:
#ifdef _WIN32
			DWORD ret = 0;
			DWORD bufsize = FNAME_MAXC-10;

			ret = GetTempPath(bufsize, tname);
    			if (!ret || ret > bufsize) {
				fprintf(stderr, "Couldn't get temp dir\n");
				exit(-1);
			}
			strcat(tname, "xdmsXXXXXX");
#else
			strcpy(tname, "/tmp/xdmsXXXXXX");
#endif

Last edited by thor; 11 January 2007 at 23:12.
thor is offline  
 
Page generated in 0.04862 seconds with 9 queries