delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/19/10:44:18

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: <00f301c31e12$c29efdb0$6400a8c0@FoxtrotTech0001>
From: "Bill C. Riemers" <cygwin AT docbill DOT net>
To: <martin AT xemacs DOT org>, "Max Bowsher" <maxb AT ukf DOT net>
Cc: <cygwin AT cygwin DOT com>
References: <16072 DOT 892 DOT 778395 DOT 24290 AT gargle DOT gargle DOT HOWL><003901c31d8c$6ec495f0$78d96f83 AT pomello> <16072 DOT 6666 DOT 10124 DOT 338022 AT gargle DOT gargle DOT HOWL>
Subject: Re: SPARSE files considered harmful - please revert
Date: Mon, 19 May 2003 10:27:17 -0400
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

Only executable files should be sparse files...  Under Linux, the executable
bit is checked by cp.  (Or at least this was true several years ago, when I
last looked at the code.)  Only if the file is marked as executable is it
possibly made sparse.  Unfortunately, under CYGWIN, virtually everything is
marked as executable, even though most are not.

There are two ways to correct this problem:
    1. Change all your permissions recursively with a find command like:
        find / -type f -perm +111 \( -not \( -name \*.exe -or -name
\*.dll -or -name \*.sys -or -name \*.pm -or -name \*.pl -or -name
\*.tcl -or -name \*.pyc -or -name \*.py -or -name \*.sh -or -name
\*.done -or -name \*.bat -or -name \*.el -or -name \*.elc -or -name \*.cgi
\) \) -exec checkx \{\} \; -exec chmod ugo-x \{\} \;

     Where the checkx script is:

#!/bin/bash
f=`file "$1" |grep -vi '.*:.*script'`
if [ -n "$f" ] ; then
  echo "$f"
  exit 0
fi
exit 1

    or
            2:  Change code to check for *.dll or *.exe extensions instead
of checking for the executable bit.

Granted sometimes you do have a data file which can be made sparse.
However, unless you are familiar with the code used to read the file, this
is very dangerous.  So this should be decided on a case by case basis.

                                           Bill



----- Original Message ----- 
From: "Martin Buchholz" <martin AT xemacs DOT org>
To: "Max Bowsher" <maxb AT ukf DOT net>
Cc: <cygwin AT cygwin DOT com>
Sent: Sunday, May 18, 2003 7:40 PM
Subject: Re: SPARSE files considered harmful - please revert


> >>>>> "Max" == Max Bowsher <maxb AT ukf DOT net> writes:
>
> Max> May I suggest a middle road? Why not let sparse files be configurable
as a
> Max> $CYGWIN option? This would allow those users who actually want them
to
> Max> enable them with minimal effort, but keep them off for most users.
>
> I suspect that SPARSE files are genuinely useful, when storing large
> files that have holes in them.  But I can't imagine one ever wanting
> to use SPARSE for all files, because most files aren't like that.  So
> I don't think sparseness is a good candidate for being put into
> $CYGWIN.
>
> We could have a much cleverer implementation of sparseness, if we kept
> statistics on the number and size of zero bytes in a file while it was
> being written.  When we did the close(), we could automatically
> transform it into a sparse file.  But I don't think even that should
> be the default behavior, because it would make all IO slower.
>
> A program I might actually use myself is one that examines a file on
> disk to see if it could be stored more compactly as a sparse file, and
> transform it if that were the case.  Give it a -r option, and you
> would have a "disk optimizer".  You can do something similar on Unix.
>
> Martin
>
> --
> 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/
>



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