delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/10/31/21:17:01

X-Recipient: archive-cygwin AT delorie DOT 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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=HbWAvsT6aD7o7Gmm
j9hUQueFU/Nk1R1b/slqld57WWF+xFiI+m+bx87yCZhgUoM2q2xBE3op56UuzLMA
7EMGfQq1bkOTOjungQGmdZUVzQFdJhx/5mQNziX4CKOrnaF34JUOQSsf4hxeUZ8B
1xUlfQmUHiyNhqy0PbwacFP/NzQ=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=asCpbc2Yb8RBwXjrbiH1YU
cZmJo=; b=keggkGmTx3CWx5BFmFDaTP84UccInsjLmScuPjPZQwYXdrlTjjB28j
gv2af0+STV/DV8zySxKj//oVpncjichETBKPy/aqNZKMlo9uNrSVemix4JZrNPeA
O5bA7DEUn/CbSvc28mrbLR5cRkQHkZxzrPs0fB776IdiROIon0XvY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*F:U*mark, H*UA:6.1, H*u:6.1
X-HELO: m0.truegem.net
Subject: Re: RFE: find <path> -d -size 0 => doesn't find empty directories
To: cygwin AT cygwin DOT com
References: <5BDA347D DOT 8070909 AT tlinx DOT org>
From: Mark Geisert <mark AT maxrnd DOT com>
Message-ID: <a0f243ea-c208-1ad2-84c2-3f2d1815cc99@maxrnd.com>
Date: Wed, 31 Oct 2018 18:16:37 -0700
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46
MIME-Version: 1.0
In-Reply-To: <5BDA347D.8070909@tlinx.org>

L A Walsh wrote:
> Something I can use on my /tmp files on linux is a find command:
>
> find /tmp -size 0 -delete
>
> 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.
>
> 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?

Try 'find -d -empty'

..mark


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

- Raw text -


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