From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119183 invoked by alias); 1 Nov 2018 16:20:07 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 119152 invoked by uid 89); 1 Nov 2018 16:20:07 -0000 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 Received: from forward103j.mail.yandex.net (HELO forward103j.mail.yandex.net) (5.45.198.246) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Nov 2018 16:20:04 +0000 Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 405AF6741C33; Thu, 1 Nov 2018 19:20:01 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id RLT3dBdbXk-K078XbvI; Thu, 01 Nov 2018 19:20:01 +0300 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= Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id GPDwLitSC2-K06OW4F9; Thu, 01 Nov 2018 19:20:00 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) 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 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Thu, 01 Nov 2018 16:12:49 -0000 Date: Thu, 01 Nov 2018 16:20:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <1792215646.20181101191249@yandex.ru> To: L A Walsh , cygwin@cygwin.com Subject: Re: RFE: find -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 X-SW-Source: 2018-11/txt/msg00007.txt.bz2 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