[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Detecting ro Filesystem

On Sat, May 03, 2003 at 09:44:45PM -0500, John Hasler wrote:
> What is a reliable, robust, and simple way to detect that a file is on a ro
> filesystem?

No because there are a lot of influences. Cause you can try to parse the
mountpoint, but that will not catch other restrictions like ACLs, Labels and
so on. The most easiest thing is to open the file for write, and perhaps
even try to write to it. Be aware that it might be in append only or copy on
write mode.

  (OO)      -- Bernd_Eckenfels@Wendelinusstrasse39.76646Bruchsal.de --
 ( .. )  ecki@{inka.de,linux.de,debian.org} http://home.pages.de/~eckes/
  o--o     *plush*  2048/93600EFD  eckes@irc  +497257930613  BE5-RIPE
(O____O)  When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!

Reply to: