write vector to disk