Posted to tcl by bairui at Sun Feb 14 06:35:40 GMT 2016view raw

  1. #! /usr/bin/env tclsh
  2. # Code from apn
  3.  
  4. package require promise
  5.  
  6. set promises [lmap path $argv {promise::pexec du -sk $path}]
  7.  
  8. set all_done [promise::all $promises]
  9.  
  10. $all_done then [promise::lambda {outputs} {
  11. foreach output $outputs {puts $output}
  12. } ]
  13.  

Comments

Posted by apn at Sun Feb 14 11:54:17 GMT 2016 [text] [code]

Try this $all_done then [promise::lambda {outputs} { foreach output $outputs {puts $output} }] [promise::lambda {error_message error_dictionary} { puts $error_message }] and see if it tells you anything. Also NOTE you must have the event loop running (e.g. wish or if in tclsh, a vwait or similar)