[mercury-users] Problem with mmake

Fergus Henderson fjh at cs.mu.OZ.AU
Thu May 31 14:42:02 AEST 2001


On 31-May-2001, Richard A. O'Keefe <ok at atlas.otago.ac.nz> wrote:
> Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 	On Solaris 2.7 (SunOS 5.7), /bin/cat seems to do the right thing for
> 	directories (i.e. it reports an error "cat: input error on foo.d:
> 	Invalid argument").  Which version of Solaris are you using?
> 	
> Ever since NFS came out, SunOS and then Solaris have been consistently
> inconsistent here.  *Local* directories are readable, *NFS* directories
> are not.  I discovered this the hard way 15 years ago, when a certain
> directory was readable on the server but not a client.  It has nothing
> to do with 'cat'; _any_ program trying to open a directory on a local hard
> disc for input will succeed, _any_ program trying to open an NFS-mounted
> directory for input will fail.

I actually tested it out in /tmp, which is using the "swap" file system.
On that file system, directories are not readable.

But you're right that directories are readable on local disk files,
and that the problem is the same with GNU cat as with /bin/cat.
I wrongly concluded that GNU cat worked, on the basis of an insufficiently
diverse test sample.

> Here is the simple fix.  

Unfortunately when trying to write portable software, few things are
simple :-(

The main problem that I can see with your suggested fix is that the code
is POSIX code, but some of the systems that we're trying to port to --
in particular Windows with Mingw or MSVC as the C compiler -- are not POSIX
systems.  On those systems we can use bash and cat from Mingw or Cygwin,
and probably test -d too, but we can't use Posix stuff like readdir(),
at least not unless we require people to install Cygwin, and make sure
that the installation process compiles that file with the Cygwin gcc
rather than the Mingw gcc. IMHO doing that would inconvenience the Windows
users more than leaving things as is will inconvenience the Solaris users.

I still think it is an OS bug, and since it is easy to work around
at the user level (either by not naming directories *.d or by using
--use-subdirs), I don't think it is worth adding code to the Mercury
implementation to work around this OS bug unless the additional code
added is very simple and unlikely to cause portability problems.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list