Robert Roessler writes:
> Mark White wrote:
> > Can anybody suggest a convenient way of using
Bigarray's
> > map_file feature with a file offset (that is,
mapping a
> > chunk of the file not beginning at the first
byte)?
>
> Define "convenient"... ;)
Guess I probably meant "not having to re-write
Bigarray"
> In any case, it looks like "map_file" would
need to have a second
> version (e.g., "map_file_with_offset") that
had an extra parameter for
> the offset. If there was a "labeled"
version of Bigarray, then this
> could just be an optional param defaulting to 0.
>
> Then the offset would have to be factored into the
various file size
> vs array size computations and comparisons, and finally
passed on to
> the OS API calls (mmap itself for *nix, and
MapViewOfFile for Win32).
Hm, this doesn't look so bad, actually: half a dozen tiny
changes each each in mmap_unix.c and mmap_win32.c, plus
corresponding type updates to the OCaml side. A small
module with just an updated map_file function could produce
data structures that play nicely with the rest of Bigarray.
Or I could just buy yet more RAM...
> Of course, the obvious easy case is just
"ignoring" some number of
> initial elements in the Bigarray IFF it happens that
"offset" number
> of bytes is exactly some number of your Bigarray
elements... but this
> is fairly limited as solutions go.
Indeed; and in my case I want to map multi-dimensional
Genarrays, which makes it pretty much a non-starter.
Thanks,
Mark <><
------------------------ Yahoo! Groups Sponsor
--------------------~-->
Great things are happening at Yahoo! Groups. See the new
email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/saFolB/TM
------------------------------------------------------------
--------~->
Archives up to August 22, 2005 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
The archives of the very official ocaml list (the seniors'
one) can be found at http://caml.inria.fr
Attachments are banned and you're asked to be polite, avoid
flames etc.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http:/
/groups.yahoo.com/group/ocaml_beginners/
<*> To unsubscribe from this group, send an email to:
ocaml_beginners-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|