Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lwt_unix.file_exists can raise Unix.ENOTDIR #316

Closed
samoht opened this issue Feb 15, 2017 · 1 comment
Closed

Lwt_unix.file_exists can raise Unix.ENOTDIR #316

samoht opened this issue Feb 15, 2017 · 1 comment

Comments

@samoht
Copy link

samoht commented Feb 15, 2017

Test case:

$ touch foo
$ ocaml
# require "lwt.unix";;
# Lwt_main.run (Lwt_unix.file_exists "foo/bar");;
Exception: Unix.Unix_error (Unix.ENOTDIR, "stat", "_log/toto").
# Sys.file_exists "foo/bar";;
- : bool = false
samoht added a commit to samoht/ocaml-git that referenced this issue Feb 15, 2017
@mfp mfp closed this as completed in 363e061 Feb 18, 2017
@mfp
Copy link
Collaborator

mfp commented Feb 18, 2017

I went ahead and committed this even though it breaks "bug for bug" compatibility because existent code able to cope with spurious exceptions raised by file_exists must handle the case where it returns false anyway, and it seems very unlikely anybody would rely on these exceptions being raised (and handle them differently to the false case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants