# error when writing binary VTK files

**URL:** https://discourse.vtk.org/t/error-when-writing-binary-vtk-files/4487
**Category:** Support
**Tags:** file-formats
**Created:** [October 26, 2020, 8:25am UTC](https://discourse.vtk.org/t/error-when-writing-binary-vtk-files/4487 "2020-10-26T08:25:57Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![cean\_wang](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cean_wang/32/2570_2.png) [@cean\_wang](https://discourse.vtk.org/u/cean_wang)
#### Post date: [January 3, 2021, 10:42am UTC](https://discourse.vtk.org/t/error-when-writing-binary-vtk-files/4487/9 "2021-01-03T10:42:14Z")

</div>

Change this line:  
`fout << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" compressor=\"vtkZLibDataCompressor\">\n";`  
to:  
` fout << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" header_type=\"UInt64\">\n";`

This post has a binary demo file. [Trying to write VTU files from fortran - Support - VTK](https://discourse.vtk.org/t/trying-to-write-vtu-files-from-fortran/470)

---

_[View the full topic](https://discourse.vtk.org/t/error-when-writing-binary-vtk-files/4487)._
