From ef8ea97352ae9c34e8c3686057f9ba2e3a363c7e Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Sat, 21 Oct 2017 17:17:45 +1100 Subject: [PATCH] =?UTF-8?q?Add=20Windows=20empty=20tar=20details=20from=20?= =?UTF-8?q?Paul=20Bu=C3=9Fmann?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2008/03/create-empty-tar-file.html | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/content/technical/2008/03/create-empty-tar-file.html b/content/technical/2008/03/create-empty-tar-file.html index 850c7ef..af3ab56 100644 --- a/content/technical/2008/03/create-empty-tar-file.html +++ b/content/technical/2008/03/create-empty-tar-file.html @@ -1,4 +1,6 @@ -Strangely enough I had the need to determine if it was possible to create a valid but empty tar file. Turns out it is. The method varies slightly depending on your flavour of tar program, here's how to do it on three of the big ones: +Strangely enough I had the need to determine if it was possible to create a +valid but empty tar file. Turns out it is. The method varies slightly depending +on your flavour of tar program, here's how to do it on three of the big ones: BSD tar cvf empty.tar --from-file /dev/null @@ -9,4 +11,15 @@ Strangely enough I had the need to determine if it was possible to create a vali Solaris tar cvf empty.tar -I /dev/null -Now if you wondering why I would want this, here's the explanation. I work on a batch processing system that processes files delivered from other systems. In some cases its necessary to wait for a file to arrive but give up after some time. In order to give up we copy an empty file (automatically) so that the processing proceeds normally. Ordinarily this is an empty plain text file but for the system I'm working on I'm expecting a tar file, hence the need for an empty one. \ No newline at end of file +MinGW / MSYS +tar cvf empty.tar --files-from NUL + +Thanks to Paul Bußmann for the MSYS suggestion. + +Now if you wondering why I would want this, here's the explanation. I work on a +batch processing system that processes files delivered from other systems. In +some cases its necessary to wait for a file to arrive but give up after some +time. In order to give up we copy an empty file (automatically) so that the +processing proceeds normally. Ordinarily this is an empty plain text file but +for the system I'm working on I'm expecting a tar file, hence the need for an +empty one.