clean file resource buffer