From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18234 invoked by alias); 18 Dec 2018 12:58:48 -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 18213 invoked by uid 89); 18 Dec 2018 12:58:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=stamps, H*Ad:D*edu X-HELO: mailsrv.cs.umass.edu Received: from mailsrv.cs.umass.edu (HELO mailsrv.cs.umass.edu) (128.119.240.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Dec 2018 12:58:45 +0000 Received: from [192.168.0.7] (c-24-62-203-86.hsd1.ma.comcast.net [24.62.203.86]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id 43DE7401CBC0; Tue, 18 Dec 2018 07:58:43 -0500 (EST) Reply-To: moss@cs.umass.edu Subject: Re: Exclude System entries with "ls" or "find" To: cygwin@cygwin.com References: <5c184377.1c69fb81.7df8f.9525@mx.google.com> <20181218081347.GD28727@calimero.vinschen.de> From: Eliot Moss Message-ID: <177791e4-5933-a0f0-341c-75b8b19437ea@cs.umass.edu> Date: Tue, 18 Dec 2018 15:51:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181218081347.GD28727@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00166.txt.bz2 On 12/18/2018 3:13 AM, Corinna Vinschen wrote: >> as can be seen, Command Prompt has a way to exclude System items. Does Cygwin >> have some way to do this, perhaps with "ls" or "find"? > > You're asking POSIX tools to recognize DOS attributes... True; expanding on Corinna's response slightly. I used "touch" to create a file. I looked at its Windows access control information with icacls. I then used Windows attrib to set the SYS attribute and looked at the ACL again with icacls. There was no difference. The reason this is relevant is that the information printed by (e.g., ls -l) is based on a mapping Cygwin provides from Windows ACLs to POSIX permissions and ACLs. (That mapping is *not* one-to-one, because the models are substantially different, but Cygwin does what it can, and its mapping has been refined over time to something that seems most useful, but that can sometimes have its pitfalls if you don't use it carefully.) The reason I mention the above was to demonstrate something that I already knew: the Windows attribute bits are orthogonal to (distinct from) permissions / access related information. While access information has an analog in POSIX, the attribute bits do not. So Cygwin tools don't look at / display them, while that *do* map access control, date/time stamps, etc., as well as they can. However, you can run DOS attrib from Cygwin, just like any Windows program, and parse its output. So it would be possible to use a combination of Windows and Cygwin tools to do what you're seeking, though not necessarily with high efficiency, etc. Regards - Eliot Moss -- 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