delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/05/12:59:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <3EDF76C9.2FBBD904@ieee.org>
Date: Thu, 05 Jun 2003 12:58:49 -0400
From: "Pierre A. Humblet" <Pierre DOT Humblet AT ieee DOT org>
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Sparse file criteria malfunction - binutils produces sparse .exe &
.dll files

On Thu, 5 Jun 2003, Max Bowsher wrote:

> I threw together a horrible C program to ask Windows whether a file was
> sparse. .exe and .dll files made with a 1.5.0 Cygwin are. I haven't posted
> the test program, because it is too messy.

#include <windows.h>
#include <stdio.h>
main(int argc, char * argv[])
{
	DWORD i = (argc > 1)? GetFileAttributes(argv[1]) : INVALID_FILE_ATTRIBUTES;
	if (i == INVALID_FILE_ATTRIBUTES)
	  printf("Error for %s %ld\n", argv[1], GetLastError());
        else
	  printf("Sparse bit %x\n", i & FILE_ATTRIBUTE_SPARSE_FILE);
}

/: /a.exe a.exe
Sparse bit 0
/: uname -a
CYGWIN_NT-5.0 phumblet 1.5.0(0.86/3/2) 2003-05-28 19:47 i686 unknown unknown
Cygwin


Pierre

--
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