Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000352OCaml~DO NOT USE (was: OCaml general)public2001-05-04 11:422013-07-29 07:16
Assigned Todoligez 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.13.0+dev 
Summary0000352: have ocaml support the '-' option (for standard input)
DescriptionFull_Name: Sven Luther
Version: 3.01
OS: debian GNU/linux
Submission from: (

Note : this is a feature wish, i didn't find the 'priority' entry in the bug
fill form, so ...

Hello, ...

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, but not so
easy to run the compressed ones.

I thought it would be nice to be able to do as follows :

gunzip -c | 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; echo ";;") | lablgtk -labels

but this will scroll up the display, and is not so nice.

2) you can also do :

gunzip -c | 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/,changing :

< let filename = find_in_path !Config.load_path name in
< let ic = open_in_bin filename in

to :

> let (filename, ic) =
> if name = "-" then
> (name, stdin)
> else
> 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 <>, 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.


Sven Luther
(Thanks to

TagsNo tags attached.
Attached Files

- Relationships
related to 0005232confirmed wish: -str option for ocaml 

-  Notes
administrator (administrator)
2002-11-13 15:39

Looks good. To be implemented.
doligez (administrator)
2011-12-30 17:29

[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).

- Issue History
Date Modified Username Field Change
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
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker