Date: Wed, 23 Oct 1996 14:59:17 +0200 (IST) From: Eli Zaretskii To: Marc Singer Cc: DJGPP List Alias Subject: Re: Permissions for FIND? In-Reply-To: <199610230947.CAA12757@netcom16.netcom.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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).