tweaked to better handle owfs. full path to temp file required