delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/01/16:38:23

X-Spam-Check-By: sourceware.org
Date: Thu, 1 Dec 2005 22:38:06 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Call for testing Cygwin snapshot (problem with inode numbers)
Message-ID: <20051201213806.GM2999@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20051130171137 DOT GE2999 AT calimero DOT vinschen DOT de> <57A85FA1-5088-4CB9-8998-9853FC0DDBB1 AT rehley DOT net>
Mime-Version: 1.0
In-Reply-To: <57A85FA1-5088-4CB9-8998-9853FC0DDBB1@rehley.net>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

--YkJPYEFdoxh/AXLE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Dec  1 13:01, Peter Rehley wrote:
>   It only appears to be a problem  
> when I have a mac os x share mounted to a drive on windows.    When I  
> try with a windows share or a linux share I don't seem to have the  
> problem.
> 
> The problem that I'm seeing is that the inode value isn't unique when  
> listing a directory (or using any program that uses the inode value).

Do I understand you right that this only happens for directories?  The
normal file inodes are looking ok?

> The inode that comes back from doing a ls -li is first much shorter  
> that a normal inode.  I've included lists from my share when using  
> the 20051123 snapshot and then they 20051128 snapshot.  The only  
> change that I've done between the two is update cygwin using the  
> cygwin-inst snapshot file.

Yes, I have no Mac OS X handy.  I have attached two hacked test
applications, which you can simply build with `gcc -o foo foo.c'.

The first one, GetVolInfo, should get a Cygwin path to any file on the
Mac OS X share.  It prints the volume information returned from the
share.

The second one, GetFileInfo, should be called on a few directories and a
couple of files on the share.

The output of both tests might be helpful.

And another thing to try.  Could you please check (only with the latest
snapshot) if the resulting inode numbers are the same when running

 $ cd /local/cygwin/dir && ls -i //MacOSX/share/dir

and 

 $ cd //MacOSX/share && ls -i dir

?


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--YkJPYEFdoxh/AXLE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="GetVolInfo.c"

#include <stdio.h>
#include <string.h>
#include <sys/cygwin.h>
#define _WIN32_WINNT 0x0500
#include <windows.h>

#ifndef FILE_READ_ONLY_VOLUME
#define FILE_READ_ONLY_VOLUME 0x80000
#endif

int
main (int argc, char **argv)
{
  char winpath[256];
  char rootdir[256];
  char volname[256];
  char fsname[256];
  DWORD sernum = 0;
  DWORD maxlen = 0;
  DWORD flags = 0;

  if (argc < 2)
    {
      fprintf (stderr, "usage: %s path\n", argv[0]);
      return 1;
    }
  cygwin_conv_to_full_win32_path (argv[1], winpath);
  if (!GetVolumePathName(winpath, rootdir, 256))
    {
      fprintf (stderr, "GetVolumePathName: %d\n", GetLastError ());
      return 1;
    }
  printf ("rootdir: %s\n", rootdir);
  if (!GetVolumeInformation (rootdir, volname, 256, &sernum,
  			     &maxlen, &flags, fsname, 256))
    {
      fprintf (stderr, "GetVolumeInformation: %d\n", GetLastError ());
      return 1;
    }
  printf ("Volume Name        : <%s>\n", volname);
  printf ("Serial Number      : %lu\n", sernum);
  printf ("Max Filenamelength : %lu\n", maxlen);
  printf ("Filesystemname     : <%s>\n", fsname);
  printf ("Flags:\n");

  printf ("  FILE_CASE_SENSITIVE_SEARCH  : %s\n",
  	  (flags & FILE_CASE_SENSITIVE_SEARCH) ? "TRUE" : "FALSE");

  printf ("  FILE_CASE_PRESERVED_NAMES   : %s\n",
  	  (flags & FILE_CASE_PRESERVED_NAMES) ? "TRUE" : "FALSE");

  printf ("  FILE_UNICODE_ON_DISK        : %s\n",
  	  (flags & FILE_UNICODE_ON_DISK) ? "TRUE" : "FALSE");

  printf ("  FILE_PERSISTENT_ACLS        : %s\n",
  	  (flags & FILE_PERSISTENT_ACLS) ? "TRUE" : "FALSE");

  printf ("  FILE_FILE_COMPRESSION       : %s\n",
  	  (flags & FILE_FILE_COMPRESSION) ? "TRUE" : "FALSE");

  printf ("  FILE_VOLUME_QUOTAS          : %s\n",
  	  (flags & FILE_VOLUME_QUOTAS) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_SPARSE_FILES  : %s\n",
  	  (flags & FILE_SUPPORTS_SPARSE_FILES) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_REPARSE_POINTS: %s\n",
  	  (flags & FILE_SUPPORTS_REPARSE_POINTS) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_REMOTE_STORAGE: %s\n",
  	  (flags & FILE_SUPPORTS_REMOTE_STORAGE) ? "TRUE" : "FALSE");

  printf ("  FILE_VOLUME_IS_COMPRESSED   : %s\n",
  	  (flags & FILE_VOLUME_IS_COMPRESSED) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_OBJECT_IDS    : %s\n",
  	  (flags & FILE_SUPPORTS_OBJECT_IDS) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_ENCRYPTION    : %s\n",
  	  (flags & FILE_SUPPORTS_ENCRYPTION) ? "TRUE" : "FALSE");

  printf ("  FILE_NAMED_STREAMS          : %s\n",
  	  (flags & FILE_NAMED_STREAMS) ? "TRUE" : "FALSE");

  printf ("  FILE_READ_ONLY_VOLUME       : %s\n",
  	  (flags & FILE_READ_ONLY_VOLUME) ? "TRUE" : "FALSE");
  return 0;
}

--YkJPYEFdoxh/AXLE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="GetFileInfo.c"

#include <stdio.h>
#include <stdlib.h>
#include <sys/cygwin.h>
#include <windows.h>

int main(int argc, char **argv)
{
  HANDLE h;
  BY_HANDLE_FILE_INFORMATION local;
  char winpath[256];

  while (--argc > 0) {
    cygwin_conv_to_full_win32_path (*++argv, winpath);
    if (h = CreateFile(winpath, GENERIC_READ,
		       FILE_SHARE_READ | FILE_SHARE_WRITE,
		       NULL, OPEN_EXISTING,
		       FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS,
		       NULL)) {
      if (GetFileInformationByHandle (h, &local)) {
	printf("%s:\nFileAttributes: %20lx\n"
	       "VolumeSerialNo: %20lu       NumberOfLinks : %20lu\n"
	       "FileIndexHigh : %20lx       FileIndexLow  : %20lx\n",
	       winpath, local.dwFileAttributes,
	       local.dwVolumeSerialNumber, local.nNumberOfLinks, 
	       local.nFileIndexHigh, local.nFileIndexLow);
      }
      CloseHandle(h);
    }
  }

  return 0;
}


--YkJPYEFdoxh/AXLE
Content-Type: text/plain; charset=us-ascii

--
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/
--YkJPYEFdoxh/AXLE--

- Raw text -


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