caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Hendrik Boom <hendrik@topoi.pooq.com>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] stat of nonexistent file
Date: Mon, 25 Jul 2016 15:23:21 +0200	[thread overview]
Message-ID: <5F652B2186AD4689BFA57530C257846A@erratique.ch> (raw)
In-Reply-To: <20160725125559.GA3606@topoi.pooq.com>

Le lundi, 25 juillet 2016 à 14:55, Hendrik Boom a écrit :
> (a) What do they do?

The general design philosophy of the Unix library is to simply forward the call to the equivalent C function, turning errors in to a `Unix.Error` exception. So the question is usually resolved by looking at the documentation of the C function. In that particular case if the file doesn't exist you will get an exception with the NOENT error.
  

> (b) Should this be specified in the documentation?

I think it would be good if the documentation of the Unix module linked to the documentation of the C functions in the POSIX standard (you will notice the ocamlunix book usually does this when functions are introduced).


> (c) Are these suitable functions to determine if a file exists?
Yes. Don't forget to retry the call on EINTR though.

Best,  

Daniel
  



      reply	other threads:[~2016-07-25 13:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 12:55 Hendrik Boom
2016-07-25 13:23 ` Daniel Bünzli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5F652B2186AD4689BFA57530C257846A@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    --cc=hendrik@topoi.pooq.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).