Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Unix.readdir problems
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Travis Bemann <tabemann@w...>
Subject: [Caml-list] Unix.readdir problems
I've been having significant problems with using Unix.readdir, where
instead of actually returning directory items in strings, it returns
empty strings for each directory item that it would return otherwise,
in multithreaded *native* code, in the context:

(* Get the contents of a directory. *)
let scan_dir path =
  let dir = Unix.opendir path in
  let rec step acc =
    try step ((Unix.readdir dir) :: acc)
    with End_of_file -> List.rev acc
  in
  let items = step [] in
  Unix.closedir dir;
  items

The code this is run in is multithreaded, but this problem only shows
up when the code is running as native code, rather than being run by
the bytecode runtime.  Note that I'm running Debian 2.2, but with a
newer glibc than the one that came with it as distributed (i think).

I know there's a bug tracker item for this, and a not-very-useful
response to it, both of which are in French; however, it did not
appear to mention it working as bytecode but not as native, or what
any possible workarounds or solutions to be.

Anyone have any knowledge about this and how to either solve or work
around this?

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners