delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/12/18/07:59:00

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:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=pg3FXp3kkyxLwP6T
coRjICRp7cKXveufv5LyEAGQCHuKtYK9k1XMjH479GcVEOjPy8bQNfddfudUoQr/
CLMZ6SG5tezMV/fHTe/AE6l8znD6hYt21Rx5VdbNFiGgK7FqWmo5Nt8L+7olaLMJ
J4tFJ1DQK/e5ShAZHqtC4ryohvE=
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:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=Cn7d6A0os7BGjXFKb1YJ44
9Rq1A=; b=jjFSKhGK8suLII6GsCUyqnTQX0ERuic8yzXfGwzytL4WyXtzL1GUb8
8W5q26QcPoaopbkwal0iUWRS3UKlSslViDlF71ZdTHD4SD3DMMDQKNGAFrPuR13E
FmDxCv/jBc90mOmk4S3ElNhyP/FqDS3UYRYvEyUe+0LA3OSIxYKNc=
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=-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
Reply-To: moss AT cs DOT umass DOT edu
Subject: Re: Exclude System entries with "ls" or "find"
To: cygwin AT cygwin DOT com
References: <5c184377 DOT 1c69fb81 DOT 7df8f DOT 9525 AT mx DOT google DOT com> <20181218081347 DOT GD28727 AT calimero DOT vinschen DOT de>
From: Eliot Moss <moss AT cs DOT umass DOT edu>
Message-ID: <177791e4-5933-a0f0-341c-75b8b19437ea@cs.umass.edu>
Date: Tue, 18 Dec 2018 07:58:42 -0500
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>
X-IsSubscribed: yes

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

- Raw text -


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