Reverted back to writing files via descriptors