Hey Sam, I've been trying to read the first 100 lines from a file with the
following code (hoping to replace the 100 with some way to count how large a
file is - which is another thing I have been having issues with)

"readFromFile",
   (p1 (fun file ->
                   let value =
                     let ic = open_in (unbox_string file)
                     and buf = "" in
                         really_input ic buf 0 100;
                         buf
                   in
                   box_string buf),

       datatype "(String) ~> (String)",
   PURE);

which compiles fine, but when I run it in Links I get the following error:

*** Error: Invalid_argument("really_input")

Am I missing something?

Once again, thanks for any help you can provide,
Simon


On Sat, Mar 6, 2010 at 11:20 PM, Sam Lindley <[email protected]> wrote:

> Quoting Simon Vansintjan <[email protected]>:
> [..]
>
>> For defining the functions with lib.ml, I was wondering whether Links
>> uses
>> the (the Std  module<
>> http://ocaml-extlib.googlecode.com/svn/doc/apiref/Std.html>
>>
>> seemed
>> of particular interest) extended library for OCaml or whether I'm going to
>> have to work with just out_channel and in_channel. I don't know too much
>> OCaml (at all) so any pointers here would be much appreciated.
>>
>
> We don't use extlib. It's pretty straightforward to use out_channel and
> in_channel though. I guess the best source of info on OCaml is probably the
> documentation on the OCaml website.
>
> Sam
>
>
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
> _______________________________________________
> links-users mailing list
> [email protected]
> http://lists.inf.ed.ac.uk/mailman/listinfo/links-users
>
_______________________________________________
links-users mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/links-users

Reply via email to