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

feature wish: read_file + read_channel #2630

Closed
vicuna opened this issue Dec 3, 2000 · 2 comments
Closed

feature wish: read_file + read_channel #2630

vicuna opened this issue Dec 3, 2000 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Dec 3, 2000

Original bug ID: 239
Reporter: administrator
Status: closed (set by @xavierleroy on 2015-12-11T18:04:21Z)
Resolution: won't fix
Priority: low
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Child of: #2559

Bug description

Hello,

this is a followup to #2559 (feature wish: "read_channel"). My code
example for "read_channel_aux" contains correct but redundant code and
should look as follows (whomever it may concern):


let rec read_channel_aux len lst buf_size ch =
let buf = String.create buf_size in
let n = input ch buf 0 buf_size in
if n <> 0 then read_channel_aux (len+n) ((buf,n)::lst) buf_size ch
else begin
let res = String.create len in
copy_lst res len lst;
res end

Sorry for my perfectionism ;)

Best regards,
Markus Mottl

--
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl

@vicuna
Copy link
Author

vicuna commented Nov 6, 2002

Comment author: administrator

see #2559

@vicuna
Copy link
Author

vicuna commented Mar 12, 2012

Comment author: @damiendoligez

The official word on this feature:

You should use Jane St Core, or Batteries, or Extlib, which all provide this functionality.

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

No branches or pull requests

1 participant