X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=Q03Y21c1W0rFZ4Xz
	6KN+Raqb8oxzhVIVvDkjIrINlZWHxU646WvM7zY9d2lHxURtIIj4qF4V6c7uUkI7
	bz6P41A8VcQMEOkYOuujqVXSO88AyNbIJ7mQpHPdzdB8eXRo8ewIuhZ6Uh7Md056
	/eWavjycrASyVjj4IC/ZCvoWZq8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=vzOyKziqSegtPv51ssHdMU
	wR3fQ=; b=sEjFGs0L2fKyT0r2RA24QkubIk7h4SA4HnDs/oqNhETH24H3115LnO
	8VnwwUraLOr9477IbLJ7uR5J5fXToe/Cgcb4tsN+jCIt6yFzDiKCbxcho3RnPq3T
	oLcVuM63FwgPaQUD3b75t64s4MwMvXrjYWbscIkoj9U9lcDGgReCc=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*UA:Bat!, Ie, UD:I.e, I.e
X-HELO: forward103j.mail.yandex.net
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1541089201;	bh=yNTDStt38hLFEbViBWeXMCpeEGq65RauoCK+X0kRfTU=;	h=Date:From:Reply-To:Message-ID:To:Subject:In-Reply-To:References;	b=QjnA1geaeoCbpI4tVEF7vJj2nfRulAVNf5JscbjXGHOEHIOMGS+uP76U7SecIfKsc	 ac+fR7R+fgkY1j9qLhrFb5cr7V8b2t7iQHp7ju9sTtga07i3E26mRg9fts7qnUaawt	 RAUGnRTXucg/8XhGxdmvum0EuRl8UOHK7e34BlNE=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1541089200;	bh=yNTDStt38hLFEbViBWeXMCpeEGq65RauoCK+X0kRfTU=;	h=Date:From:Reply-To:Message-ID:To:Subject:In-Reply-To:References;	b=Z0bqZlwwVYJvCDKLEZPSykeTogEdiNsp1Sd/YT/2pMjA0TIUzwFuB5qb79cAak7LA	 sl1G2YsHwxo1+Aebfmd1wNAuLcuL4BSksKVto/fqWbLKdDldjeGJNtvOoXgF0xB7uS	 gw+qw/EgURlc3WC1pc7kgaJeS9VRkB996N3tu34s=
Authentication-Results: smtp4j.mail.yandex.net; dkim=pass header.i=@yandex.ru
Date: Thu, 1 Nov 2018 19:12:49 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <1792215646.20181101191249@yandex.ru>
To: L A Walsh <cygwin@tlinx.org>, cygwin@cygwin.com
Subject: Re: RFE: find <path> -d -size 0 => doesn't find empty directories
In-Reply-To: <5BDA347D.8070909@tlinx.org>
References: <5BDA347D.8070909@tlinx.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, L A Walsh!

> Something I can use on my /tmp files on linux is a find command:

> find /tmp -size 0 -delete

Do note that -size on directories is filesystem dependent.
I.e. on ext2+ it's the number of bytes allocated to directory structure, in
multiplies of whole blocks.

> to delete zero-len-files or empty-directories in /tmp.

> Unfortunately, due to directories really not being in the user
> disk data space, but in the MFT(zone) (I think), the size
> comes back as zero ('0') for directories.

Just as predicted.
If you want to find files, search for files.

find . -type f ...

> Would it be possible (if not problematic) for the cygwin
> emulation layer to return some non-zero value if the
> directory has actual entries in it (ignoring structural
> values like "." and "..")?  Maybe return as 'size' either
> a dummy number proportional to #entries (like 10*#entries),
> or something like summing up actual number (+1) of characters
> in the file list?

> Would that be difficult to do, or add?

Having something to this extent would be useful in case of searching for
directories with too many files, for example.

I'd vote for something like (entries << 7), which is closer to an average ext2
counter. No need to ignore anything.


-- 
With best regards,
Andrey Repin
Thursday, November 1, 2018 19:00:26

Sorry for my terrible english...


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

