delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/22/13:55:10

X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: Hard links in tar, not untaring as expected
Date: Mon, 22 Jan 2007 13:50:03 -0500
Message-ID: <3D848382FB72E249812901444C6BDB1D0A653DB1@mail.timesys.com>
From: "Sally, Gene" <Gene DOT Sally AT timesys DOT com>
To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l0MIsx8C009217

Hi,

I'm wrestling with an interesting problem.  

Considering a tar file with the following contents (tar tvzf file.tgz)

drwxr-xr-x UserName GroupName 0 2007-01-18 16:35:22 test/
-rw-r--r-- UserName GroupName 9 2007-01-18 16:35:22 test/hardlink
-rw-r--r-- UserName GroupName 0 2007-01-18 16:35:22 test/orig-file link
to test/hardlink

When this file untars, only one of the files is created.  I found this
curious, so when I used strace, I saw the following:

  128  103145 [main] tar 184 unlink: _unlink (c:\home\test\hardlink)
  335  103480 [main] tar 184 unlink: 1 = CloseHandle (0x2AC)
  132  103612 [main] tar 184 unlink: CreateFile
(FILE_FLAG_DELETE_ON_CLOSE) succeeded
   82  103694 [main] tar 184 unlink: 0 = unlink (test/hardlink)

The file is created like this:

   83  107926 [main] tar 184 fhandler_base::open: 0 = NtCreateFile
(0x2AC, 40100080, c:\home\test\hardlink, io, NULL, 80, 7, 2, 20, NULL,
0)

I've tried untaring the file on another Win2K SP4 host, and it works.
Both are using the same Cygwin

App version:  1005.22, api: 0.156
DLL version:  1005.23, api: 0.156
DLL build:    2006-12-19 10:52

Obviously, there's something different, but I can't figure out what that
is.  Is anyone aware of some subtle changes in the win API that could
cause this problem?  Maybe there some permission settings that could
cause this problem? 

Regards,
gene



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019