Update writepipe.m