The R Project SVN R

Rev

Rev 25994 | Rev 31542 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25994 Rev 26152
Line 210... Line 210...
210
    if (isLogical(CADR(args)))
210
    if (isLogical(CADR(args)))
211
	read = INTEGER(CADR(args))[0];
211
	read = INTEGER(CADR(args))[0];
212
    if (read) {
212
    if (read) {
213
#ifdef HAVE_POPEN
213
#ifdef HAVE_POPEN
214
	PROTECT(tlist);
214
	PROTECT(tlist);
215
	fp = popen(CHAR(STRING_ELT(CAR(args), 0)), x);
215
	fp = R_popen(CHAR(STRING_ELT(CAR(args), 0)), x);
216
	for (i = 0; fgets(buf, INTERN_BUFSIZE, fp); i++) {
216
	for (i = 0; fgets(buf, INTERN_BUFSIZE, fp); i++) {
217
	    read = strlen(buf);
217
	    read = strlen(buf);
218
	    if (read < INTERN_BUFSIZE) buf[read - 1] = '\0'; /* chop final CR */
218
	    if (read < INTERN_BUFSIZE) buf[read - 1] = '\0'; /* chop final CR */
219
	    tchar = mkChar(buf);
219
	    tchar = mkChar(buf);
220
	    UNPROTECT(1);
220
	    UNPROTECT(1);
Line 237... Line 237...
237
#ifdef HAVE_AQUA
237
#ifdef HAVE_AQUA
238
    	R_Busy(1);
238
    	R_Busy(1);
239
#endif
239
#endif
240
	tlist = allocVector(INTSXP, 1);
240
	tlist = allocVector(INTSXP, 1);
241
	fflush(stdout);
241
	fflush(stdout);
242
	INTEGER(tlist)[0] = system(CHAR(STRING_ELT(CAR(args), 0)));
242
	INTEGER(tlist)[0] = R_system(CHAR(STRING_ELT(CAR(args), 0)));
243
#ifdef HAVE_AQUA
243
#ifdef HAVE_AQUA
244
    	R_Busy(0);
244
    	R_Busy(0);
245
#endif
245
#endif
246
	R_Visible = 0;
246
	R_Visible = 0;
247
	return tlist;
247
	return tlist;
Line 262... Line 262...
262
	tm = getenv("TMPDIR");
262
	tm = getenv("TMPDIR");
263
	if (!tm) tm = getenv("TMP");
263
	if (!tm) tm = getenv("TMP");
264
	if (!tm) tm = getenv("TEMP");
264
	if (!tm) tm = getenv("TEMP");
265
	if (!tm) tm = "/tmp";
265
	if (!tm) tm = "/tmp";
266
	sprintf(tmp1, "rm -rf %s/Rtmp%u", tm, (unsigned int)getpid());
266
	sprintf(tmp1, "rm -rf %s/Rtmp%u", tm, (unsigned int)getpid());
267
	system(tmp1);
267
	R_system(tmp1);
268
	sprintf(tmp1, "%s/Rtmp%u", tm, (unsigned int)getpid());
268
	sprintf(tmp1, "%s/Rtmp%u", tm, (unsigned int)getpid());
269
	res = mkdir(tmp1, 0755);
269
	res = mkdir(tmp1, 0755);
270
	if(res) R_Suicide("Can't mkdir R_TempDir");
270
	if(res) R_Suicide("Can't mkdir R_TempDir");
271
	tmp = tmp1;
271
	tmp = tmp1;
272
	buf = (char *) malloc((strlen(tmp) + 20) * sizeof(char));
272
	buf = (char *) malloc((strlen(tmp) + 20) * sizeof(char));