Just a note for future me...
Background I'm running a RasPiCam as a security camera, with basic motion detection on a low res image taken at about 1fps and a high res image taken when motion is detected.
This obviously would be no use if some thieving wotsit grabbed it off the wall, so I upload the images to dropbox automatically (other services are available).
In order to preserve the SD card (and my sanity) I am using a tmpfs to hold the picture, and inotifywait to monitor said directory - this is great, I get notified on MOVED_TO (which is the last thing raspistill does when it writes a file to disk.
However my processing of that data to provide a filename to my upload script was done with a single line of awk - but mawk (debian default) buffers input when it's a pipe....
So it would do nothing until about 10 files had been written and then upload them all. To deal with this apply the -Wi (or -W interactive) option to awk - this turns off the buffering of i/o (or rather makes it buffer by line rather than buffer size).
Now I get an uploaded image of any motion within about 3-5 seconds - with the camera LED disabled in the config file that's plenty quick enough.