Mercurial > octave-nkf
comparison src/dirfns.cc @ 1449:df589c97e140
[project @ 1995-09-20 03:49:51 by jwe]
author | jwe |
---|---|
date | Wed, 20 Sep 1995 03:49:51 +0000 |
parents | 6550c74777b9 |
children | 2f85a175308f |
comparison
equal
deleted
inserted
replaced
1448:067f11a46742 | 1449:df589c97e140 |
---|---|
60 #include "statdefs.h" | 60 #include "statdefs.h" |
61 #include "sysdep.h" | 61 #include "sysdep.h" |
62 #include "sysdir.h" | 62 #include "sysdir.h" |
63 #include "tree-const.h" | 63 #include "tree-const.h" |
64 #include "tree-plot.h" | 64 #include "tree-plot.h" |
65 #include "unwind-prot.h" | |
65 #include "utils.h" | 66 #include "utils.h" |
66 | 67 |
67 extern "C" | 68 extern "C" |
68 { | 69 { |
69 #include <readline/tilde.h> | 70 #include <readline/tilde.h> |
425 ls_buf << tmp << " "; | 426 ls_buf << tmp << " "; |
426 free (tmp); | 427 free (tmp); |
427 } | 428 } |
428 | 429 |
429 ls_buf << ends; | 430 ls_buf << ends; |
430 | |
431 char *ls_command = ls_buf.str (); | 431 char *ls_command = ls_buf.str (); |
432 | |
433 iprocstream cmd (ls_command); | |
434 | |
435 char ch; | |
436 ostrstream output_buf; | |
437 while (cmd.get (ch)) | |
438 output_buf.put (ch); | |
439 | |
440 output_buf << ends; | |
441 | |
442 maybe_page_output (output_buf); | |
443 | |
444 delete [] ls_command; | 432 delete [] ls_command; |
433 | |
434 iprocstream *cmd = new iprocstream (ls_command); | |
435 | |
436 add_unwind_protect (cleanup_iprocstream, cmd); | |
437 | |
438 if (cmd && *cmd) | |
439 { | |
440 int ch; | |
441 ostrstream output_buf; | |
442 while ((ch = cmd->get ()) != EOF) | |
443 output_buf << (char) ch; | |
444 output_buf << ends; | |
445 | |
446 maybe_page_output (output_buf); | |
447 } | |
448 else | |
449 error ("couldn't start process for ls!"); | |
450 | |
451 run_unwind_protect (); | |
445 | 452 |
446 DELETE_ARGV; | 453 DELETE_ARGV; |
447 | 454 |
448 return retval; | 455 return retval; |
449 } | 456 } |