Changeset 1176
- Timestamp:
- 2000-05-19T16:56:01+12:00 (24 years ago)
- Location:
- trunk/gsdl/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/gsdltools.cpp
r1146 r1176 28 28 /* 29 29 $Log$ 30 Revision 1.5 2000/05/19 04:56:01 sjboddie 31 added gsdl_system function for spawning off new processes under windows 32 30 33 Revision 1.4 2000/05/04 05:16:23 sjboddie 31 34 Moved dm_safe from htmlutils to gsdltools. Also made it escape '\' … … 67 70 } 68 71 72 // gsdl_system spawns a completely separate program (i.e. the calling 73 // program continues and terminates normally). Arguments containing special 74 // characters (e.g. '&') should be quoted with "" 75 76 // on unix systems youcan get the same effext as this function by doing a 77 // system call and putting the spawned process in the background 78 // (e.g. system (funcname options &); 79 80 #if defined (__WIN32__) 81 #include <windows.h> 82 void gsdl_system (char *cmd, ostream &logout) { 83 84 STARTUPINFO ps = {sizeof(STARTUPINFO), NULL, NULL, NULL, 85 0, 0, 0, 0, 0, 0, 86 0, 0, 87 0, 0, NULL, 88 NULL, NULL, NULL}; 89 PROCESS_INFORMATION pi; 90 BOOL res = CreateProcess(NULL, 91 cmd, 92 NULL, 93 NULL, 94 FALSE, 95 DETACHED_PROCESS, 96 NULL, 97 NULL, 98 &ps, 99 &pi); 100 if (!res) { 101 logout << "Failed to start " << cmd << " process, error code " << GetLastError(); 102 } 103 104 CloseHandle(pi.hProcess); 105 CloseHandle(pi.hThread); 106 } 107 108 #endif -
trunk/gsdl/lib/gsdltools.h
r1146 r1176 44 44 text_t dm_safe (const text_t &instring); 45 45 46 47 // gsdl_system spawns a completely separate program (i.e. the calling 48 // program continues and terminates normally). Arguments containing special 49 // characters (e.g. '&') should be quoted with "" 50 51 // on unix systems youcan get the same effext as this function by doing a 52 // system call and putting the spawned process in the background 53 // (e.g. system (funcname options &); 54 #if defined (__WIN32__) 55 void gsdl_system (char *cmd, ostream &logout); 46 56 #endif 57 58 #endif
Note:
See TracChangeset
for help on using the changeset viewer.