# cmake -E tar fails to create archive on Windows 10 with "CMake Error: archive\_write\_header: Can't record entry in tar file without pathname"

**URL:** https://discourse.cmake.org/t/cmake-e-tar-fails-to-create-archive-on-windows-10-with-cmake-error-archive-write-header-cant-record-entry-in-tar-file-without-pathname/586
**Category:** Usage
**Tags:** os:windows
**Created:** [February 6, 2020, 7:55am UTC](https://discourse.cmake.org/t/cmake-e-tar-fails-to-create-archive-on-windows-10-with-cmake-error-archive-write-header-cant-record-entry-in-tar-file-without-pathname/586 "2020-02-06T07:55:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ivanonys](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ivanonys/32/341_2.png) [@ivanonys](https://discourse.cmake.org/u/ivanonys)
#### Post date: [February 6, 2020, 7:55am UTC](https://discourse.cmake.org/t/cmake-e-tar-fails-to-create-archive-on-windows-10-with-cmake-error-archive-write-header-cant-record-entry-in-tar-file-without-pathname/586/1 "2020-02-06T07:55:37Z")

</div>

Hi,  
c:\work\test\_cmake\_tar\>cmake -E tar c out.tar – file.txt  
CMake Error: archive\_write\_header: Can’t record entry in tar file without pathname  
CMake Error: Problem creating tar: out.tar  
c:\work\test\_cmake\_tar\>type file.txt  
Hi to builting tar archiver  
c:\work\test\_cmake\_tar\>cmake --version  
cmake version 3.16.3

CMake suite maintained and supported by Kitware ([kitware.com/cmake](http://kitware.com/cmake)).

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 16, 2020, 12:48am UTC](https://discourse.cmake.org/t/cmake-e-tar-fails-to-create-archive-on-windows-10-with-cmake-error-archive-write-header-cant-record-entry-in-tar-file-without-pathname/586/2 "2020-02-16T00:48:50Z")

</div>

> [@ivanonys](#):
>
> cmake -E tar c out.tar – file.txt

The `-` looks like a typo since I doubt you have a file named that. Did you mean to pass that as an argument?
