|Anonymous | Login | Signup for a new account||2014-09-30 12:20 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000352||OCaml||OCaml general||public||2001-05-04 11:42||2013-07-29 07:16|
|Target Version||Fixed in Version||3.13.0+dev|
|Summary||0000352: have ocaml support the '-' option (for standard input)|
|Description||Full_Name: Sven Luther|
OS: debian GNU/linux
Submission from: lambda.u-strasbg.fr (22.214.171.124)
Note : this is a feature wish, i didn't find the 'priority' entry in the bug
fill form, so ...
I wanted to run the labgltk examples from the lablgtk debian package, they are
on a read only directory, and some of them are compressed.
it is easy to run the uncompressed ones (lablgtk -labels file.ml), but not so
easy to run the compressed ones.
I thought it would be nice to be able to do as follows :
gunzip -c file.ml.gz | lablgtk -labels -
but ocaml clearly don't support this syntax yet.
I know about at least 2 workaround :
1) under bash you cna do :
(gunzip -c testgtk.ml.gz; echo ";;") | lablgtk -labels
but this will scroll up the display, and is not so nice.
2) you can also do :
gunzip -c testgtk.ml.gz | lablgtk -labels /dev/fd/0
but i don't think this is the nicest of solutions
3) it could be possible also to patch toplevel/toploop.ml,changing :
< let filename = find_in_path !Config.load_path name in
< let ic = open_in_bin filename in
> let (filename, ic) =
> if name = "-" then
> (name, stdin)
> let filename = find_in_path !Config.load_path name in
> (filename, open_in_bin_filename) in
or something such more appropriate.
Thanks to Nicolas GEORGE <firstname.lastname@example.org>, for hinting me to those and
provide the (untested) patch.
What do you think of it ? Is this something that would be a nice addition to
ocaml, or is it not worth it, to difficult to do ?
Also you could link ocaml with zlib, so as to be able to read compressed files
directly, but i don't know if it is worth it.
|Tags||No tags attached.|
|Looks good. To be implemented.|
[speaking for the OCaml toplevel rather than labltk]
The "-" syntax is already used by this option:
- <file> Treat <file> as a file name (even if it starts with `-')
So I have implemented it as a "-stdin" option.
Implemented in trunk (3.13).
|2005-11-18 10:13||administrator||New Issue|
|2011-12-30 17:12||doligez||Assigned To||=> doligez|
|2011-12-30 17:12||doligez||Status||acknowledged => assigned|
|2011-12-30 17:29||doligez||Note Added: 0006568|
|2011-12-30 17:29||doligez||Status||assigned => closed|
|2011-12-30 17:29||doligez||Resolution||open => fixed|
|2011-12-30 17:29||doligez||Fixed in Version||=> 3.13.0+dev|
|2011-12-30 17:29||doligez||Description Updated||View Revisions|
|2013-07-29 07:16||gasche||Relationship added||related to 0005232|
|Copyright © 2000 - 2011 MantisBT Group|