Check for swap file before writing.