fix #230

fixes #230 and related issues

added fix for writing to full file e.g. /dev/full (tests are linux only).