English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: mmap for O'Caml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-12-12 (22:07)
From: Juergen Pfitzenmaier <pfitzen@i...>
Subject: Re: mmap for O'Caml
John Prevost wrote:
>  As far as I can tell, there's no way to find out whether a given fd is
>  open read only or read-write or even write-only without actually
>  trying to read or write it.  This means I can't detect at mmap time
>  that something's wrong.  So my options are:

POSIX has functions stat and fstat. They write info about a file
in a struct stat. One member of the struct is st_mode. You can
use macros like S_IWUSR to check if the owner of the file has
write permission. See   man 2 stat   for details.

Oooh, this means using C code and not OCaml, but that should be
no problem. You are already using C for your mmap stuff.

I would really like to see some work on using/writing a DB with OCaml
(anyone with an interface for DB/2 out of the box ?) so I look forward
to your project.