www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/23/09:21:01

Date: Wed, 23 Oct 1996 14:59:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Marc Singer <elf AT netcom DOT com>
Cc: DJGPP List Alias <djgpp AT delorie DOT com>
Subject: Re: Permissions for FIND?
In-Reply-To: <199610230947.CAA12757@netcom16.netcom.com>
Message-Id: <Pine.SUN.3.91.961023145314.7877B-100000@is>
Mime-Version: 1.0

On Wed, 23 Oct 1996, Marc Singer wrote:

> I am trying to find the read only files on my DOS hard drive using the
> djgpp hosted version of find.  There does not appear to be anything in
> the info files about the DOS specific permission bits.  I've tried
> lots of combinations and suspect that the support for permissions
> (-perm) is broken.  Am I wrong?  Does anyknow know how permissions map
> in DOS?

DOS-specific mode bits (such as hidden, system, volume, and archive) are 
indeed not supported by `find', since it calls `stat' which doesn't know 
about those DOSisms.  However, the read-only bit *is* supported, because 
it just means that the write bit is NOT set.  Therefore, the following 
should accomplish what you need:

	find . -perm a=r -print
or
	find . -perm 0222 -print

If you need the DOS-specific attributes, you will have to write a trivial
program that tests for a certain attribute and returns 0 if it's set or 1
if it's not; then just invoke it with -exec option to `find'. 

Note that I tested this with the latest port of `find' from DJGPP v2.01, 
so maybe the port that came with v2.0 behaves differently (although I 
doubt if anything was changed in this regard).

- Raw text -


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