Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: <00c701c32b84$6632f980$78d96f83@pomello> From: "Max Bowsher" To: References: <20030605160847 DOT GZ875 AT cygbert DOT vinschen DOT de> <006901c32b7f$0d7cceb0$78d96f83 AT pomello> <20030605164123 DOT GB875 AT cygbert DOT vinschen DOT de> Subject: Re: Sparse file criteria malfunction - binutils produces sparse .exe & .dll files Date: Thu, 5 Jun 2003 18:03:34 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00C4_01C32B8C.C7C66670" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Cam-ScannerAdmin: mail-scanner-support AT ucs DOT cam DOT ac DOT uk X-Cam-AntiVirus: Not scanned X-Cam-SpamDetails: ------=_NextPart_000_00C4_01C32B8C.C7C66670 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Corinna Vinschen wrote: > On Thu, Jun 05, 2003 at 05:25:18PM +0100, 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. >> [...] >> I give proof that dll/exe files are being created sparse above. > > Uhm... I like to think that I'm sufficiently trustworthy not to lie about a clear yes/no fact. But, fine, I've attached my messy code. >> Do you mean proof that sparseness of .exe files is harmful? >> Data has already been posted by me and others showing that sparse files >> consume excess disc space. > > It does if it's used for files smaller than 128K. That's probably > an argument to sparsify a file only if the lseek hole is >= 128K > but it's not an argument against sparse files at all. I'm perfectly > happy with changing this from 64K to 128K, ok? OK, I will up the limit and retry binutils. >> a sparse file - I have no test data, but since sparseness gains me nothing, >> and might lose me something, I dont like it._ > > That's a good argument. I'm speechless. Personally I think "Don't risk anything if there is no potential gain" is reasonably persuasive. >> So, the point is, for the majority of users, sparseness gains nothing, and >> can have undesirable effects. >> Therefore, I really think it should be off by default. > > We're now on the path of opinion. My opinion is to drop 9x/Me > support entirely from Cygwin since it just requires ugly hacks > in the code. But that's not actually an argument to do it in > reality. Well, keeping 9x/Me support gains 9x/Me users a lot. What does sparseness-on-by-default gain users? If anything, I don't see it. Max. ------=_NextPart_000_00C4_01C32B8C.C7C66670 Content-Type: application/octet-stream; name="sparse.cc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="sparse.cc" #include =0A= #include =0A= =0A= void rec (const char* path)=0A= {=0A= WIN32_FIND_DATA FileData; =0A= HANDLE hSearch; =0A= bool fFinished =3D FALSE; =0A= bool fSparse, fDir; =0A= char buf[strlen(path) + strlen("\\*") + 1];=0A= =0A= strcpy(buf, path);=0A= strcat(buf, "\\*");=0A= =0A= hSearch =3D FindFirstFile(buf, &FileData); =0A= if (hSearch =3D=3D INVALID_HANDLE_VALUE) return;=0A= =0A= while (!fFinished) =0A= { =0A= if (FileData.cFileName[0] =3D=3D '.' && (FileData.cFileName[1] =3D=3D = '\0' ||=0A= (FileData.cFileName[1] =3D=3D '.' && FileData.cFileName[2] =3D=3D = '\0')))=0A= goto skip;=0A= =0A= fSparse =3D (FileData.dwFileAttributes & FILE_ATTRIBUTE_SPARSE_FILE) = !=3D 0;=0A= fDir =3D (FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) !=3D 0;=0A= =0A= if (fDir) {=0A= char buf[strlen(path) + strlen(FileData.cFileName) + 2];=0A= sprintf(buf, "%s\\%s", path, FileData.cFileName);=0A= rec(buf);=0A= }=0A= =0A= if (fSparse)=0A= printf("%s\\%s\n", path, FileData.cFileName); =0A= =0A= skip:=0A= if (!FindNextFile(hSearch, &FileData)) =0A= {=0A= fFinished =3D TRUE; =0A= if (GetLastError() !=3D ERROR_NO_MORE_FILES) =0A= printf("FindNextFile ERROR"); =0A= }=0A= }=0A= =0A= FindClose(hSearch);=0A= }=0A= =0A= int main (int argc, char* argv[])=0A= {=0A= if (argc !=3D 2)=0A= {=0A= fprintf(stderr, "Usage: sparse \n");=0A= return 1;=0A= }=0A= =0A= rec(argv[1]);=0A= return 0;=0A= }=0A= ------=_NextPart_000_00C4_01C32B8C.C7C66670 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/ ------=_NextPart_000_00C4_01C32B8C.C7C66670--