2

Imagine that I have a device continually and sequentially saving files to a specified directory on a Windows machine (such as [E:\ExampleDir]). Call this device a camera with some proprietary drivers and software that precludes a direct interface, perhaps via the use of CurrentImage[] which works with many web cameras.

Without allowing files to be overwritten, and acknowledging that there will be an associated lag, is there an easy way for me to use Dynamic to import and display the image associated with the chronologically newest file in the directory as soon as it is saved there by the device?

Kuba
  • 136,707
  • 13
  • 279
  • 740
  • 1
    Perhaps something like Dynamic[Refresh[If[FileDate[..]..], UpdateInterval -> 10]], as a start? – Michael E2 Jul 08 '13 at 23:25
  • please have a look at here: http://mathematica.stackexchange.com/a/27296/2448 – Stefan Jul 08 '13 at 23:26
  • Perhaps using scheduled tasks as in this answer might be useful... In fact, if you replace the Print statement with an Import statement, it is the same question (unless if you insist on using Dynamic for some reason). – rm -rf Jul 08 '13 at 23:29
  • It wouldn't be wise to use Dynamic here as it requires that the Dynamic object be visible in order for the updating to take place. You need background tasks as used in rm-rf's linked answer. – Sjoerd C. de Vries Jan 09 '14 at 16:44

0 Answers0