[erlang-bugs] ioi:columns bug

Jean-Charles Campagne ml.jc.campagne@REDACTED
Thu May 30 10:17:47 CEST 2013


Hi Joe,

Not sure what is going here either, I stumble upon the same issue like this. I did not have the opportunity to get to the bottom of it though.

However, using "-noshell" does not generate an error.

   $ erl -s bug test -noshell
   {ok,143}


Then again that might be incompatible with what you are trying to achieve. Hope that sheds some light. It worked for me as I did not need to have a shell in the end.

Also, I noticed that specifying 'standard_err' as IoDevice works (but not 'standard_io'), as in:

======================================================
-module(bug_err).
-compile(export_all).

test_err() ->
    io:format("~p~n", [io:columns(standard_error)]).
======================================================

  $ erl -s bug_err test_err
  Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]
  
  {ok,143}
  Eshell V5.9.3.1  (abort with ^G)
  1> 
======================================================

My guess is standard_io somehow is not opened/accessible.

My 2cents.

Regards,
Jc

On 29 mai 2013, at 15:02, Joe Armstrong <joearms@REDACTED> wrote:

> io:columns() does not work in a process spawned from the command line
> 
> -module(bug).
> -compile(export_all).
> 
> test() ->
>    io:format("~p~n", [io:columns()]).
> 
> When I run this in a shell it works
> 
> 2> c(bug).
> {ok,bug}
> 3> bug:test().
> {ok,132}
> ok
> 
> But not from the command line
> 
>> erl -s bug test
> Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:4:4]
> [async-threads:10] [hipe] [kernel-poll:false]
> 
> Eshell V5.10.1  (abort with ^G)
> 1> {error,enotsup}
> 
> Something is strange - the group leader of a process launched from the
> command line is different to the shell group leader. But I can do io:format
> from a command launched from the command line --- what's happening here?
> 
> /Joe
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs




More information about the erlang-bugs mailing list