comparison lisp/process.el @ 438:84b14dcb0985 r21-2-27

Import from CVS: tag r21-2-27
author cvs
date Mon, 13 Aug 2007 11:32:25 +0200
parents 3ecd8885ac67
children 8de8e3f6228a
comparison
equal deleted inserted replaced
437:e2a4e8b94b82 438:84b14dcb0985
319 319
320 Ouput via `process-send-string' and input via buffer or filter (see 320 Ouput via `process-send-string' and input via buffer or filter (see
321 `set-process-filter') are stream-oriented. That means UDP datagrams are 321 `set-process-filter') are stream-oriented. That means UDP datagrams are
322 not guaranteed to be sent and received in discrete packets. (But small 322 not guaranteed to be sent and received in discrete packets. (But small
323 datagrams around 500 bytes that are not truncated by `process-send-string' 323 datagrams around 500 bytes that are not truncated by `process-send-string'
324 are usually fine.) Note further that UDP protocol does not guard against 324 are usually fine.) Note further that UDP protocol does not guard against
325 lost packets." 325 lost packets."
326 (open-network-stream-internal name buffer host service protocol)) 326 (open-network-stream-internal name buffer host service protocol))
327 327
328 (defun shell-quote-argument (argument) 328 (defun shell-quote-argument (argument)
329 "Quote an argument for passing as argument to an inferior shell." 329 "Quote an argument for passing as argument to an inferior shell."
340 result (concat result (substring argument start end) 340 result (concat result (substring argument start end)
341 "\\" (substring argument end (1+ end))) 341 "\\" (substring argument end (1+ end)))
342 start (1+ end))) 342 start (1+ end)))
343 (concat result (substring argument start)))))) 343 (concat result (substring argument start))))))
344 344
345 (defun exec-to-string (command) 345 (defun shell-command-to-string (command)
346 "Execute COMMAND as an external process and return the output of that 346 "Execute shell command COMMAND and return its output as a string."
347 process as a string"
348 ;; by "William G. Dubuque" <wgd@zurich.ai.mit.edu>
349 (with-output-to-string 347 (with-output-to-string
350 (call-process shell-file-name nil t nil shell-command-switch command))) 348 (call-process shell-file-name nil t nil shell-command-switch command)))
351 349
352 (defalias 'shell-command-to-string 'exec-to-string) 350 (defalias 'exec-to-string 'shell-command-to-string)
353 351
354 ;;; process.el ends here 352 ;;; process.el ends here